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

Parallel Processing Prerequisite - should not start a new internal session

ec1
Active Participant
0 Likes
2,101

Hi all,

In all documentation about parallel processing in ABAP, one of the prerequisites is the following. However I cannot find further explanation what that is the case.

–         The calling program should not change to a new internal session after making an asynchronous RFC call. That is, you should not use SUBMIT or CALL TRANSACTION in such a report after using CALL FUNCTION STARTING NEW TASK.


Link to the help page

Implementing Parallel Processing - Background Processing - SAP Library


I'm just wondering whether it's related to maximum number of sessions a user can have in SAP (I think the default is 6). If a new session is started, this will reduce the number of session available for parallel processing.


If anyone can clarify, it'd be great.


Regards,

Stevanic

1 ACCEPTED SOLUTION
Read only

retired_member
Product and Topic Expert
Product and Topic Expert
1,343

Well I havn't written the documentation cited above. In my documentation I don't have such a general restriction.

The special restriction I have in my documentation is written beneath the definition of the call back routine with CALLING|PERFORMING:


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

I suspect that the SAP Library documentation cited above got that mixed up and generalized a bit too much..Feel free to open a ticket ....

6 REPLIES 6
Read only

Former Member
0 Likes
1,343

This message was moderated.

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
0 Likes
1,343

Seems to me, that you mix up internal and external sessions

see Memory Organization ...

Read only

Former Member
0 Likes
1,343

Better to check with  Horst Keller  on this.

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
1,344

Well I havn't written the documentation cited above. In my documentation I don't have such a general restriction.

The special restriction I have in my documentation is written beneath the definition of the call back routine with CALLING|PERFORMING:


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

I suspect that the SAP Library documentation cited above got that mixed up and generalized a bit too much..Feel free to open a ticket ....

Read only

ec1
Active Participant
0 Likes
1,343

I have tested the parallel processing with CALL TRANSACTION and it seems that SAP allows to switch to internal session.

REPORT Z_ASYNC_TEST.

...

CALL FUNCTION 'Z_STEV_ASYNC_TEST'
       STARTING NEW TASK l_task_name
       DESTINATION IN GROUP DEFAULT
       PERFORMING end_task ON END OF TASK.


FUNCTION Z_STEV_ASYNC_TEST.

     ....

     CALL TRANSACTION 'SE38' USING it_bdcdata
                             MODE 'N'
                             UPDATE 's'.

ENDFUNCTION.


However, I found a problem if the current user is a dialog user. There cannot be more than 6 RFC running at the same time because that's the maximum number of dialog sessions a user can get. I got an error saying that "Maximum number of sessions reached".

The problem does not occur if the current user is a system user.

Read only

1,343

Hello,

I think things are mixed up a bit here. Therefore again the facts.

First you must distinguish between internal and external sessions:

  • An internal session is a memory area for program execution inside an external session. It is opened in a call sequence when one program calls another with CALL TRANSACTION or SUBMIT AND RETRUN. The maximum number of internal sessions in a call sequence is 9 (see Calling ABAP Programs).
  • An external session or main session is connected to an user session. The maximum number of external sessions for one user session is 16 but it is normally restricted to 6 by profile parameter rdisp/max_alt_modes (see Main Session).

These facts also hold for parallel processing with CALL FUNCTION STARTING NEW TASK.

Here you must distinguish between called program and calling program:

  • In the called program you can open new internal and external sessions as long as the above limits are not exceeded (this is why in your above example the called function module cannot open more than 6 sessions for the RFC user).
  • In the calling program you can also open new internal and external sessions as long as the above limits are not exceeded. Only if you are working with callback routines you should not open new internal sessions in the calling program, because the callback routines will not be found any more when the called function module has finished (that was what the original question was about).

These facts should be enough to explain the observed behavior.