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

Hi Regarding bapi --commit

Former Member
0 Likes
602

I have 2 bapis:

I have called 2 bapis.

I have to commit the first bapi , only second bapi also succesful.Please look below code i have used is it correct?

i did like below:

call first BAPI

check return table for type 'E'.

if no type E messages:

call 2nd BAPI.

if this return table also dont have type E messages.

then BAPI_TRANSACTION_COMMIT.

will this transaction updates 2 bapis data ?

if not how can i handle this?

6 REPLIES 6
Read only

Former Member
0 Likes
571

Hi,

Your approach is right.

Amitava

Read only

0 Likes
571

It is the correct approach i believe:).

Nabheet

Read only

former_member451655
Active Participant
0 Likes
571

Hi ,

This Flow is Correct ,

Thanks ,

Dilum .

Read only

Former Member
0 Likes
571

Hi

call 1st BAPI.

read return table with type 'E'.

if sy-subrc <> 0.

call 2nd BAPI.

read return table with type 'E'.

call BAPI_TRANSACTION_COMMIT.

endif.

Hi the above flow is correct, because the commit BAPi will commit all the BAPIs used above it in the program.

Thanks

Lalit Gupta

Read only

Former Member
0 Likes
571

Hi Ramakrishna,

This BAPI is used to update the database after all the transactions in a LUW are completed successfully. After execution of this BAPI all the related tables are updated in the database. Any operation which requires the database tables updation, this BAPI can be used

So have a check for SY-SUBRC to ensure there is a correct updation happening.

Check for the OSS notes if you want any further information.

https://service.sap.com/sap/support/notes/798535

Thanks and Regards.

Srikanth.P

Read only

_IvanFemia_
Active Contributor
0 Likes
571

HI,

you're fine, I would check also if any Abort messages are thrown...

Regards,

Ivan