04-03-2013 9:03 AM
Hi,
I am looping on and processing IDOCS, i.e.:
LOOP AT lt_edidc INTO ls_edidc.
SUBMIT rbdapp01
WITH docnum = ls_edidc-docnum
AND RETURN.
* wait up to 100 seconds.
* CALL FUNCTION 'ENQUE_SLEEP'
* EXPORTING
* seconds = 100.
ENDLOOP.
When the SUBMIT is executed I would like it to finish processing the IDOC before it commences with the next one.
Is it better/safer (in my case above) to use 'WAIT UP TO 100 SECONDS' or to use the 'ENQUE_SLEEP' function?
04-03-2013 11:49 AM
Hi Glen,
the use of WAIT .. UP TO ... is never a good idea.
It is a program interruption (as i.e. any RFC call) that triggers an implicit database commit - which is not always wanted.
Better create a endless loop and try to enqueue the object (i.e. idoc) that is currently locked because it is being processed. Exit the loop after successfully enqueueing, then dequeue, then continue.
Regards
Clemens
04-03-2013 9:18 AM
Look at second tab of the selection screen of the report, did you try to set the indicator "Wait for end of processing" ?
Regards,
Raymond
04-03-2013 9:27 AM
Hi Raymond,
Yes I did see that but I don't think it will make a difference in my case as in each loop in my program I am only submitting one IDOC anyway so when RBDAPP01 is executed it will be for only one IDOC. And then when the loop is processed it will create another session for the next IDOC.
I may be wrong though... I will give this a try and see.
Thank you.
04-03-2013 9:24 AM
Hi Glen,
My suggestion would be check the status of IDOC within a DO..ENDDO statement. Some IDOCS may take a longer time to process, while some may process within seconds.
DO.
<Check the status of the IDOC. Select STATUS from EDIDC.>
If <STATUS EQ 64 "IDOC is not processed">
WAIT FOR 10 SECONDS.
ELSE.
EXIT.
ENDDO.
Cheers
~Niranjan
04-03-2013 9:29 AM
Hi Niranjan,
Thank you for suggestion.
I think it is a good idea to check for status, but I am a bit reluctant to use the 'wait for 10 seconds' as everything I read about this statement suggest not to use it.
04-03-2013 9:51 AM
Hi Glen,
Since the requirement is to finish processing the IDOC before it commences with the next one, i suggested this option. You may reduce the wait seconds to 1. It would be better to have a discussion with the BASIS team to determine the load of your production system and then decide on the WAIT seconds.
Cheers
~Niranjan
04-03-2013 11:49 AM
Hi Glen,
the use of WAIT .. UP TO ... is never a good idea.
It is a program interruption (as i.e. any RFC call) that triggers an implicit database commit - which is not always wanted.
Better create a endless loop and try to enqueue the object (i.e. idoc) that is currently locked because it is being processed. Exit the loop after successfully enqueueing, then dequeue, then continue.
Regards
Clemens