SAP NetWeaver AS ABAP Release 750, ©Copyright 2016 SAP AG. All rights reserved.ABAP - Keyword Documentation → ABAP - Reference → Creating Objects and Values →
Parameters in the User Memory
The user memory is a user-specific memory area of the current application server, which is accessed by all ABAP sessions of a user session at once. ABAP programs have access to SPA/GPA parameters stored in the user memory (also called SET/GET parameters).
Each SPA/GPA parameter is identified by an ID of up to 20 characters. SPA/GPA parameters can either be created explicitly using the statement SET PARAMETER, or implicitly in a PAI event. Once they have been saved in the user memory, they are available to any programs and any sessions throughout the whole duration of a user session. SPA/GPA parameters are usually evaluated by the ABAP runtime environment. In ABAP programs, the parameters can be read using the statement GET PARAMETER.
One example of a program that uses SPA/GPA parameters is user maintenance (transaction SU01). In this transaction, on the Parameters tab page, you can enter user-specific parameters, which are then set when the user logs on to the AS ABAP, and are evaluated by other programs.
SPA/GPA Parameters and ABAP Programs
ABAP programs cannot access the user memory directly. Instead, all SPA/GPA parameters have to be imported or exported implicitly at given times like a file. This has consequences for programs that one and the same user can run in parallel sessions:
Premature rollouts can be forced by statements such as WAIT UP TO, but the fact that the state of the user memory is always determined by the program that was last rolled out creates a serious obstacle for cross-session use of SPA/GPA parameters in programs that are running in parallel. This type of programming is therefore not recommended.
Managing SPA/GPA Parameters
The names of SPA/GPA parameters are edited in database table TPARA. In the Object Navigator in ABAP Workbench, the names of SPA/GPA parameters are created in uppercase in database table TPARA and are linked to packages. Database table TPARA acts as a reservation table for SPA/GPA parameters. If SPA/GPA parameters are used in a program, the name of the parameter must be contained in the PARAMID column in the database table TPARA. Be careful not to overwrite SPA/GPA parameters from other applications.
If a name exists in database table TPARA, this does not automatically mean that the corresponding parameter also exists in the user memory. SPA/GPA parameters are exclusively created during execution of an ABAP program.
SPA/GPA Parameters and Dynpro Errors
When defining input fields, dynpro fields can be associated with SPA/GPA parameters by entering the name of an SPA/GPA parameter from the database table TPARA as an attribute PARAMETER ID. If the corresponding parameter GET PARAMETER is set and no other value is assigned to the input field, the input field is filled with the value of the SPA/GPA parameter when the screen is sent. If the corresponding attribute SET PARAMETER is set, the content of the input field is assigned to the SPA/GPA parameter at the PAI event. If the parameter does not yet exist in the user memory, it is created implicitly in the PAI event. In selection screens, this associated can be created by using the addition MEMORY ID of the statements PARAMETERS and SELECT-OPTIONS.