‎2011 Oct 19 9:47 PM
Hi,
I am facing Performance problem with below FM and coding. If i don't put wait upto 1 seconds statement, FM is not committing or canceling HU's , I am sure i will have 10000 records. so i am almost looking at 3 hours.
I have also tried COMMIT WORK and WAIT. No change in time.
if no option works out suggest me if anything can be done on basis side to save some time.
CALL FUNCTION 'HU_CANCEL_GOODS_MOVEMENT'
EXPORTING
IF_COMMIT = 'X'
IT_HANDLING_UNITS = ITEMS
IMPORTING
EF_RETCODE = I_RETCODE
ET_MESSAGES = MESSAGE
ET_MATERIAL_DOC = MAT_DOC
EXCEPTIONS
ERROR = 1
ERROR_MESSAGE = 99
OTHERS = 2 .
IF SY-SUBRC NE 0 OR I_RETCODE NE 0.
APPEND WA_RECORD_IN TO IT_RECORD_MB1A.
ELSE.
*WAIT UP TO 1 SECONDS* .Edited by: Rob Burbank on Oct 19, 2011 4:53 PM
Added code tags
‎2011 Oct 20 12:23 AM
Is the Function Module taking only one record at a time? From the code it looks like it can take multiple records and process them in single call. Please try. If it works then better option would be to pass all 10000 records at one time and then a final Commit Work and Wait. Ofcourse, database update will happen only after final Commit work for all records.
But if only one record can be processed at one time, a counter can be used inside loop for commit work, like commit only after 500 records are processed.