ABAP - Keyword Documentation →  ABAP - Reference →  Creating Objects and Values →  Parameters in the User Memory → 

SET PARAMETER

Quick Reference

Syntax

SET PARAMETER ID pid FIELD dobj.

Effect

This statement sets the content of the SPA/GPA parameter specified in pid user memory to the content of the data object dobj. The ID pid must be a flat character-like field that contains no more than 20 characters and does not consist solely of blanks. pid is case-sensitive. dobj expects a flat character-like field whose binary content is passed in an unconverted format.

The statement GET PARAMETER does not access the user memory directly. Instead, it accesses a local mapping of the SPA/GPA parameter in the program memory, which is loaded when rolled in and saved in the user memory when rolled out (see SPA/GPA Parameters and ABAP Programs). If the SPA/GPA parameter specified for the current user in pid does not yet exist in the user memory, it is created. If the SPA/GPA parameter has already been created for the current user, its value is overwritten.

In a program, SPA/GPA parameters can only be created or assigned values if a name exists for them in the table TPARA. If it is known statically that an ID pid is not in the database table TPARA, the extended program check reports an error.

Notes

Example

If the user selects a flight displayed in the basic list, the SPA/GPA parameters CAR and CON are set to the ID of the airline and the number of the connection at the event ATLINE-SELECTION. The names of both parameters are defined in the table TPARA for this purpose. In the initial dynpro of the transaction DEMO_TRANSACTION, two input fields are associated with these SPA/GPA parameters and are displayed with the selected values as start values.

DATA: carrier     TYPE spfli-carrid,
      connection  TYPE spfli-connid.

START-OF-SELECTION.
  SELECT carrid, connid
         FROM spfli
         INTO (@carrier, @connection).
    WRITE: / carrier HOTSPOT, connection HOTSPOT.
    HIDE:  carrier, connection.
  ENDSELECT.

AT LINE-SELECTION.
  SET PARAMETER ID: 'CAR' FIELD carrier,
                    'CON' FIELD connection.
  CALL TRANSACTION 'DEMO_TRANSACTION'.

Exceptions

Non-Handleable Exceptions