‎2020 Aug 05 8:57 AM
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,
‎2020 Aug 05 9:16 AM
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
‎2020 Aug 05 9:13 AM
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.
‎2020 Aug 05 9:16 AM
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
‎2020 Aug 05 9:23 AM
Hi gaurav.karkara3,
I think it would be possible if he uses IN UPDATE TASK.
Thanks,
Gonzales, Juanito III Roa
‎2020 Aug 05 9:33 AM
Probably 'SET UPDATE TASK LOCAL' before BAPI call will help, but for such huge numbers i foresee some issues. I remember facing some.
Gaurav
‎2020 Aug 05 10:52 AM
Hi Gaurav,
I have tried with 5 documents it's working, but not sure how it behaves for large number of documents.
Best Regards,
‎2020 Aug 05 12:09 PM
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