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

catching error in BAPI

Former Member
0 Likes
798

Hi experts,

I am new to BAPI.

Can anyone tell me " How to catch error in BAPI ".

Thanks,

Shipra

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
700

Hi,

In the BAPI return internal table you have to check for the Error or ABort message types..

Ex..

  • Check for error or abort messages

LOOP AT T_RETURN WHERE TYPE = 'E' OR TYPE = 'A'.

EXIT.

ENDLOOP.

IF SY-SUBRC = 0.

WRITE: / 'Exception occured'.

ELSE.

WRITE: / 'Update is successful'.

ENDIF.

Thanks

Naren

3 REPLIES 3
Read only

Former Member
0 Likes
701

Hi,

In the BAPI return internal table you have to check for the Error or ABort message types..

Ex..

  • Check for error or abort messages

LOOP AT T_RETURN WHERE TYPE = 'E' OR TYPE = 'A'.

EXIT.

ENDLOOP.

IF SY-SUBRC = 0.

WRITE: / 'Exception occured'.

ELSE.

WRITE: / 'Update is successful'.

ENDIF.

Thanks

Naren

Read only

Former Member
Read only

0 Likes
700

In Return parameter you will error details..

their type, med ID, etc...see its structure in debugging and definitely u ll get more idea..

regards