ABAPGET_PARAMETER - GET PARAMETER
BAL_S_LOG - Application Log: Log header data General Data in Customer MasterThis documentation is copyright by SAP AG.
GET PARAMETER
Syntax
GET PARAMETER ID pid FIELD dobj.
Effect
This statement sets the content of the data object dobj to the content of theSPA/GPA parameter specified in pid. The identification pid must be aflatcharacter-like field that contains no more than 20 characters and does not consist solely of blanks.The field is case-sensitive. dobj expects a flat character-like field to which the binary content of the SPA/GPA parameter is passed unconverted.
The statement GET PARAMETER does not access the SAP Memory directly. Instead, it accesses a local mapping of the SPA/GPA parameter in theroll area, which is loaded when rolled in and saved in the SAP Memory when rolled out (seeSPA/GPA Parameters and ABAP Programs). If the SPA/GPA parameter specified in pid does not yet exist in theSAPMemory for the current user, the data object dobj is initialized and sy-subrc is set to 4.
A program can only read those SPA/GPA parameters for which there is a name in the table TPARA. If it can be determined statically that an ID specified in pid is not in theTPARA database table and the ABAP runtime environment package check is activated using theprofile parameterabap/package_check, a syntax error occurs. Otherwise, only the enhanced program check registers an error.
System Fields
| sy-subrc | Meaning |
| 0 | The SPA/GPA parameter specified in pid exists for the current user in the SAP Memory and its value was passed o the target field. |
| 4 | The SPA/GPA parameter specified in pid does not exist for the current user in the SAP Memory. |
Notes
- An SPA/GPA parameter that is readable using GET PARAMETER can either have been created previouslyin the SAP Memory using the SET PARAMETER statement or created automatically in the eventPAI of ascreen orselection screen.
- An SPA/GPA parameter specified in pid can match a name in the database table TPARA only if it is entered in uppercase letters.
- The statements SET PARAMETER and GET PARAMETER do not work directly with the SPA/GPA parametersof the SAP Memory, which means that they are only suitable for passing data within a single main sessionand not for passing data between two main sessions in parallel This is because programs that run in parallel can change the state of the parameters unpredictably.
Example
In this example, the current value of the SPA/GPA parameter RID is read from the SAP Memory to the data object prog. In the screens ofABAPWorkbench, this parameter is associated with the input fields for a program name. When an ABAP Workbenchtool in which an ABAP program is processed, is first called, the parameter is created in the event PAIand assigned the name of the program specified there. If, in the same user session, no screen is processedthat sets the parameter RID and no corresponding SET PARAMETER statement was executed beforehand, then RID is not found in the SAP Memory.
DATA: para TYPE tpara-paramid VALUE 'RID',
prog TYPE sy-repid.
GET PARAMETER ID para FIELD prog.
IF sy-subrc <> 0.
MESSAGE 'Parameter not found' TYPE 'I'.
ENDIF.
General Data in Customer Master Fill RESBD Structure from EBP Component Structure
This documentation is copyright by SAP AG.
Length: 5368 Date: 20120522 Time: 063211 triton ( 195 ms )






