Code: Alles auswählen.
clear wa_fkat.
wa_fkat-fieldname = 'NUMMER'.
wa_fkat-ref_field = 'NUMMER'.
wa_fkat-ref_table = 'Z_TEST'.
insert wa_fkat into table itab_fkat.
clear wa_fkat.
wa_fkat-fieldname = 'WERT'.
wa_fkat-ref_field = 'WERT'.
wa_fkat-OUTPUTLEN = '20'.
wa_fkat-drdn_hndl = '1'.
wa_fkat-drdn_alias = 'X'.
wa_fkat-ref_table = 'Z_TEST'.
wa_fkat-edit = 'X'.
insert wa_fkat into table itab_fkat.
clear wa_fkat.
wa_fkat-fieldname = 'WERT2'.
wa_fkat-ref_field = 'WERT2'.
wa_fkat-edit = 'X'.
wa_fkat-ref_table = 'Z_TEST'.
insert wa_fkat into table itab_fkat.
ls_dropdown-handle = '1'.
ls_dropdown-value = 'LEVEL 1 = 77'.
ls_dropdown-int_value = '77'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-value = 'LEVEL 2 = 99'.
ls_dropdown-INT_VALUE = '99'.
APPEND ls_dropdown TO lt_dropdown.
endif.
CREATE OBJECT R_ALV
EXPORTING
* I_SHELLSTYLE = 0
* I_LIFETIME =
I_PARENT = r_cont.
CALL METHOD R_ALV->set_drop_down_table
EXPORTING
it_drop_down_alias = lt_dropdown.
CALL METHOD R_ALV->SET_TABLE_FOR_FIRST_DISPLAY
CHANGING
IT_OUTTAB = itab_werte
IT_FIELDCATALOG = itab_fkat.
Code: Alles auswählen.
MODULE USER_COMMAND_0100 INPUT.
CALL METHOD R_ALV->CHECK_CHANGED_DATA.
if sy-ucomm = 'SAVE'.
MODIFY z_test from table itab_werte.
ENDIF.
ENDMODULE.