Parameters - Syntax & Examples (SAP ABAP Keyword).
INTRODUCTION:
- The PARAMETERS statement creates a single entry field on the selection screen.
- The PARAMETERS command is very simple to use and a powerful means to create a user interface.
- In layman terms, PARAMETERS statement is used to accept input from user. It is used when we want the user to enter data and depending upon what he/she enters, necessary action is to be taken.
- It creates a variable in the program with the same name and the value placed in the field at run time by the user is also placed in the variable.
SYNTAX:
PARAMETERS <pname> EXTRAS
where <pname> is the variable created which holds the the value entered by user at run time.
and EXTRAS are the additional properties associated with the PARAMETERS statement, such as:
- TYPE type [DECIMALS dec]
- LIKE fld
- OBLIGATORY
- NO-DISPLAY
- VISIBLE LENGTH vlen
- AS CHECKBOX [USER-COMMAND fcode]
- RADIOBUTTON GROUP group [USER-COMMAND fcode]
- AS LISTBOX VISIBLE LENGTH vlen [USER-COMMAND fcode]
- MODIF ID modid
- DEFAULT val
- LOWER CASE
- MATCHCODE OBJECT search help
- VALUE CHECK
EXAMPLES WITH SCREENSHOTS:
PARAMETERS : s_plant LIKE lips-werks.
PARAMETERS : s_plant TYPE lips-werks.
PARAMETERS : s_plant TYPE n,
s_matnr(18) TYPE c.
PARAMETERS : s_plant(4) TYPE n DEFAULT '1501',
s_matnr(18) TYPE c DEFAULT 'Power Circuits'.
PARAMETERS : s_plant(4) TYPE n DEFAULT '1501',
s_matnr(18) TYPE c DEFAULT 'Power Circuits',
s_date LIKE sy-datum DEFAULT '20110216'.
* CHSPL is of type CHAR with length 1. Also it's domain XFELD has value range set as 'X' and blank.
PARAMETERS : s_CHSPL LIKE lips-CHSPL.
PARAMETERS : s_kostl LIKE lips-kostl MATCHCODE OBJECT qals.
PARAMETERS : s_matnr LIKE lips-matnr LOWER CASE.
PARAMETERS : s_matnr LIKE lips-matnr LOWER CASE OBLIGATORY.
PARAMETERS : s_matnr TYPE c AS CHECKBOX.
PARAMETERS : s_matnr TYPE c AS CHECKBOX DEFAULT 'X'.
PARAMETERS: p_carrid TYPE scarr-carrid AS LISTBOX VISIBLE LENGTH 20 OBLIGATORY.
PARAMETERS : s_matnr TYPE c RADIOBUTTON GROUP abc,
s_matnr1 TYPE c RADIOBUTTON GROUP abc ,
s_matnr2 TYPE c RADIOBUTTON GROUP abc .
PARAMETERS :s_matnr TYPE c RADIOBUTTON GROUP abc,
s_matnr1 TYPE c RADIOBUTTON GROUP abc DEFAULT 'X',
s_matnr2 TYPE c RADIOBUTTON GROUP abc .
ALSO READ:
- ELEMENTARY DATA TYPES - Initial Values, Syntax & Properties.
- FIELD SYMBOLS - Introduction, Syntax & Examples.
- PARAMETERS - Introduction, Syntax & Examples.
- SELECT-OPTIONS - Introduction, Syntax & Examples.
- SELECTION-SCREEN - Introduction, Syntax & Examples.
- SSCRFIELDS - The Screen Fields Table.
Your suggestions and comments are welcome in this section.
Please mail all your contributions to administrator@abapmadeeasy.com We request you to mention your Name, Designation, Experience & Organization you are working for. Your posts will be verified and posted in this site with your name.