Set parameter as listbox in report program

1. Syntax of defining the parameter.

PARAMETERS: p_werks TYPE
mard-werks

AS LISTBOX VISIBLE LENGTH 6

USER-COMMAND
ON_CHANGE_WERKS

DEFAULT ’1000′ OBLIGATORY.

The addition USER-COMMAND can be used to assign a function code fcode to the dropdown list box. The function code fcode must be specified directly and can have a maximum length of 20 characters.

2. Set initial data for the parameter

INITIALIZATION.
CALL FUNCTION ‘VRM_SET_VALUES’

EXPORTING

id

= ‘p_werks’

values = it_values.

3. Respond to the value change of listbox

IF sscrfields-ucomm = ‘ON_CHANGE_WERKS’.
* …
ENDIF .

4. Change related screen field

AT SELECTION-SCREEN OUTPUT .

LOOP AT SCREEN.
* …

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Comments are closed.