Code: Alles auswählen.
REPORT.
TYPE-POOLS: vrm.
TYPES: ty_demo(20) TYPE c.
DATA: vrm_values TYPE vrm_values,
wa_value LIKE LINE OF vrm_values,
vrm_id TYPE vrm_id,
n(2) TYPE n,
ok_code TYPE syucomm,
first TYPE flag VALUE 'X'.
DATA: p_demo1 TYPE ty_demo,
p_demo2 TYPE ty_demo.
END-OF-SELECTION.
CALL SCREEN 9000.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9000 INPUT
*&---------------------------------------------------------------------*
MODULE user_command_9000 INPUT.
CASE ok_code.
WHEN 'DEMO1'.
WHEN OTHERS.
SET SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
*&---------------------------------------------------------------------*
*& Module fill_lb OUTPUT
*&---------------------------------------------------------------------*
MODULE fill_lb OUTPUT.
* 1. Dropdownlist nur beim 1. Mal füllen
IF first = 'X'.
CLEAR first.
vrm_id = 'P_DEMO1'.
REFRESH vrm_values.
DO 9 TIMES.
n = sy-index.
IF sy-index = 3.
p_demo1 = n.
ENDIF.
wa_value-key = n.
CONCATENATE 'Beschreibung' n INTO wa_value-text.
APPEND wa_value TO vrm_values.
ENDDO.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = vrm_id
values = vrm_values
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
ENDIF.
vrm_id = 'P_DEMO2'.
REFRESH vrm_values.
DO 5 TIMES.
n = p_demo1 * 10 + sy-index.
IF sy-index = 1.
p_demo2 = n.
ENDIF.
wa_value-key = n.
CONCATENATE 'Beschreibung' n INTO wa_value-text.
APPEND wa_value TO vrm_values.
ENDDO.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = vrm_id
values = vrm_values
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
CLEAR ok_code.
ENDMODULE. " fill_lb OUTPUT
Code: Alles auswählen.
PROCESS BEFORE OUTPUT.
MODULE fill_lb.
*
PROCESS AFTER INPUT.
MODULE user_command_9000.