Hi,
Can u check your below code from this above code..... and let me know any issue.
if you have a domain entries then u can create and write code in GET_V_*
DATA : lt_domain_entries TYPE STANDARD TABLE OF dd07v, lt_sel_table TYPE bsp_wd_dropdown_table, ls_sel_table TYPE LINE OF bsp_wd_dropdown_table, gr_ddlb_type TYPE REF TO cl_crm_uiu_ddlb. FIELD-SYMBOLS : <domain> TYPE dd07v. CALL FUNCTION 'DD_DOMVALUES_GET' EXPORTING "Here we pass domain of the field to get possible entries domname = 'ZDTEL00001E' text = 'X' langu = sy-langu TABLES dd07v_tab = lt_domain_entries EXCEPTIONS wrong_textflag = 1 OTHERS = 2. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ELSE. APPEND INITIAL LINE TO lt_sel_table. LOOP AT lt_domain_entries ASSIGNING <domain>. ls_sel_table-key = <domain>-domvalue_l. ls_sel_table-value = <domain>-ddtext. APPEND ls_sel_table TO lt_sel_table. CLEAR ls_sel_table. ENDLOOP. ENDIF. IF gr_ddlb_type IS NOT BOUND. CREATE OBJECT gr_ddlb_type EXPORTING iv_source_type = 'T'. gr_ddlb_type->set_selection_table( it_selection_table = lt_sel_table ). rv_valuehelp_descriptor = gr_ddlb_type. ENDIF. |
But If have specific Zcustom table then u can write code as below to get data in drop down.
data: rr_value_help type ref to cl_crm_uiu_ddlb. data: lt_data type bsp_wd_dropdown_table, ls_data type bsp_wd_dropdown_line. data: lt_wv_rsn type table of ztsl_mc_rs, ls_wv_rsn type ztsl_mc_rs. select * from ztsl_mc_rs into corresponding fields of table lt_wv_rsn where langu = sy-langu. * Fill Dropdown with Blank row append initial line to lt_data. loop at lt_wv_rsn into ls_wv_rsn. ls_data-key = ls_wv_rsn-wr_key. ls_data-value = ls_wv_rsn-w_desc. append ls_data to lt_data. endloop. * Return the dropdown values create object rr_value_help exporting iv_source_type = 'T'. rr_value_help->set_selection_table( it_selection_table = lt_data ). rv_valuehelp_descriptor = rr_value_help. |
Regards, Sumeet |