Memory Concepts

Embed Size (px)

DESCRIPTION

Memory Concepts

Citation preview

ABAP Memory-----------The memory area of each session contains an area called ABAP memory. The ABAP memory is available to all internal sessions. ABAP programs can use the EXPORT and IMPORT statements to access this shared memoryEXPORT p_name TO MEMORY ID 'TEST1'.IMPORT p_name FROM MEMORY ID 'TEST1'.Here export and import parameters nme must be same otherwise data will not be imported.Internal table data can also be passed using ABAP memoryWhen passing internal table data, make sure that the internal tables name in both the programs are same .To free the memory id use below statement.FREE MEMORY ID 'TEST1'.SAP memory----------The memory area of each session contains an area called SAP memory. The SAP memory is available to all internal and external sessions. ABAP programs can use the SET PARAMETER ID and GET PARAMETER ID statements to access this shared memory.This memory is available until the system is logoff.Note 1) The mempry id length should not exceed 20 charatcers and the value should not exceed 255 character length .otherwise system causes dump.Note 2) Memory ID should not be blank.SET PARAMETER ID 'AUN' FIELD p_vbeln.GET PARAMETER ID 'AUN' FIELD p_vbeln.Internal table data can't be passed using SAP memoryCalling a program from another program---------------------------------------------------SUBMIT- is a key word used call another executable program from a programSUBMIT zdemo_called_program. When you use the above statement, the program zdemo_abap_memory1 will be executed wherethe statement occurs in calling program and display the result. In this case selection screen of the called program will not be shown.SUBMIT zdemo_called_program VIA SELECTION-SCREEN.When we use VIA SELECTION-SCREEN, the selection screen of called program will be shown.SUBMIT zdemo_called_program VIA SELECTION-SCREEN AND RETURN.If you want to come back to the selection screen of the calling program, AND RETURN should be used.SUBMIT zdemo_called_program VIA SELECTION-SCREEN WITH p_mat = p_matnr.Here p_mat is selection screen field of the called program and p_matnr is the selection screen field of the calling program. So we can pass the parameter value by specifying like this.If Parameter does not exist in the called program then it ignores the value.If you want to pass more than one parameter, then we need use SELECTION-TABLE .SUBMIT zdemo_called_program VIA SELECTION-SCREEN WITH SELECTION-TABLE rt_rsparams .Here rt_rsparams must be of type RSPARAMS.SUBMIT zdemo_called_program VIA SELECTION-SCREEN WITH SELECTION-TABLE it_rspar AND RETURN.