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

Can we use BAPI_TRANSACTION_COMMIT for multiple tables at a time

Former Member
0 Likes
2,263

Hi Experts,

My requirement is like this i am getting data from an external system and i am mapping that data in the SAP format. I am calling a Function module to update the required tables. In that function module two bapi's are being called for updating two table BP1012 & BP3100.

This functionality is inside a loop and the updation happens for each record.

First BP3100 bapi will be called and then BAPI_TRANSACTION_COMMIT and then BP1012 and BAPI_TRANSACTION_COMMIT.

For BP3100 data is getting updated as expected  and for BP1012 COMMIT is not working for multiple iterations or multiple entries.

So i have thought of using BAPI_TRANSACTION_COMMIT outside the loop so that both tables will get updated at a time.

I am not sure whether this works or not. So, i need your help for achieving this and also wanted to know how the BAPI BUFFER will work in general and during this situation.

Waiting for your valuable information.

3 REPLIES 3
Read only

custodio_deoliveira
Active Contributor
0 Likes
1,359

Hi Rakesh,

Yes, you can call it outside the loop. I don't think there's any trick involved, just call the FM and it will commit all DB changes.

Cheers,

Custodio

Read only

0 Likes
1,359

Hi Custodio,

Thank you very much for your quick response and it is very much helpful.

If you use bapi for creating entries in 4 different tables with n entries each and we will be using transaction commit at the end .... this will also work write.

I just wanted to know how the functionality of BAPI buffer will be.

Could you please help understand in detail.

Read only

Bharathi_M1
Explorer
0 Likes
1,359

Hi,

If the number of entries are more, for better results you can use commit for every 100 records. It will not exhaust the buffer size and it will not degrade the system performance also.