1

I am a beginner in SAP ABAP. I am debugging an asynchronous RFC (parallel processing). I have put a break-point in the calling portion of the RFC, an external break-point inside the RFC and an external break point in the form which is called at the end of task through perform. I am able to debug the RFC FM.

Another session opens up. But I am not able to debug the perform which is called after end of task. After the RFC is debugged, the control returns to the calling point of the FM. it doesn't go inside the form. When all the iterations are finished, then at the end it goes inside the perform. Why so? shouldn't the perform be executed in parallel?

Inside the perform I have written like RECEIVE RESULTS FROM FUNCTION XXX. But the debugger control is not going inside the perform after returning from the RFC.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
user3757558
  • 55
  • 4
  • 12
  • 2
    Please read [Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers?](https://meta.stackoverflow.com/q/326569) - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions. – halfer Jun 04 '17 at 07:44
  • I will take care if it. Thanks – user3757558 Jun 04 '17 at 10:11

1 Answers1

1

You have given very little information on the overall program flow, but there's a part of the documentation that might be relevant to your case:

A prerequisite for the execution of a registered callback routine is that the calling program still exists in its internal session when the remote function is terminated. It is then executed here at the next change of the work process in a roll-in. If the program was terminated or is located on the stack as part of a call sequence, the callback routine is not executed.

[...]

The time when the callback routines are executed can be programmed explicitly or be reached implicitly:

  • The statement WAIT FOR ASYNCHRONOUS TASKS is used for explicit programming. As specified by a condition, this statement changes the work process and hence executes the callback routines registered up to this time. It waits for as many registered routines to end until the condition is met (the maximum wait time can be restricted). Explicit programming is recommended whenever the results of the remote function are required in the current program.

  • If the results of the remote function are not required in the current program, the time at which the callback routines are executed can also be determined by an implicit change of the work process (for example, at the end of a dialog step). This can be a good idea, for example, in GUI scenarios in which uses of WAIT are not wanted. In this case, it must be ensured that the work process changes before the program is ended. There is also a risk that, if the work process is changed implicitly, not all callback routines are registered in time.

It is likely that the program issuing the call and registering the callback routine is either terminated or does not issue a WAIT FOR ASYNCHRONOUS TASKS so that the callback is only executed on the next roll-in.


Re-reading your question, you apparently assume that the callback routine will be executed in parallel to the program that has registered it. That is not the case, ABAP is not multi-threaded.

vwegert
  • 18,371
  • 3
  • 37
  • 55
  • I am not clear. My program is not terminated. Why my call back routine is not getting executed after returning from RFC? – user3757558 Jun 04 '17 at 10:09
  • Is there any debugging option that I need to consider ?like system debugger etc..Need a clear idea – user3757558 Jun 04 '17 at 10:12
  • 1
    Yes. No. Maybe. Provide more information on the actual program, preferably in a form that anyone can understand the setting. – vwegert Jun 04 '17 at 13:18