Application Development 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: 

Program Performance

Former Member
0 Kudos
69

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

1 REPLY 1

Former Member
0 Kudos
27

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.