Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

timeout for startrfc program?

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

1 REPLY 1

Former Member
0 Kudos

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