Get Example source ABAP code based on a different SAP table
ID SET-PARAMETER • SET PARAMETER ABAP Statement • ID SET PARAMETER • FIELD SET PARAMETER
SET PARAMETER> Short Reference >
ABAP_SYNTAX SET PARAMETER ID pid FIELD dobj.>
What does it do? This statement sets the content of the SPA/GPA> parameter specified in pid> in the user memory> to the content of the data object dobj>. The ID pid> expects a flat> character-like field that can contain a maximum of 20 characters and not only blanks. pid> is case-sensitive. dobj> expects a flat character-like field whose binary content is passed unconverted. The statement SET PARAMETER> does not access the user memory directly. Instead, it accesses a local mapping of the SPA/GPA parameter in the session memory>, which is loaded during rollup 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 already existed for the current user, its value is overwritten. In a program, SPA/GPA parameters can only be created or filled with values that have a name in the table TPARA>>. If it is possible to statically determine that an ID specified pid> is not in the database table TPARA>, the extended program check reports an error.
Latest notes:
An SPA/GPA parameter specified in pid> must be entered in uppercase to match a name in the database table TPARA>.
Since the statements SET PARAMETER> and GET PARAMETER> do not work directly with the SPA/GPA parameters of the user memory, they are only suitable for passing data within an ABAP session> and not for passing data between parallel ABAP sessions because programs that run in parallel can affect the state of the parameters in an uncontrolled manner. ABAP_HINT_END
Example ABAP Coding
If the user selects one of the flight connections 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 AT LINE-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 linked to these SPA/GPA parameters and are displayed with the selected values as start values>. ABEXA 00656 ABAP_EXAMPLE_END