Dropdown List ( Combobox) Örneği II
ID ve Metin belirterek aşağıdaki rutini kullanabilirsiniz.
data: gt_val_calisan type vrm_values .
data: begin of gt_calisan OCCURS 0,
CALISAN_TIPI type i,
CALISAN_TIPI_T type text40,
END OF gt_calisan.
form f_set_vrm_combo.
perform f_fill_combobox using gt_calisan `CALISAN_TIPI` `CALISAN_TIPI_T` `GS_R-CALISAN_TIPI` changing gt_val_calisan.
endform. "f_set_vrm_combo
form f_fill_combobox
using prt_kaynak type any table
prm_id type feldnm
prm_text type feldnm
prm_object type vrm_id
changing chn_values type vrm_values.
data: ls_value type vrm_value.
field-symbols: <fs_row> type any.
field-symbols: <fs_field_id> type any.
field-symbols: <fs_field_text> type any.
refresh chn_values.
loop at prt_kaynak assigning <fs_row>.
assign component prm_id of structure <fs_row> to <fs_field_id>. check sy-subrc eq 0.
assign component prm_text of structure <fs_row> to <fs_field_text>. check sy-subrc eq 0.
ls_value-key = <fs_field_id>.
ls_value-text = <fs_field_text>.
append ls_value to chn_values.
endloop.
data: vrm_id type vrm_id.
vrm_id = prm_object.
call function `VRM_SET_VALUES`
exporting
id = vrm_id "`GS_YENI_SIRA-NEW_MASTER-PLNAL`
values = chn_values
exceptions
id_illegal_name = 1
others = 2.
endform. " f_fill_combobox
module status_0100 output.
SET PF-STATUS `0100`.
PERFORM f_set_vrm_combo.
endmodule. " STATUS_0100 OUTPUT