02-09-2007 12:06 PM
Hi Group,
I am using BAPI ,How to display the BAPI Error Message (eg:BAPIRET1) which is returning by BAPI
02-09-2007 12:08 PM
HI ,
ITS SIMPLE TRY THIS CODE
AWARD PTS
DATA: gt_ret TYPE TABLE OF bapiret2,
ls_ret TYPE bapiret2,
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = p_vbeln
order_header_in = gt_hdr
order_header_inx = gt_hdrx
TABLES
return = gt_ret -
>>>>.<b>IMPORTANT</b>
order_item_in = gt_itm
order_item_inx = gt_itmx
schedule_lines = gt_sched
schedule_linesx = gs_schedx
order_text = gs_stdtxt.
PARTNERS = gs_partner
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
LOOP AT gt_ret INTO ls_ret.
WRITE:/ ls_ret-type.
WRITE:/ ls_ret-message.
ENDLOOP.
02-09-2007 12:10 PM
Hi,
The return message will be stored in the table BAPIRET1. so you have a Internal table realted to this one.
after calling that function moduel...
LOOP AT IT_BAPIRET1
Write:/ IT_BAPIRET1-msgv1,IT_BAPIRET1-MESSAGE.
ENDLOOP.
02-09-2007 12:10 PM
declare itab like BAPIRET1.
and after execution of BAPi..
u can do a loop at this internqal table to display its records and find out the erroneos records.
02-09-2007 12:19 PM
Hi Swabap,
Say the return parameter name is GV_RETURN, paste this code after the BAPI call
if not gv_return is initial.
MESSAGE ID gv_return-id
TYPE gv_return-type
NUMBER gv_return-number
WITH gv_return-message_v1
gv_return-message_v2
gv_return-message_v3
gv_return-message_v4.
endif.
This will build & display the message along with type on the status bar at the bottom of the screen.
-Aditya