Hi Linn,
Please change the program as follows and try.
DATA: it_order TYPE STANDARD TABLE OF /SAPNEA/MR3_ORDER_ITEM.
DATA: wa_order TYPE /SAPNEA/MR3_ORDER_HEADER.
wa_order-SALESDOCUMENT = '0005100000'.
Cheers
Vinod
Message was edited by: Vinod C
Try this
DATA: it_order TYPE STANDARD TABLE OF /SAPNEA/MR3_ORDER_ITEM
.
DATA: wa_order TYPE /SAPNEA/MR3_ORDER_HEADER.
wa_order-salesdocument = '5100000'.
CALL FUNCTION '/SAPNEA/SMAPI_ORDER_GETDETAIL'
EXPORTING
PI_ORDER_HEADER = wa_order
PI_PARVW =
PI_PRICE_CONDITION1 = 'PR00'
PI_PRICE_CONDITION2 =
PI_PRICE_CONDITION3 =
PI_TAX_CONDITION =
PI_UNIT_SPLIT = 50
PI_TEXT_ID = '0001'
PI_LANGUAGE = SY-LANGU
IMPORTING
PO_ORDER_HEADER =
RETURN =
TABLES
POT_ORDER_ITEM = it_order.
if sy-subrc ne 0.
ENDIF.
Make sure sales order no 5100000 exists in your system.
Verify in VA03.
Cheers
IT_RETURN TYPE BAPIRET2.
CALL FUNCTION '/SAPNEA/SMAPI_ORDER_GETDETAIL'
EXPORTING
PI_ORDER_HEADER = wa_order
PI_PARVW =
PI_PRICE_CONDITION1 = 'PR00'
PI_PRICE_CONDITION2 =
PI_PRICE_CONDITION3 =
PI_TAX_CONDITION =
PI_UNIT_SPLIT = 50
PI_TEXT_ID = '0001'
PI_LANGUAGE = SY-LANGU
IMPORTING
PO_ORDER_HEADER =
RETURN = IT_RETURN
TABLES
POT_ORDER_ITEM = it_order.
Are u telling me that IT_RETURN is empty?
Please confirm.
If not, read the contents of structure IT_RETURN and let us know.
Well,
If the code that u have posted is the code of the entire report, then if even if u execute it and if it is successfull u will never know.
First read the contens of parameter RETURN into a work area. See if it has message type 'E'. That means there has been an error.
You can simply write that error message using field RETURN-MESSAGE.
If not then the execution is successfull and u can read the contents of IT_ORDER by looping.
Loop at IT_ORDER.
Write : IT_ORDER.
Endloop.
First assign WA_RETURN TYPE BAPIRET2 to RETURN parameter of FM. then read it if it has message type 'E'.
i.e WA_RETURN-TYPE eq 'E'.
Then if it is error just display it or loop at the table and display its contents.
Add comment