‎2006 Apr 06 2:20 AM
Hello,
I have requirement to cancel execution of a function module if it exceeds 10 Sec. How do i do this in ABAP.
This FM is sending data through XI and waiting on confirmation from a external system through XI. But the requirement is to wait only for 10 sec and if no response continue the process after the FM.
Any help in this highly appreciated.
Thanks!!
Harprit
‎2006 Apr 06 5:48 AM
<b>GET_JOB_RUNTIME_INFO</b> Get the current job number from a program. Also returns other useful info about the current job.
<b>ENQUE_SLEEP</b> Wait a specified period of time before continuing processing.
<b>ENQUEUE_ESFUNCTION</b> Lock an abap program so that it cannot be executed.
Set the parameters as follows:
RELID = 'ZZ'
SRTF2 = 0
SRTF = (your report name)
Please note that you should not use SY-REPID to pass your report name to the function. The value of SY-REPID will change as it is being passed to the function module, and will no longer hold the value of the calling report.
regards
vinod
‎2006 Apr 06 2:29 AM
Have you tried the following statement ?
WAIT up to 10 seconds.
Regards,
Suresh Datti
‎2006 Apr 06 3:25 AM
Hi Harprit,
You can use this FM <b>SWE_CD_TST_DELAY</b>.
CALL FUNCTION 'SWE_CD_TST_DELAY'
EXPORTING
DELAY = '10'.
Hope this will help.
Regards,
Ferry Lianto
‎2006 Apr 06 5:27 AM
Hi harprit,
1. as soon as we call the FM,
the program won't return
until it is finished (or some error has occurred)
2. So our abap code of
checking for 10 seconds / waiting for 10 seconds
/ any time code
won't get executed
(as we desire)
3. It may get exected only after the FM returns.
4. I don't think there is any direct way
of achieving the requirement.
regards,
amit m.
‎2006 Apr 06 5:48 AM
<b>GET_JOB_RUNTIME_INFO</b> Get the current job number from a program. Also returns other useful info about the current job.
<b>ENQUE_SLEEP</b> Wait a specified period of time before continuing processing.
<b>ENQUEUE_ESFUNCTION</b> Lock an abap program so that it cannot be executed.
Set the parameters as follows:
RELID = 'ZZ'
SRTF2 = 0
SRTF = (your report name)
Please note that you should not use SY-REPID to pass your report name to the function. The value of SY-REPID will change as it is being passed to the function module, and will no longer hold the value of the calling report.
regards
vinod
‎2006 Apr 06 5:53 AM
hi harprit
the control returns to the program once the fm got executed so you cannot set a time and skip from fm.
Cheers,
Abdul Hakim