Skip to Content

Fill dropdown list with data from table

Hi,

I am havin a problem on how to fill a dropdown list with the data from a table that I created

Can anybody help me

Thanks,

Dren Selimi

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Jan 08, 2014 at 09:53 AM

    Hi

    After adding code in get_P method of attribute,you can check the following code for dropdown used in V method filling value from table.And modify according to your requirement.

    check SAP CRM 7.0: How-to Guide Dropdown Boxes

    METHOD get_v_category.
    DATA: lt_act_catgor TYPE STANDARD TABLE OF crmc_act_cat_t.
    DATA: ls_act_catgor LIKE LINE OF lt_act_catgor.
    DATA: lt_ddlb TYPE bsp_wd_dropdown_table,
    lv_value TYPE char80,

    ls_ddlb TYPE bsp_wd_dropdown_line,
    lv_display_only TYPE string,
    gr_dropdown TYPE REF TO cl_crm_uiu_ddlb,
    ls_values TYPE LINE OF vrm_values.
    SELECT * FROM crmc_act_cat_t INTO CORRESPONDING FIELDS OF TABLE lt_act_catgor WHERE langu = 'E'.
    DELETE ADJACENT DUPLICATES FROM lt_act_catgor.
    LOOP AT lt_act_catgor INTO ls_act_catgor.
    CONCATENATE ls_act_catgor-category ls_act_catgor- description INTO lv_value SEPARATED BY ' ' .
    ls_ddlb-key = lv_value."sy-tabix.
    CONDENSE ls_ddlb-key.
    ls_ddlb-value = lv_value.
    APPEND ls_ddlb TO lt_ddlb.
    CLEAR ls_ddlb.
    ENDLOOP.
    IF gr_dropdown IS NOT BOUND.
    FREE gr_dropdown.
    CREATE OBJECT gr_dropdown
    EXPORTING
    iv_source_type = 'T'.
    INSERT INITIAL LINE INTO lt_ddlb INDEX 1.
    IF sy-subrc = 0.
    gr_dropdown>set_selection_table( it_selection_table = lt_ddl b ).
    ENDIF.
    ENDIF.
    rv_valuehelp_descriptor = gr_dropdown.
    ENDMETHOD.

    Regards,

    @Harish Kumar

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.