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: 

Parallel Processing error maximum no of sessions reached

nag_katta
Explorer
0 Kudos

Hi,

I implemented parallel processing using aRFC but getting an error – “Maximum no of internal sessions reached” when the user executes for the first time after login. Any subsequent executions work fine with no error until users exist and re-executes.

When it issues this error I noticed extra RFC sessions with Application Info <Remote client proxy> in SM04.

Thanks in Advance

1 ACCEPTED SOLUTION

nag_katta
Explorer
0 Kudos

This is the response from SAP Support:

-----------------------------------------------------------------------------------------------------------------------------------

During execution of the function module - 'BAPI_ACC_DOCUMENT_CHECK' the GUI is accessed in order to get the GUI properties which requires one extra external mode.

Since the number of external modes is limited you are getting the error message

"Maximum number of SAP GUI sessions reached"

When you restart the application in the same logon session the information about the GUI is already available and thus the GUI isn't accessed.

If you execute the report in background the RFC calls do not expect a GUI connection and so the error does not occur.

Call Stack:

CALL FUNCTION BAPI_ACC_DOCUMENT_CHECK
PERFORM DOCUMENT_CHECK (program SAPLACC9)
PERFORM CHECK_RWIN (program SAPLACC9)
CALL FUNCTION AC_DOCUMENT_CREATE
PERFORM DOCUMENT_CREATE (program SAPLFBAS)
CALL FUNCTION GM_DOCUMENT_CHECK
CALL METHOD CL_GM_CODING_BLOCK_MGR=>DERIVE_AND_VALIDATE
CALL METHOD CL_GM_CODING_BLOCK_MGR=>DERIVE_GM_OBJECTS()
CALL METHOD CL_BSSP_PSM_TAGGING_SERVICE=>SET_TAB_SPONSORED_OBJ
CALL METHOD CL_LSAPI_MANAGER=>GET_INSTANCE
CALL METHOD CL_NWBC_GUI_CONTROL=>CLASS_CONSTRUCTOR
CALL METHOD CL_GUI_FRONTEND_SERVICES=>CHECK_GUI_SUPPORT
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GET_GUI_PROPERTIES
CALL METHOD CL_GUI_CFW=>FLUSH
CALL FUNCTION AC_FLUSH_CALL
CALL FUNCTION AC_FLUSH_CALL_INTERNAL
RFC OLE_FLUSH_CALL

OLE_FLUSH_CALL is an RFC call to the GUI.

This is triggered by method GET_GUI_PROPERTIES.

For every subsequent execution of your application method CHECK_GUI_SUPPORT is still called but it does no longer call GET_GUI_PROPERTIES.

Method CL_LSAPI_MANAGER=>GET_INSTANCE checks which kind of GUI is used.

15 REPLIES 15

michael_piesche
Active Contributor
0 Kudos

How do you assign the number of parallel sessions? Do you use FM SPBT_INITIALIZE to get the available work processes for the server group name? And if so, is the difference in available wp so different and by how much compared between the first and consecutive executions?

former_member1716
Active Contributor
0 Kudos

nag.katta,

Before initiating For parallel processing, the maximum sessions in the server group available processes determined and reserved using the FM: SPBT_INITIALIZE.

You have to feed in the Server Group name and fetch the free resources that are available. Below Code for your reference:

    CALL FUNCTION 'SPBT_INITIALIZE'
      EXPORTING
        group_name                     = iv_group
      IMPORTING
        free_pbt_wps                   = lv_jobs
      EXCEPTIONS
        invalid_group_name             = 1
        internal_error                 = 2
        pbt_env_already_initialized    = 3
        currently_no_resources_avail   = 4
        no_pbt_resources_found         = 5
        cant_init_different_pbt_groups = 6
        error_message                  = 98
        OTHERS                         = 99.

* Note Ensure that out of all the available free resources you only use 80% percent of it to ensure effective performance without any bottleneck. This helps you have left 20% of resources always available for any new resource request.

Regards!

0 Kudos
Hi satishkumarbalasubramanian,Im using the FM -SPBT_INITIALIZE to get no of available free thread and using only half of available free threads.As I said, it is happening for the 1st time after user login.Thanks

ziolkowskib
Active Contributor
0 Kudos

Hi nag.katta,

It seems you have already received valuable advices how to solve your issue. If you need more information please refer to the documentation:

Implementing Parallel Processing

Regards,

Bartosz

nag_katta
Explorer
0 Kudos

michael.piesche,

Yes, Im using FM SPBT_INITIALIZE and using only half of available free threads. I do not have any Call Transactions or Submit statements in my code. My code is written in OO.

ziolkowskib,

I already looked at the documentation.

Thanks.

michael_piesche
Active Contributor
0 Kudos

Just to make sure, it only happens once after login to SAP Logon when the programm is executed the first time, correct? It doesnt happen when you a) exit the programm completely returning to SAP menu with /n and b) enter the programm again and execute it?

Sandra_Rossi
Active Contributor
0 Kudos

You say “Maximum no of internal sessions reached”, don't you mean external? If you really mean an issue with internal sessions (maximum 9), you should have a short dump in your SAP system with more information.

nag_katta
Explorer

Sandra Rossi,

I'm sorry, Yes I mean External sessions. There is no short dump created but in the system log (SM21) there is a message -"Transaction Canceled 14 027 ( )"

nag_katta
Explorer
0 Kudos

Michael Piesche,

Yes, that is correct, it does not happen when you execute second time.

nag_katta
Explorer
0 Kudos

Found this error in SM21 for failed transactions. I do not have any breakpoint enabled for the user.

H *** ERROR => HTTP> IcfStartDebugging failed! ThrtDbgPrepareSlave returned: 1 [icfdb.c 2807]

michael_piesche
Active Contributor
0 Kudos

Can you name the exact error message and better yet the message id and message number? Unless the text is not based on a message from the repository or created dynamically.

  • "Maximum no of internal sessions reached" does not exist in repository
  • "Maximum number of internal sessions reached" exists twice in repository

nag_katta
Explorer

I'm sorry, gave wrong message. This is the exact message - "Maximum number of SAP GUI sessions reached" with Message No: 14(017). Also, in SM04 i see additional RFC sessions with description "Remote client proxy", they are active only for first few seconds.

.remote-client-proxy-rfc-sessions.jpg

michael_piesche
Active Contributor
0 Kudos

nag.katta, you probably meant to write msgty 15 and msgno 027 (instead of msgno 017).

nag_katta
Explorer

Message Class: 14

Message No: 027

nag_katta
Explorer
0 Kudos

This is the response from SAP Support:

-----------------------------------------------------------------------------------------------------------------------------------

During execution of the function module - 'BAPI_ACC_DOCUMENT_CHECK' the GUI is accessed in order to get the GUI properties which requires one extra external mode.

Since the number of external modes is limited you are getting the error message

"Maximum number of SAP GUI sessions reached"

When you restart the application in the same logon session the information about the GUI is already available and thus the GUI isn't accessed.

If you execute the report in background the RFC calls do not expect a GUI connection and so the error does not occur.

Call Stack:

CALL FUNCTION BAPI_ACC_DOCUMENT_CHECK
PERFORM DOCUMENT_CHECK (program SAPLACC9)
PERFORM CHECK_RWIN (program SAPLACC9)
CALL FUNCTION AC_DOCUMENT_CREATE
PERFORM DOCUMENT_CREATE (program SAPLFBAS)
CALL FUNCTION GM_DOCUMENT_CHECK
CALL METHOD CL_GM_CODING_BLOCK_MGR=>DERIVE_AND_VALIDATE
CALL METHOD CL_GM_CODING_BLOCK_MGR=>DERIVE_GM_OBJECTS()
CALL METHOD CL_BSSP_PSM_TAGGING_SERVICE=>SET_TAB_SPONSORED_OBJ
CALL METHOD CL_LSAPI_MANAGER=>GET_INSTANCE
CALL METHOD CL_NWBC_GUI_CONTROL=>CLASS_CONSTRUCTOR
CALL METHOD CL_GUI_FRONTEND_SERVICES=>CHECK_GUI_SUPPORT
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GET_GUI_PROPERTIES
CALL METHOD CL_GUI_CFW=>FLUSH
CALL FUNCTION AC_FLUSH_CALL
CALL FUNCTION AC_FLUSH_CALL_INTERNAL
RFC OLE_FLUSH_CALL

OLE_FLUSH_CALL is an RFC call to the GUI.

This is triggered by method GET_GUI_PROPERTIES.

For every subsequent execution of your application method CHECK_GUI_SUPPORT is still called but it does no longer call GET_GUI_PROPERTIES.

Method CL_LSAPI_MANAGER=>GET_INSTANCE checks which kind of GUI is used.