06-02-2020 3:54 AM
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
07-08-2020 3:14 PM
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.
06-02-2020 4:35 AM
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?
06-02-2020 4:38 AM
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!
06-02-2020 12:28 PM
06-02-2020 9:10 AM
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
06-02-2020 12:39 PM
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.
06-02-2020 12:58 PM
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?
06-02-2020 1:07 PM
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.
06-02-2020 1:52 PM
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 ( )"
06-02-2020 1:53 PM
Yes, that is correct, it does not happen when you execute second time.
06-02-2020 4:32 PM
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]
06-03-2020 11:43 AM
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.
06-03-2020 2:21 PM
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.
06-03-2020 2:53 PM
nag.katta, you probably meant to write msgty 15 and msgno 027 (instead of msgno 017).
06-03-2020 4:13 PM
07-08-2020 3:14 PM
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.