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 question

Former Member
0 Likes
395

Hi All ,

I have some doubts in Bapi

1) why we can not use exception in Bapi ?

2) BAPI must not execute a COMMIT-WORK command.

3) why its necessary to released the bapi & how ?

4) In Bapi there is a test for Example IF 1 = 2. If the test is true a message is displayed. The condition will obviously never be true, and we will never want to display a message in a BAPI

then why it is necessary ?

Thanks in advance

Rahul

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
369

Hi Sharma,

Award points if useful

BAPI cannot have exceptions in them.

BAPIs themselves must not trigger any messages (such as MESSAGE xnnn) in the coding. In particular they must not generate terminations or display dialog boxes. Instead, all messages must be intercepted internally and reported back to the calling program in the Return parameter. Otherwise the BAPI will not be processed correctly and control may not be given back to the calling program

BAPI cannot use commit work stmt instead

Commit work is used when you code directly in ABAP and make changes in the database and

want to commit the database.

BAPI_TRANSACTION_COMMIT is used when you make changes to the SAP database by calling

a BAPI from outside SAP and want to commit the database. When you use a BAPI, you can not

directly use commit work, instead you are allowed to use only

BAPI_TRANSACTION_COMMIT.

Why Release?

You cannot use the same structures used in existing applications because BAPI structures are frozen when BAPIs are released and then there are restrictions on changing them.

1 REPLY 1
Read only

Former Member
0 Likes
370

Hi Sharma,

Award points if useful

BAPI cannot have exceptions in them.

BAPIs themselves must not trigger any messages (such as MESSAGE xnnn) in the coding. In particular they must not generate terminations or display dialog boxes. Instead, all messages must be intercepted internally and reported back to the calling program in the Return parameter. Otherwise the BAPI will not be processed correctly and control may not be given back to the calling program

BAPI cannot use commit work stmt instead

Commit work is used when you code directly in ABAP and make changes in the database and

want to commit the database.

BAPI_TRANSACTION_COMMIT is used when you make changes to the SAP database by calling

a BAPI from outside SAP and want to commit the database. When you use a BAPI, you can not

directly use commit work, instead you are allowed to use only

BAPI_TRANSACTION_COMMIT.

Why Release?

You cannot use the same structures used in existing applications because BAPI structures are frozen when BAPIs are released and then there are restrictions on changing them.