‎2008 Mar 04 5:52 AM
Hi friends,
I am using bapi BAPI_SALESORDER_CHANGE, it is working fine , suppose if bapi fails i want to show the return parameter internal table information to user as information message.
can any one tell me how to do that.
its urgent please,
DVNS.
‎2008 Mar 04 6:00 AM
CALL FUNCTION ' BAPI_SALESORDER_CHANGE
..
IF NOT i_return[] IS INITIAL.
LOOP AT i_return INTO wa_return.
IF wa_return-type = 'E'.
* Collect the error message in a internal table suppose t_error
ENDIF.
ENDLOOP.
ENDIF.
Loop table t_error and Display the error messages by concatenating it with the sales order no.
‎2008 Mar 04 6:00 AM
CALL FUNCTION ' BAPI_SALESORDER_CHANGE
..
IF NOT i_return[] IS INITIAL.
LOOP AT i_return INTO wa_return.
IF wa_return-type = 'E'.
* Collect the error message in a internal table suppose t_error
ENDIF.
ENDLOOP.
ENDIF.
Loop table t_error and Display the error messages by concatenating it with the sales order no.
‎2008 Mar 04 6:00 AM
Hi ,
You can use the Internal table of type BAPIRET2 to collect all the error message.
And then you can also check for any error in the error message, by putting a check on field TYPE of internal table.
If ITAB-type = 'E'.
Error Message.
Else.
Commit using 'BAPI_TRANSACTION_COMMIT'.
endif.
Thanks,
Abhishek
Please reward points, if it helps.