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

memories

Former Member
0 Likes
1,212

hi experts,

what sap memory ? n what is abap memory?

what is expamples of these memories.

want clear explaination

thanks in advance.

1 ACCEPTED SOLUTION
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
1,165

Hi,

Before explaining memories you need to know about sessions in SAP.

There are two types of sessions.

External and Internal.

Each main window of SAP GUI is one External Session.

All the dialog the are initiated from this session or called Internal sessions.

Example. SAP Easy access menu is One external session from there if you start any transaction then it will start in a internal session.

The Memory that is allocated to External session is called SAP memory.

The Memory allocated to internal session is ABAP memory.

You use SET and GET PARAMETERS to access SAP memory.

You use EXPORT and IMPORT to access ABAP memory.

ABAP memory is deleted using FREE or when the internal session is terminated.

SAP memory is cleared only when user logs off.

Best Regards,

Sesh

hi experts,

what sap memory ? n what is abap memory?

what is expamples of these memories.

want clear explaination

thanks in advance.

6 REPLIES 6
Read only

Former Member
0 Likes
1,165

SAP memory is the global memory which you can share through out the sessions.

SAP memory is a memory area to which all main sessions within a SAPgui have access.

You can use SAP memory either to pass data from one program to another within a session,

or to pass data from one session to another.

Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters).

These parameters can be set either for a particular user

or for a particular program using the SET PARAMETER statement.

Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement.

The most frequent use of SPA/GPA parameters is to fill input fields on screens

SAP global memomy retains field value through out

session.

set parameter id 'MAT' field v_matnr.

get parameter id 'MAT' field v_matnr.

they are stored in table TPARA.

<b>ABAP memory</b>

ABAP memory is a local memory within a session, which is used by a particular program.

ABAP memory is a memory area that all ABAP programs within the same internal session can access

using the EXPORT and IMPORT statements.

Data within this area remains intact during a whole sequence of program calls. To pass data

to a program which you are calling,

the data needs to be placed in ABAP memory before the call is made.

The internal session of the called program then replaces that of the calling program.

The program called can then read from the ABAP memory.

If control is then returned to the program which made the initial call, the same process operates in reverse.

ABAP memory is temporary and values are retained

in same LUW.

export itab to memory id 'TeST'.

import itab from memory Id 'TEST'.

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
1,166

Hi,

Before explaining memories you need to know about sessions in SAP.

There are two types of sessions.

External and Internal.

Each main window of SAP GUI is one External Session.

All the dialog the are initiated from this session or called Internal sessions.

Example. SAP Easy access menu is One external session from there if you start any transaction then it will start in a internal session.

The Memory that is allocated to External session is called SAP memory.

The Memory allocated to internal session is ABAP memory.

You use SET and GET PARAMETERS to access SAP memory.

You use EXPORT and IMPORT to access ABAP memory.

ABAP memory is deleted using FREE or when the internal session is terminated.

SAP memory is cleared only when user logs off.

Best Regards,

Sesh

Read only

0 Likes
1,165

Hi,

can you pls clarify some doubts here.

Can both SAP and ABAP memories be used by both External session and internal sessions?

If I close the main session after instantiating internal sessions, can I still use SAP memory by those internal session?

Read only

0 Likes
1,165

Hi,

Since External session contains the Internal session all internal sessions can access the external sessions memory that is SAP meory. But SAP memory is mainly used for exchaning data between two External sessions. Where ABAP memory is mainly used for exchanging data between Internal sessions.

External session uses SAP memory to pass data to another.

Internal session uses ABAP memory to pass sdata to another.

Regards,

Sesh

Read only

Former Member
0 Likes
1,165

Hi Surendra,

Please reward helpful answers!!

Read only

anversha_s
Active Contributor
0 Likes
1,165

hi,

<i>SAP and ABAP Memory</i>

There is a difference between the cross-transaction SAP memory and the transaction-specific ABAP memory.

<i>Global SAP memory</i>

The global SAP memory is available to a user during the entire duration of a terminal session. Its contents are retained across transaction boundaries as well as external and internal sessions. The SET PARAMETER and GET PARAMETER statements allow you to write to, or read from, the SAP memory.

Input fields on screens can be linked with parameters in the SAP memory, which allows you to preassign values to the input fields on initial screens.

With general screens, the linking takes place during the definition of the screen using the Screen Painter tool. When setting the field attributes of an input field, you can specify the ID of an SPA/GPA parameter in the Parameter-ID attribute. In the checkboxes SET Parameter and GET Parameter you can specify whether the screen field is filled with the value of the SPA/GPA parameter at the time of PBO or whether the SPA/GPA parameter is filled with the user input on the screen at the time of PAI.

With selection screens, the linking is carried out using the MEMORY ID addition to the PARAMETERS or SELECT-OPTIONS statement. If you specify an SPA/GPA parameter ID, when declaring a parameter or selection criterion, the relevant input field is linked with the parameter.

<i>Local SAP memory</i>

The local SAP memory is available to the user throughout a transaction, within which you can also call other program units, for example using SUBMIT or CALL TRANSACTION. With SET PARAMETER you write to both the global and the local SAP memory. If the global SAP memory is changed by an external mode of the same user, the local SAP memory remains unchanged. This ensures that parameters set in the frame of a transaction remain unchanged until the end of this transaction. The local SAP memory is deleted after the transaction is ended.

<i>ABAP memory</i>

The contents of the ABAP memory are retained only during the lifetime of an external session (see also Organization of Modularization Units). You can retain or pass data across internal sessions. The EXPORT TO MEMORY and IMPORT FROM MEMORY statements allow you to write data to, or read data from, the ABAP memory.

Please consult Data Area and Modularization Unit Organization documentation as well and Memory Structures of an ABAP Program

Regards

Anver