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

Raising exception in a BAPI

former_member125661
Contributor
0 Likes
1,203

I had to create a wrapper remote enabled FM around the standard SAP FM - FI_PERIOD_DETERMINE .

I coped the import,export and even the exceptions from the standard FM and called FI_PERIOD_DETERMINE inside my wrapper BAPI. Will this work ? Can we raise exceptions in a wrapper remote enabled FM ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
716

Hi Shareen,

BAPIs do not raise exceptions. They return the errors via the RETURN tables parameter.

Do one thing.

In your wrapper BAPI - capture the messages of the exceptions raised by the standard FM and populate the RETURN table parameter of your BAPI (type BAPIRET2) with the exception text and type as E

Then your application calling the BAPI can read the RETURN in the other environment.

Cheers,

Aditya

I had to create a wrapper remote enabled FM around the standard SAP FM - FI_PERIOD_DETERMINE .

I coped the import,export and even the exceptions from the standard FM and called FI_PERIOD_DETERMINE inside my wrapper BAPI. Will this work ? Can we raise exceptions in a wrapper remote enabled FM ?

1 REPLY 1
Read only

Former Member
0 Likes
717

Hi Shareen,

BAPIs do not raise exceptions. They return the errors via the RETURN tables parameter.

Do one thing.

In your wrapper BAPI - capture the messages of the exceptions raised by the standard FM and populate the RETURN table parameter of your BAPI (type BAPIRET2) with the exception text and type as E

Then your application calling the BAPI can read the RETURN in the other environment.

Cheers,

Aditya