Sub topic 9
Working with several sessions
This chapter assumes you can log on to SAP GUI, find the command field, and start a transaction with a code such as SU3. It also assumes you know the /n and /o prefixes from the previous chapter. Here you will use them to run several sessions in one logon.
What a session is
A session is one SAP GUI window with its own transaction and its own screen state. One logon can hold several sessions at once. Each session works independently, so you can look at a table in one window while you edit a record in another.
Sessions share your logon, your user ID, and your authorisations. They do not share unsaved screen data. Anything you typed in one session is invisible to the others until you save it.
Opening a session
You can open a new session in three ways:
- Enter
/ofollowed by a transaction code in the command field. This opens a new session and starts that transaction there. - Enter
/oon its own. This opens a new session on the SAP Easy Access menu. - Choose System > Create Session from the menu bar.
The /o form leaves your current session untouched. Compare it with /n, which replaces the transaction in the session you are using.
/oSE16This opens a new session and starts SE16 (Data Browser) there. The transaction in your original session stays where it was.
Moving between sessions
Each session is a separate window. Switch between them with the taskbar or with Alt+Tab, as you would with any desktop windows.
SAP GUI also shows the session number in the title bar, for example "SAP Easy Access" with the number 2. Use it to tell sessions apart when several windows look alike.
The session limit
An SAP system allows a limited number of sessions per logon. The default maximum is six, and the administrator can change it. When you reach the limit, SAP GUI refuses to open another session and shows a message. Close a session you no longer need, then try again.
Every session uses memory on the application server. Open only the sessions you need.
Closing sessions
Close a single session with System > Close Session or the window's close button. If the session has unsaved data, SAP GUI asks whether to save it. If it is your last session, closing it ends the logon.
The /nex command is different. It closes all sessions of the logon and logs you off immediately, with no save prompt. Unsaved work in every session is lost.
/nexHow the commands compare
| Command | Effect on current session | Effect on other sessions |
|---|---|---|
| `SE16` | Starts SE16 from the Easy Access menu | None |
| `/nSE16` | Ends the current transaction and starts SE16 | None |
| `/oSE16` | Stays as it is | A new session opens with SE16 |
| `/nex` | Closed, with no save prompt | All closed, you are logged off |
Common errors
- Using
/nwhen you meant/o. The current transaction ends, and you may lose unsaved entries. Use/owhen you want to keep the work in front of you. - Opening too many sessions. You hit the limit and the new session does not open. Close the ones you are finished with.
- Assuming sessions share data. An entry you have not saved in session 1 does not appear in session 2.
- Editing the same record in two sessions. SAP usually locks a record while one session edits it. The second session may get a message that the object is locked by your own user. Finish and save in one session first.
Exercise
You are halfway through entering data in a transaction and need to check a table in SE16 without losing your entries. What do you enter in the command field, and why not /nSE16?
Show answer
Enter /oSE16. It opens SE16 in a new session and leaves your current session as it is. /nSE16 ends the current transaction in your session, so your unsaved entries would be lost.
Exercise
A colleague says /nex is the quickest way to close the second session. What is wrong with that advice?
Show answer
/nex closes all sessions of the logon and logs you off immediately, with no save prompt, so unsaved work in every session is lost. To close only the second session, use System > Close Session.