SPA/GPA Parameters in ABAP
SPA/GPA Parameters in ABAP
This note offers a few words on how you can personalize the behavior of your ABAP programs. By personalization, I mean the use of parameters that can be assigned specific values, which in turn influence the logic of your development. So, let's talk about SPA/GPA parameters in ABAP.
What is it? Briefly.
In short, SET/GET parameters (SPA/GPA) are objects (essentially variables) stored in the user memory, which can be accessed via ABAP.
See: SPA/GPA parameter
Also known as SET/GET parameters, these are data objects in user memory that can be accessed within ABAP programs. SPA/GPA parameters are set usingSET PARAMETER
and retrieved usingGET PARAMETER
. Input fields on dynpros (dialog screens) can be linked to SPA/GPA parameters, allowing them to be automatically filled with default values when the screen is loaded. Likewise, values entered by the user in such fields can be stored in associated SPA/GPA parameters. The parameter names are maintained in database table TPARA.
Why might I need them?
For example, in your development, you may need to display a button for one group of users, but hide it for another group.
To achieve this, you create a GPA parameter and assign different values to different users. In your program’s code, you determine whether to show or hide the button based on the value retrieved from the user’s profile. Once the program runs, you should see the desired result. The benefit here is obvious.
See: Parameters in the User Memory
Creating Parameters
Main data for SPA/GPA parameters is stored in the TPARA table.

To create a new parameter, use transaction SE80, selecting the appropriate option from the menu. The following video clip demonstrates the steps needed to create a new parameter.
Assigning Parameters
Users can assign parameters themselves via transaction SU3.

Mass assignment of parameters can be done using transaction SU10.
Note: User-specific parameters are stored in table USR05.

Example: Using SPA/GPA Parameters in an ABAP Program
Let’s look at a simple example. Depending on the value of a parameter, we’ll output some text on the screen.
REPORT zparam_get_demo.
DATA: lv_param TYPE char15.
GET PARAMETER ID 'ZDEMO_PARAM' FIELD lv_param.
TRANSLATE lv_param TO UPPER CASE.
CASE lv_param.
WHEN ''.
WRITE:/ 'Empty'.
WHEN 'DEMO_VAL'.
WRITE:/ 'From love to signatov.com'.
WHEN OTHERS.
WRITE:/ 'Could not find the value for this parameter'.
ENDCASE.
In the user's profile, the parameter value looks like this:
