Preface – This post is part of the ABAP Beginner series.
Table of Contents
What are SAP Session?
“SAP Session” are a way to control the number of logins or number of active users on a single landscape. To make it easier, let us assume that we have three landscapes, i.e. ISD, IST, ISP. These three landscapes will be used for different purposes, i.e. for development, testing and production. There are three types of sessions in SAP:
- User Session
- ABAP Session
- Internal Session
Now, SAP has given you three different environments. These are nothing but user sessions. As soon, you have opened SAP GUI, you have logged into a user session. And now you have logged in to ISD, i.e. for development. In this scenario, you have also logged in to the ABAP session. Now, you have opened the SE38 transaction to make a report, so now you have logged in to the internal session.
If you have understood the sessions, then we can proceed with the definitions.
Logging on to an application server opens a user session. Logons take place using SAP GUI, the RFC interface, or ICF. A user session is assigned its own memory area of the user memory. From a user session, it is possible to open further user sessions on the same application server or another server in a program-driven way.
An ABAP session is opened for each user session. Each ABAP session is assigned its own memory area of ABAP memory, in which data clusters can be stored.
Further ABAP sessions for a user session can be opened as followed:
- Enter a transaction code after “/O” in the command field in the toolbar.
- Call the function module TH_CREATE_MODE.
- Call a Dynpro when processing an asynchronous RFC.
A maximum of 16 ABAP sessions are possible per user session, and the default is 6.
Each call of an ABAP program creates a new internal SAP session in which the called program is loaded. This is where the modifiable objects of the program are held. In one ABAP session, the maximum number of internal sessions can be nine.
Close a hung SAP Session
Let’s say you want to end session three. You can go to either session one or two and enter this command in the transaction box: /i3.
This will immediately close the hung up session (session four in this case).
Or you can do this the long way by going to SM04 and double-click your user ID, select a session and hit ‘end session’.