‎2011 Mar 22 9:30 PM
ISU u2013 ABAP
Our requirement is select all data from a data base table (EANL) and for each entry in EANL, populate/modify data in a table (ETTIFN) using a standard BAPI.
Now, problem is the BAPI in question can update one entry at a time so we are looping the table EANL and calling the BAPI in loop. When I executed this in background it seems taking more than 10 days to populated/update 500,000 entries in ETTIFN table.
As per current logic u2013
Select f1 into t_eanl
from EANL.
Loop at t_eanl.
Call BAPI XXX (to poplate ETTIFN table)
Commit BAPI.
Endloop.
We canu2019t find any other BAPI to update ETTIFN table in bulk. Is there any other way to make this code faster/better.
Any sort of suggestion is welcome.
Regards,
Sanjoy
‎2011 Mar 23 5:38 AM
Hi,
That runtime seems unbelievable! Even if you found a BAPI that handled multiple entries, the runtime would likely still be unacceptable.
My advice:
- search OSS for notes that mention this BAPI and 'performance'
- search SDN (I assume you've done these)
- watch the program running via SM50 to get an idea where the bottleneck is
- if it seems to get stuck on a database table, run an ST05 trace
- if it's a problem in the code, try an SE30 trace.
hope this helps
Paul E Bakker
‎2011 Mar 23 3:17 AM
Dear sanjoyhudait,
Maybe you can debug your program first to know in which section that spent more time when executed, so you can know why your program spent very long time when executed..
Regard's
Andri
‎2011 Mar 23 5:38 AM
Hi,
That runtime seems unbelievable! Even if you found a BAPI that handled multiple entries, the runtime would likely still be unacceptable.
My advice:
- search OSS for notes that mention this BAPI and 'performance'
- search SDN (I assume you've done these)
- watch the program running via SM50 to get an idea where the bottleneck is
- if it seems to get stuck on a database table, run an ST05 trace
- if it's a problem in the code, try an SE30 trace.
hope this helps
Paul E Bakker
‎2011 Mar 24 12:30 PM
Hi,
You can used the statement SET UPDATE TASK LOCAL before call BAPI inside the loop.
Loop at t_eanl.
SET UPDATE TASK LOCAL.
Call BAPI XXX (to poplate ETTIFN table)
Commit BAPI.
Endloop.
It will give better performance for run in background.
‎2011 Mar 24 2:58 PM
Hi,
- just an idea -
instead of calling commit for each bapi call, try calling commit for each 50 or maybe 100 records.
Regards
Abdul.
‎2011 Mar 24 9:52 PM
Hi Sanjoy,
do as Abdulbasit suggested. You can try much more, try 1000 Calls before committing.
You can create a couple of Jobs (4-6) with intervals and start them all together at the same time. Together with the Commmit per 1000 updates, it will be done within half a day.
Regards,
Clemens