Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_SALESORDER_CHANGE

Former Member
0 Likes
418

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
383


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.  

2 REPLIES 2
Read only

Former Member
0 Likes
384


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.  

Read only

Former Member
0 Likes
383

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.