Application Development and Automation 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: 
Read only

timeout for startrfc program?

Former Member
0 Likes
575

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
Read only

Former Member
0 Likes
453

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
Read only

Former Member
0 Likes
454

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