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_ACC_DOCUMENT_POST mass postings with single commit

venu_001
Participant
0 Likes
2,500

Hi Experts,

I have a requirement to post 1000+ GL documents which are in single file, and if any error in one of the 1000 documents then I want to rollback all 1000 documents.

For that I am using BAPI_ACC_DOCUMENT_POST and commit work/Rollback work is at end of the process, is there any issue if all 1000 documents are committed or rollback in single shot? Please advise.

Best Regards,

1 ACCEPTED SOLUTION
Read only

GK817
Active Contributor
0 Likes
2,057

Hi Venu,

I think you will have to do it one by one.

Have you tried creating 5-10 document postings with single commit/rollback, does that work?

Gaurav

6 REPLIES 6
Read only

0 Likes
2,057

Hi venugopalreddy.sagamredi,

It is a best practice to use exclusive lock to the record you wish to modify to avoid data inconsistency with other users.

Please perform the following steps:

- Set exclusive locks for the data you wish to change or process.

- If exclusive lock is successful, read the current data in the database (To ensure up-to-date data).

- Change the data and update the data in the database (Database Commit).

- Release the lock

** Please take note not to set the lock for too long to allow other users to do there work.

In addition, to Commit/Rollback 1,000 records in one shot is the recommended practice in terms of performance because the Application Layer connects to the Database Layer only once which will lessen the burden to the DBMS.

Hope this helps.

Read only

GK817
Active Contributor
0 Likes
2,058

Hi Venu,

I think you will have to do it one by one.

Have you tried creating 5-10 document postings with single commit/rollback, does that work?

Gaurav

Read only

0 Likes
2,057

Hi gaurav.karkara3,

I think it would be possible if he uses IN UPDATE TASK.

Thanks,

Gonzales, Juanito III Roa

Read only

GK817
Active Contributor
0 Likes
2,057

Probably 'SET UPDATE TASK LOCAL' before BAPI call will help, but for such huge numbers i foresee some issues. I remember facing some.

Gaurav

Read only

0 Likes
2,057

Hi Gaurav,

I have tried with 5 documents it's working, but not sure how it behaves for large number of documents.

Best Regards,

Read only

GK817
Active Contributor
2,057

Good Venu!

There could be locking issue but i can't be sure of that. So, In certain, I think i won't advise on this.

Gaurav