Pieter Rijlaarsdam
Read all my blogsiv_structure = [name of the structure the field is part of]
.
———————————————————-
If you want the dropdown listbox to be occupied with values from a domain, you can use the following code:
———————————————————-
DATA:lt_ddlb TYPE bsp_wd_dropdown_table.
SELECT domvalue_l ddtext INTO TABLE lt_ddlb FROM dd07t WHERE
domname = [domain] AND ddlanguage = sy-langu.
INSERT INITIAL LINE INTO lt_ddlb INDEX 1.
SORT lt_ddlb BY value.
IF sy-subrc = 0.
CREATE OBJECT rv_valuehelp_descriptor TYPE cl_bsp_wd_valuehelp_pldescr
EXPORTING
iv_source_type = ‘T’
iv_selection_table = lt_ddlb.
ENDIF.
———————————————————-
The values from the valuehelp are determined when building the screen (do_prepare_output). This means, that if you want the available values to vary based on the contents of another field, you only have to trigger a roundtrip to the server (like raising a server event, which can be implemented in the get_p) when the contents of the field which it depends on are changed.
Furthermore, you will have to implement in the get_v of the field how the available values are filtered.