Application Development and Automation 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: 
Read only

Internal & External Session

Former Member
0 Likes
2,513

Hi Experts,

What is the concept of internal & external session in SAP Memory & ABAP memory??

3 REPLIES 3
Read only

Former Member
0 Likes
1,118

Hi Neha,

Each new SAP window that opens after you click on the "Create New Session" button or user command /o creates an External session. Internal session on the hand is when you drill down in a report or a transaction within one SAP window ( example when you double clikc on a row on the report and it takes you to some other report or transaction ) There can be 6 external sessions and 20 internal sessions withing each external sessions.

Now the SAP memory is available throughout all the external sessions and we use SET and GET parameter statement to set and get the data from the SAP memory.

But the ABAP memory is available only within one session but across all internal seesions within that session. And we use Import and Export statements in this case.

Best regards,

Advait

Read only

Former Member
0 Likes
1,118

Hi,

follow this link this may be helpful to you.

http://abapprogramming.blogspot.com/2007/05/abap-memory.html

Regards,

vineela.

Read only

Former Member
0 Likes
1,118

hi,

The way in which main memory is organized from the program's point of view can be represented easily. There is a distinction between internal and external sessions:

Generally, an external session corresponds to an R/3 window. You create new external sessions by

choosing System Create session or entering /o<tcode> in the command field. You can have up to six

external sessions open simultaneously in one terminal session.

External sessions are subdivided into internal sessions. Each program that you run occupies its own

internal session. Each external session can contain up to nine internal sessions.

The data in a program is only visible within that internal session, so it is only visible to the program.

The following pages illustrate how the stack inside an external session changes with various program calls.

When you create a program, the system creates a new internal session, which contains the new program

context.

The new session is placed on the stack The program context of the calling program also remains on the

stack.

When the called program finishes, its internal session (the top one in the stack) is deleted.

Processing is resumed in the next-highest internal session in the stack.

When you end a program and start a new one, there is a difference between calling an executable program

and calling a transaction.

If you start an executable program using its program name, the internal session of the program you are

ending (the top one) is removed.

The system creates a new internal session, which contains the program context of the called program.

The new session is placed on the stack. Any program contexts that already existed are retained. The

topmost internal session on the stack is replaced.

If you start a program using its transaction code (if one is assigned), all of the existing internal sessions are

removed from the stack.

The system creates a new internal session, which contains the program context of the called program.

After the call, the ABAP memory is reset.

SAP memory is a user-specific memory area that you can use to store field values. It is only of limited

value for passing data between internal sessions. Values in SAP memory are retained for the duration of

the user's terminal session. The memory can be used between sessions in the same terminal session.

You can use the contents of SAP memory as default values for screen fields. All external sessions can

use the SAP memory.

ABAP memory is also user-specific. There is a local ABAP memory for each external session. You can

use it to exchange any ABAP variables (fields, structures, internal tables, complex objects) between the

internal sessions in any one external session.

When the user exits an external session (/i in the command field), the corresponding ABAP memory is

automatically initialized or released.

Hope this helps, Do reward.