‎2008 Aug 14 3:46 PM
Hi Fox,
I have a function which sometime needs more than 10 minutes to deliver a result. In order to limit the processing time, I need to abort the function and return a flag to to another system to indicate kind of "time out". How can I do this.
Cheers!
Kami
‎2008 Aug 14 3:54 PM
While callin the function module, you can use
CALL FUNCTION 'func name'
STARTING NEW TASK w_taskname
DESTINATION c_none
PERFORMING f_formname ON END OF TASK
EXPORTING
IMPORTING
EXCEPTIONS.
IF SY-SUBRC EQ 0.
WAIT UNTIL w_confirm EQ 'X' UP TO 100 SECONDS.
ENDIF.
**********************************
FORM f_formname USING us_taskname TYPE any.
RECEIVE RESULTS FROM FUNCTION <func_name>
IMPORTING
EXCEPTIONS
IF SY-SUBRC EQ 0.
MOVE 'X' TO W_CONFIRM.
ENDIF.
ENDFORM.
‎2008 Aug 15 9:41 AM
Hi, first thanks you very much for your feedback.
Actually this function itself is a RFC function however the part that takes very long is a PERFORM so is there any possibility to receive a feedback whenever the PERFORM takes very long? Once again the structure is like this:
FUNCTION search.
...
...
...
PERFORM get_data TABLES i_table CHANGING i_table
...
...
ENDFUNCTION
*********************
SO the PERFORM get_data is the one part which sometime take very long time to process.
Any idea ?
Thanks for you help
‎2008 Aug 14 4:03 PM
Hi,
Check system date and time at the start of FM , check the time and date at the part of the code where you want to set the flag. If it exceeds your time limit, say 10 mins, pass a flag to the calling program ot unit.
Thanks,
Kartavya