ABAP Keyword Documentation →  ABAP − Reference →  User Dialogs →  Selection Screens →  Create Selection Screens →  PARAMETERS →  PARAMETERS - value_options → 

Selection Screens, Value Properties of Parameters

The example shows how to use the value_options additions of the PARAMETERS statement.

Source Code

REPORT demo_sel_screen_parameters_1.

SELECTION-SCREEN BEGIN OF SCREEN 100.

SELECTION-SCREEN BEGIN OF BLOCK part1 WITH FRAME TITLE text-001.
PARAMETERS: value TYPE i DEFAULT 100,
            name  TYPE sy-uname DEFAULT sy-uname,
            date  TYPE sy-datum DEFAULT '19980627'.
SELECTION-SCREEN END OF BLOCK part1.

SELECTION-SCREEN BEGIN OF BLOCK part2 WITH FRAME TITLE text-002.
PARAMETERS: field1 TYPE c LENGTH 10 DEFAULT 'input1',
            field2 TYPE c LENGTH 10 DEFAULT 'input2' LOWER CASE.
SELECTION-SCREEN END OF BLOCK part2.

SELECTION-SCREEN BEGIN OF BLOCK part3 WITH FRAME TITLE text-004.
PARAMETERS p_carrid TYPE s_carr_id MATCHCODE OBJECT demo_f4_de.
SELECTION-SCREEN END OF BLOCK part3.

SELECTION-SCREEN BEGIN OF BLOCK part4 WITH FRAME TITLE text-003.
PARAMETERS p_prog TYPE sy-repid MEMORY ID rid.
SELECTION-SCREEN END OF BLOCK part4.

SELECTION-SCREEN BEGIN OF BLOCK part5 WITH FRAME TITLE text-005.
PARAMETERS p_carr TYPE spfli-carrid VALUE CHECK.
SELECTION-SCREEN END OF BLOCK part5.

SELECTION-SCREEN END OF SCREEN 100.

AT SELECTION-SCREEN OUTPUT.
  SET PARAMETER ID 'RID' FIELD 'TEST_PROGRAM'.

CLASS start DEFINITION.
  PUBLIC SECTION.
    CLASS-METHODS main.
ENDCLASS.

CLASS start IMPLEMENTATION.
  METHOD main.
    CALL SELECTION-SCREEN 100 STARTING AT 10 10.
    IF sy-subrc <> 0.
      RETURN.
    ENDIF.
    WRITE: / 'FIELD1 is transported UPPERCASE      : ', field1,
           / 'FIELD2 is transported without changes: ', field2.
  ENDMETHOD.
ENDCLASS.

START-OF-SELECTION.
  start=>main( ).

Description

This example program consists of five parts, each illustrating one of value_options additions of the statement PARAMETERS. Each example corresponds to a block on selection screen 100.