Skip to Content
-2

WAIT UPTO COMMAND ISSUE

May 02 at 09:50 PM

69

avatar image

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)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Rodolfo Bermudez Neubauer May 02 at 11:07 PM
1

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.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Quite right. Far better to trigger a process chain from your program, that runs the infopackages in the needed sequence.

2
ROBERTO Forti Santos May 02 at 10:23 PM
0

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.
Share
10 |10000 characters needed characters left characters exceeded
Frédéric Cincet May 03 at 07:45 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded