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 exceptions

Former Member
0 Likes
382

Can I mantain exceptions in BAPI and how?

2 REPLIES 2
Read only

Former Member
0 Likes
361

Hello,

See these: and [How To Catch Exceptions When Using BAPI Callable Objects|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3795] [original link is broken] [original link is broken] [original link is broken];.

Regards,

If usefull please rewards.

Read only

Sm1tje
Active Contributor
0 Likes
361

when you are creating your own 'BAPI', you should not maintain the exceptions, but use the return table (structure BAPIRET2), to 'catch' all messages generated by the BAPI and send it back to the calling application.

However, what you should do is add two standard exceptions when calling the BAPI for catching communication failures and system failures (short dumps for example) in the calling system. Just copy and paste this behind the BAPI when calling it:

EXCEPTIONS

system_failure = 1 MESSAGE return_message

communication_failure = 2 MESSAGE return_message

OTHERS.

return_message can be defined as type c length 255.

[using predefined exceptions for RFC|http://help.sap.com/saphelp_nw70/helpdata/EN/22/0425e0488911d189490000e829fbbd/content.htm]

Edited by: Micky Oestreich on May 21, 2008 9:28 PM