If you want the data type of a parameter to refer dynamically to a data type from the ABAP Dictionary, use the following syntax:
PARAMETERS p LIKE (name)...
At the time the selection screen is called, the field name must contain the name from a data type of the ABAP Dictionary. Currently, parameters can only refer to fields of database tables, views and structures. The parameter dynamically adopts the attributes of the Dictionary type, that is, technical properties and help texts. If you do not create a selection text for the parameter in the program, the field label from the Dictionary appears as the description on the selection screen. Otherwise, the selection text is displayed.
The contents of the field name are taken from the program in which the selection screen is defined. If the selection screen is defined in the selection part of a logical database, then the field name of the associated database program is used.
REPORT demo_sel_screen_parameters_2 .
DATA name(20) TYPE c.
SELECTION-SCREEN BEGIN OF SCREEN 500.
PARAMETERS p_carr LIKE (name).
SELECTION-SCREEN END OF SCREEN 500.
name = 'SPFLI-CARRID'.
CALL SELECTION-SCREEN 500.
The selection screen called looks as follows:
The field length, the selection text and the field help are dynamically taken from field CARRID of database table SPFLI.