SAP Memory and ABAP Memory Tutorial
SAP Memory and ABAP Memory Tutorial
This tutorial will explain you what is SAP and ABAP memory and difference between two Memories and Example tutorial of SAP and ABAP memory. As a ABAP fresher consultant ,memory logic should be understand to know in which memory our program processing.
ABAP MEMORY AND SAP MEMORY
ABAP MEMORY-It uses export and import parameters when an active internal session
calls another internal session within a single main session .
SAP MEMORY- It uses set and get parameters to pass the data from one main session to another main session.
SAP memory is a memory area to which all main sessions within a SAP GUI 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). 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
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.
External session: - when user logs on to R/3 system, the system Creates a new terminal session called external session. E.g. System Session.
Internal session: - created by calling a transaction (with CALL TRANSACTION), a dialog module (with CALL DIALOG) or a report (with SUBMIT or RETURN).
EXPORT is a keyword which is used to export a value to a memory id.
IMPORT is a keyword which is used to import a value from a memory id
SUBMIT is a keyword which is used to call a executable program (ABAP program) from another program.
ABAP Memory Program Example
REPORT ZPOST1.
data : text1 type char25 value 'export and import'.
export text1
text2 from 'ep and ip' to memory id 'STORE'.
SUBMIT ZPOST AND RETURN.
REPORT ZPOST.
DATA : TXT1 TYPE CHAR25.
DATA : TXT2 TYPE CHAR25.
IMPORT TEXT1 TO Txt1 FROM MEMORY ID 'STORE'.
IMPORT TEXT2 TO Txt2 FROM MEMORY ID 'STORE'.
WRITE :/ Txt1.
WRITE :/ Txt2.
OUTPUT
export and import
ep and ip
SAP Memory Program Example
REPORT ZSAP_MEMORY. .
DATA TEXT1(25) TYPE C VALUE 'SET AND GET PARAMETER'.
SET PARAMETER ID 'STORE' FIELD TEXT1.
WRITE : 'SET PARAMETER'.
REPORT ZSAP_MEMORY1. .
DATA TEXT2(25) TYPE C .
GET PARAMETER ID 'STORE' FIELD TEXT2.
WRITE : / TEXT2.
WRITE : 'GET PARAMETER'.
Comments
Post a Comment