10-12-2004 2:55 PM
Dear all,
I have a unix script, which calls a function module via the startrfc program. Sometimes the program does not terminate or at least it runs very long due to problem within the SAP system. Is there a option to start the startrfc program with a time threshold, so that it terminates, if it does not get result after a given time? (i.e. is there a "rdisp/max_wprun_time parameter" on OS level).
thanks in advance for your comments
Richard
10-12-2004 3:23 PM
In short, I don't believe so.
If you look at the C code for startrfc (...\sapgui\rfcsdk\text directory), you can see that it uses RFC function RfcCallReceive.
RfcCallReceive is a blocking call that has no option for timeout. If this is not satisfactory, you could change the code to call functions RfcCall, RfcListen and RfcReceive instead (my C is rusty):
rc = RfcCall(...);
if rc == RFC_OK
{
do
{
// Wait for timeout or call is finished
}
while TimedOut || ( rc = RfcListen(...) ) == RFC_RETRY );
}
if !TimedOut && ( rc == RFC_OK )
{
rc = RfcReceive(...);
}
It is then your responsibility to set the internal timeout as you see fit.
Cheers,
Scott
10-12-2004 3:23 PM
In short, I don't believe so.
If you look at the C code for startrfc (...\sapgui\rfcsdk\text directory), you can see that it uses RFC function RfcCallReceive.
RfcCallReceive is a blocking call that has no option for timeout. If this is not satisfactory, you could change the code to call functions RfcCall, RfcListen and RfcReceive instead (my C is rusty):
rc = RfcCall(...);
if rc == RFC_OK
{
do
{
// Wait for timeout or call is finished
}
while TimedOut || ( rc = RfcListen(...) ) == RFC_RETRY );
}
if !TimedOut && ( rc == RFC_OK )
{
rc = RfcReceive(...);
}
It is then your responsibility to set the internal timeout as you see fit.
Cheers,
Scott