Skip to Content
-2

WAIT UPTO COMMAND ISSUE

Hi All,

I have written ABAP program which will trigger the info package (multiple times) with different selections by using the function module "BAPI_IPKG_START".

code :

LOOP AT IT_ABC Assigning <WA_ABC>.

IT_ABC2[ ] = P_IT_ABC[ ].

DELETE IT_ABC2 WHERE SIMULATION_ID NE <WA_ABC>-SIMULATOIN_ID

CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
MODE_RSTABLE = 'E'
TABNAME = 'ZDEMO'

DELETE FROM ZDEMO WHERE SIMULATION_ID IS NOT NULL.
CALL FUNCTION 'DB_COMMIT'.

MODIFY ZDEMO FROM TABLE IT_ABC2.
CALL FUNCTION 'DB_COMMIT'.

CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
MODE_RSTABLE = 'E'
TABNAME = 'ZDEMO''.

CALL FUNCTION 'BAPI_IPAK_START'

EXPORTING
INFOPACKAGE = P_IPACK
* JOBNAME =
* IMPORTING
* REQUESTID =
TABLES
RETURN = LV_RETURN.

WAIT UP TO 200 SECONDS.

CLEAR IT_ABC2[ ].

ENDLOOP.

But we are getting performance issue due to statement - wait upto 200 seconds.

once the Infopackage is triggered and completed , the next info package will start after 200 seconds. The info package ran 80 times for different selection and hence 200 seconds is causing delay and program is taking 4-5 hours to complete.

80 times * 200 seconds = 16000 seconds = 4 - 4:45 hours

Please let me know if there are any other way by which I can improve my performance.

Thanks,

Abhimanyu Sharma.

capture1.jpg (19.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • May 02 at 11:07 PM

    Is there any particular reason as to why the InfoPackages must run in strict sequence or why you must control this sequence within your code? If the IP all have distinct selections you could trigger them all without having to wait for each one to be completed before triggering the next one (parallel execution) and have the system process execution in the background.

    Add comment
    10|10000 characters needed characters exceeded

  • May 02 at 10:23 PM

    Hi Abhimanyu Sharma,

    Try to replace the ABAP code WAIT UP TO 200 SECONDS for the below code to resolve your issue.

    Let me know the results! Regards.

    IF sy-subrc EQ 0.
    
    *Execute external Commit when using BAPIs
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
         EXPORTING
          wait = 'X'.
    ELSE.
    
    *Execute external Rollback when using BAPIs
    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
    
    ENDIF.
    Add comment
    10|10000 characters needed characters exceeded

  • May 03 at 07:45 AM

    And if the sequence is critical, you can also make the waiting time a little smarter by checking regularly (each 10s ?) the status of the infoPackage (using the 'BAPI_ISREQUEST_GETSTATUS' MF).

    Regards,

    Frederic

    Add comment
    10|10000 characters needed characters exceeded