12-23-2009 2:57 PM
I have an abap that calls a function module in another SAP system which returns relevant data for my ABAP.
Sometimes, due to data issues, the called function module gets in some sort of loop where it will eventually timeout.
Is there a way to call the function module with some sort of timeout value in the calling system, or having some sort of timeoue value in the called system?
All this needs to happen in the background.
12-23-2009 3:13 PM
Hi,
maybe you could use function module RFC_VERIFY_DESTINATION just before calling your RFC fm.
Check this weblog:
/people/sap.user72/blog/2005/07/01/my-new-best-friend-mr-rfcverifydestination
Best regards.
Edited by: Pablo Casamayor on Dec 23, 2009 4:27 PM
12-23-2009 3:37 PM
Sorry, I should have been more detailed in what I need and what the issue is.
There isn't an issue with the RFC destination itself.
I need a method of performing a timeout of an RFC call after X seconds if the RFC call hasn't returned within X seconds.
This quick test seems to work:
REPORT ztimeouttest.
Data: results_received TYPE c,
timeout type i,
start type tims,
stop type tims.
start = SY-UZEIT.
timeout = 5.
CLEAR: results_received.
call function 'RS_TREE_SLEEP'
starting new task 'check'
performing receive_result on end of task
exporting
TIME_BETWEEN_REFRESH = 50.
WAIT UNTIL results_received = 'X' UP TO timeout SECONDS.
stop = SY-UZEIT.
IF sy-subrc = 8. "timeout
write:/ 'Timeout. Started at ', start, ' ended at ', stop.
endif.
FORM receive_result USING iv_taskname.
RECEIVE RESULTS FROM FUNCTION 'RS_TREE_SLEEP'.
results_received = 'X'.
endform.
12-23-2009 3:45 PM
Hi,
in the weblog i´ve included it says:
Oh, another really nice feature is the TIMEOUT default is set to 60 (seconds) so you can really fine tune your connection settings to get the performance you want, I mean no sense in pulling a huge set of data over if your connection takes to long now is it?
Maybe you could have a look at code of RFC_VERIFY_DESTINATION fm and try to imitate the behaviour of parameter TIMEOUT for your fm.
Best regards.
12-23-2009 3:56 PM
Seems I was on the right track.
The timeout stuff is:
..
CALL FUNCTION 'RFC_GET_SYSTEM_INFO'
DESTINATION 'NONE'
STARTING NEW TASK destination
PERFORMING return_form ON END OF TASK
..
..
WAIT UNTIL data_received = 'X' UP TO timeout SECONDS.
Thanks for the reply though as it backs up what I'm doing.
12-23-2009 3:58 PM
Hi,
have you checked this?:
http://help.sap.com/saphelp_banking60/helpdata/en/22/0425e0488911d189490000e829fbbd/content.htm
http://help.sap.com/saphelp_banking60/helpdata/en/22/0425e0488911d189490000e829fbbd/frameset.htm
Best regards.
Edited by: Pablo Casamayor on Dec 23, 2009 4:59 PM