EP: Portal – RFC Connections & Sessions (BW Example).
In my experience perhaps one of the most commonly encountered issue scenarios in my discussions with customers relates to session management and inadequate session retention. I like to use the term “classical” session retention to describe a connection issue such as the working example outlined below:
- User A logs into the Enterprise Portal and performs some activity
- User A proceeds to finish this activity and navigate away or close the browser (whilst clicking logoff)
- User B logs into the Enterprise Portal and is presented with User A’s session details i.e. the information last accessed by User A.
The Portal, Sessions & BI/BW
With regards to the Enterprise Portal, BW in itself along with Business Intelligence (BI) is one of the most heavily utilized application interfaces. Business Warehousing along with running BW Reports is often an activity associated with interaction & integration through the Enterprise Portal.
- For example you could have BW Reports accessed through Portal iViews
Let us expand on the working example above and imagine that a BW ABAP Production System and notice via Transaction SM04 that RFC Connection Sessions are not closing & getting disconnected from the Enterprise Portal. In true essence these type of occurrences come down to two particular factors which are either a discrepancy in the setup or a mis-configuration in terms of parameters.
With respect to a BW based scenarios here you need to determine whether or not the root source of “session retention” resides with the Portal itself or in fact the BW perspective.
From an end users perspective utilizing the enterprise Portal is a straightforward process. We simply logon, fulfill our work obligations and logoff. As an end user we are only concerned with the graphical representation of the Portal that we are delivered with through our monitors representation and we are not truly troubled by what underlying functionality is taking place.
The Portal – How It Manages Sessions
From the perspective of the Enterprise Portal and session management there are some important points to highlight. When session expires or logoff is invoked or browser is closed, no matter what, the connection is not terminated but returned to the pool and kept open as defined in the Connection Lifetime property. In short, the connection stays open for the predefined amount of time by design and this is not an unexpected behavior. It remains in the pool, it is no longer used by e.g. the UWL and it is available for other clients.
The connection lifetime pool can be reset to a different value.When you use transaction SM04 to check sessions what are you seeing? In many cases when the portal is closed (via logoff) a reference is stored.
Use Transaction SM04 – What Do You See?
From using the SM04 transaction it may appear that the sessions remain open but in fact they will only be references.
- But you are seeing the transaction field remain filled? Are you closing the browser after the users logoff?
Now the WIKI outlined below concerning the RFC Sessions and the SM04 Transaction screen is the core point of reference for resolving session retention.
Essentially SM04 as a transaction provides us with a view on the different connection types. With reference to SM04 the connection type means what kind of user (and their connection) is connecting to the SAP System e.g. the Portal.
- Connection types include that of RFC, GUI, Plugin (HTTP/SMTP).
This particular connection type references users which are connected up to the system (Portal) via an RFC Connection. (See RFC’s using the SM04 transaction), a simplistic view on a RFC connection type user is someone who is utilizing the connection using external based RFC clients.
As the title implies this particular connection types makes references to users who utilize access to the Portal via a GUI based connection platform.
The Portal – Connection Lifetime Property
The Netweaver Administrator (NWA) and the Connection Lifetime Property in older versions twas managed through the Visual Administrator but from 7.3+ you can find, review and maintain this property through the following path:
- Login to Netweaver Administrator (/NWA)
- Go to Configuration > Infrastructure > Application Resources
- Click at the resource you’d like to change, for example of type ‘JCA Connection Factory’.
- Do your changes (if needed) in ‘Resource Details’ > ‘Connection Pooling’ and save.
Note: The RFC connection will be removed from the connection pool if it is unused for a longer time than defined in the connection lifetime:
In true essence when we are dealing with a session retention issue from the perspective of the Enterprise Portal (EP) the primary points of analysis are to ensure that the correct parameters and configurations are being maintained and that the .DSM Terminator is called and reference accordingly.
The Portal & BW – Resolving Connection Issues
Now taking what I have written above into account we know that the connection itself is not terminated but rather returned to the connection pool. So here now we must determine where the issue is sourced from i.e. the Portal or BW.
- Are you closing the browser after user logoff? When a user logs off from your company Portal by choosing the Log Off button, a logoff action should be triggered on the SAP Portal Side (Portal & Connected back-end systems).
- Although the SAP Netweaver Portal comes with an out-of-the-box mechanism that terminates a session when the user closes the browser or navigates out of the SAP iFrame the mechanism itself does not handle logoff. Instead your company Portal must raise the terminating event when logging off from the SAP Portal.
Portal Resolution Notes
- SAP Note: 1261669 RFC connections are not closed
- SAP Note: 1903478 -Session remains open after the logoff on enterprise portal && SAP
- SAP Note: 1660720 – Session remains open after the logoff on enterprise portal
BW Resolution Notes
- SAP Note: 2177121 – Common issues with RFC sessions and time out handling in BI Java Web
Full Overview Blog Series on Sessions & Related Issues
EP: Sessions Part 1 (RFC, GUI, HTTP Plugin) A Brief Overview
EP: Sessions Part 2 (RFC, GUI, HTTP Plugin) Common Ground & Issues
EP: Sessions Part 3 Frequent Issues & Solutions