Focal Point
[SOLVED] SAP/R3 ERROR EXECUTING ABAP4 PROGRAM : T_BACKORDER_BY_ID_PLANT

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/148100104

March 22, 2010, 06:15 PM
vkrugman
[SOLVED] SAP/R3 ERROR EXECUTING ABAP4 PROGRAM : T_BACKORDER_BY_ID_PLANT
Hi!

Need help in this issue:

We have a table ZAPPTHDR that needs to be joined to a Function Modul(SAP)- Z_APPT_BACKORDER_BY_ID_PLANT which has input parameters:IN_APPT_ID and IN_PLANT.

Here is a code we use and after many tries keep getting the error "(SAP/R3 ERROR EXECUTING ABAP4 PROGRAM : T_BACKORDER_BY_ID_PLANT"

Advise?

This is helpfull info:


Function modul was created manually:

$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ SNAPpack generated on Mon Mar 22 15:11:59 2010
$ SAP instance: TST SAP Release: 640
$ MFD generated for Function Module: Z_APPT_BACKORDER_BY_ID_PLANT
$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
FILENAME=T_BACKORDER_BY_ID_PLANT,SUFFIX=SQLSAP ,
REMARKS='Appointment Backorder Webfocus', $
SEGMENTT_BACKORDER_BY_ID_PLANT SEGTYPE=S0, $
$
$ , ================================================
$ , IMPORT parameter ZAPPT_ID (SAP Type)
$ , ================================================
FIELDNAME=IN_APPT_ID, ALIAS=ZAPPT_ID, USAGE=A10, ACTUAL=A10,
TITLE='Appointment ID', DESCRIPTION='Appointment ID', $
$
$ , ================================================
$ , IMPORT parameter ZAPPT_WERKS (SAP Type)
$ , ================================================
FIELDNAME=IN_PLANT, ALIAS=ZAPPT_WERKS, USAGE=A4, ACTUAL=A4,
TITLE='Plant', DESCRIPTION='Plant', $
$
$ , ================================================
$ , EXPORT parameter ZAPPT_BO_AMT (SAP Type)
$ , ================================================
FIELDNAME=BACK_ORD_AMT, ALIAS=ZAPPT_BO_AMT, USAGE=P9.2, ACTUAL=P4,
TITLE='BO Estimate Amount', DESCRIPTION='BO Estimate Amount', $
$
$ , ================================================
$ , EXPORT parameter ZAPPT_ID (SAP Type)
$ , ================================================
FIELDNAME=OUT_APPT_ID, ALIAS=ZAPPT_ID, USAGE=A10, ACTUAL=A10,
TITLE='Appointment ID', DESCRIPTION='Appointment ID', $
$
$ , ================================================
$ , EXPORT parameter ZAPPT_WERKS (SAP Type)
$ , ================================================
FIELDNAME=OUT_PLANT, ALIAS=ZAPPT_WERKS, USAGE=A4, ACTUAL=A4,
TITLE='Plant', DESCRIPTION='Plant', $
$
$ , ================================================
$ , TABLE parameter based on structure BAPIRET2
$ , ================================================
$
SEGMENT=OUT_RETURN, SEGTYPE=S0, PARENT=T_BACKORDER_BY_ID_PLANT, $
FIELDNAME=OUT_RETURN_TYPE, ALIAS=TYPE, USAGE=A1, ACTUAL=A1,
TITLE='Msg type', DESCRIPTION='Message type: S Success, E Error, W Warning, I Info, A Abort', $
FIELDNAME=OUT_RETURN_ID, ALIAS=ID, USAGE=A20, ACTUAL=A20,
TITLE='Message ID', DESCRIPTION='Messages, Message Class', $
FIELDNAME=OUT_RETURN_NUMBER, ALIAS=NUMBER, USAGE=A3, ACTUAL=A3,
TITLE='Message no', DESCRIPTION='Messages, Message Number', $
FIELDNAME=OUT_RETURN_MESSAGE, ALIAS=MESSAGE, USAGE=A220, ACTUAL=A220,
TITLE='Message', DESCRIPTION='Message Text', $
FIELDNAME=OUT_RETURN_LOG_NO, ALIAS=LOG_NO, USAGE=A20, ACTUAL=A20,
TITLE='Log no.', DESCRIPTION='Application log: log number', $
FIELDNAME=OUT_RETURN_LOG_MSG_NO, ALIAS=LOG_MSG_NO, USAGE=A6, ACTUAL=A6,
TITLE='Msg. no.', DESCRIPTION='Application log: Internal message serial number', $
FIELDNAME=OUT_RETURN_MESSAGE_V1, ALIAS=MESSAGE_V1, USAGE=A50, ACTUAL=A50,
TITLE='Msg.Var', DESCRIPTION='Messages, message variables', $
FIELDNAME=OUT_RETURN_MESSAGE_V2, ALIAS=MESSAGE_V2, USAGE=A50, ACTUAL=A50,
TITLE='Msg.Var', DESCRIPTION='Messages, message variables', $
FIELDNAME=OUT_RETURN_MESSAGE_V3, ALIAS=MESSAGE_V3, USAGE=A50, ACTUAL=A50,
TITLE='Msg.Var', DESCRIPTION='Messages, message variables', $
FIELDNAME=OUT_RETURN_MESSAGE_V4, ALIAS=MESSAGE_V4, USAGE=A50, ACTUAL=A50,
TITLE='Msg.Var', DESCRIPTION='Messages, message variables', $
FIELDNAME=OUT_RETURN_PARAMETER, ALIAS=PARAMETER, USAGE=A32, ACTUAL=A32,
TITLE='Parameters', DESCRIPTION='Parameter Name', $
FIELDNAME=OUT_RETURN_ROW, ALIAS=ROW, USAGE=I10, ACTUAL=I4,
TITLE='Line', DESCRIPTION='Lines in parameter', $
FIELDNAME=OUT_RETURN_FIELD, ALIAS=FIELD, USAGE=A30, ACTUAL=A30,
TITLE='Field', DESCRIPTION='Field in parameter', $
FIELDNAME=OUT_RETURN_SYSTEM, ALIAS=SYSTEM, USAGE=A10, ACTUAL=A10,
TITLE='System', DESCRIPTION='Logical system from which message originates', $


FILENAME= Z_APPT_BACKORDER_BY_ID_PLANT
IN_APPT_ID ZAPPT_ID A10
IN_PLANT ZAPPT_WERKS A4
BACK_ORD_AMT ZAPPT_BO_AMT P9.2
OUT_APPT_ID ZAPPT_ID A10
OUT_PLANT ZAPPT_WERKS A4
OUT_RETURN_TYPE TYPE A1


TABLE FILE ZAPPTHDR
PRINT APPT_STAT
APPT_ID
PLANT
WHERE PLANT IS 'B03'
WHERE APPT_ID IS '0000079272'
WHERE APPT_STAT IN ('PENDING');
WHERE DROPPED_STATUS IS ('ARRIVED');
ON TABLE HOLD AS ZAPPTHDR1
END
-*
JOIN APPT_ID AND PLANT IN ZAPPTHDR1 TO IN_APPT_ID AND IN_PLANT IN Z_APPT_BACKORDER_BY_ID_PLANT AS J1
END
-*
TABLE FILE ZAPPTHDR1
PRINT IN_APPT_ID
IN_PLANT
BACK_ORD_AMT
END
-*
Result of ZAPPTHDR1 is one record,

APPT_STAT| APPT_ID | PLANT
--------------------------
PENDING |0000079272| B03

by joing it to Function Modul we should get another column BACK_ORD_AMT.

This message has been edited. Last edited by: Kerry,


Valeriya

WebFOCUS 764 Servlet - MRE/Dashboard/Self Service/ReportCaster - Windows 2000
March 22, 2010, 06:26 PM
Waz
Are you able to TABLE out of the Function Module ?

If so, then TABLE and HOLD it first.

Some data sources do not like being joined to. I am not sure about SAP function Modules.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

March 22, 2010, 06:28 PM
Dan Satchell
If you click on the Advanced Search link at the top of the forum page and search for "SAP/R3 ERROR EXECUTING ABAP4 PROGRAM" you will find a number of entries, one of which might solve your problem.


WebFOCUS 7.7.05
March 23, 2010, 04:35 AM
GamP
My two cents:
It might also be that multifield join is actually not supported when joining from fix file to sap file.
Try to do a join on one field and have a where on the other field in your table body. Example:
JOIN APPT_ID IN ZAPPTHDR1 TO IN_APPT_ID IN Z_APPT_BACKORDER_BY_ID_PLANT AS J1
-* 
TABLE FILE ZAPPTHDR1
PRINT IN_APPT_ID
IN_PLANT
BACK_ORD_AMT
WHERE PLANT EQ IN_PLANT;
END

See if it works ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
March 24, 2010, 11:34 AM
vkrugman
Thank you to all of you~
I understand the problem was in FM :
FUNCTION Z_APPT_BACKORDER_BY_ID_PLANT .
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(IN_APPT_ID) LIKE ZBAPI_APPTHDR-APPT_ID
*" VALUE(IN_PLANT) LIKE ZBAPI_APPTHDR-PLANT
*" EXPORTING
*" VALUE(OUT_APPT_ID) LIKE ZBAPI_APPTHDR-APPT_ID
*" VALUE(OUT_PLANT) LIKE ZBAPI_APPTHDR-PLANT
*" VALUE(BACK_ORD_AMT) LIKE ZBAPI_APPTHDR-BO_AMT
*" TABLES
*" OUT_RETURN STRUCTURE BAPIRET2
*"----------------------------------------------

Everywhere you see 'LIKE' it was 'TYPE'. So now Type has been replaced with 'Like' and joint is working. Im so far from that issue to understand, but those who creates SAP Funcion Mod they found this and changed that.
Thank you
Lera


Valeriya

WebFOCUS 764 Servlet - MRE/Dashboard/Self Service/ReportCaster - Windows 2000