Skip to Content
author's profile photo Former Member
Former Member

Web dynpro Abap - Select options

Hello Expert.

This problem I'm facing should not be to hard (So I thought) I want to add values to an existing select option.

Got a component that creates a number of select options (WDDOINIT).

Standard procedure:

l_ref_cmp_usage = wd_this->wd_cpuse_s_opt( ).

IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.

l_ref_cmp_usage->create_component( ).


wd_this->m_wd_select_options = wd_this->wd_cpifc_s_opt( ).

wd_this->m_handler = wd_this->m_wd_select_options->init_selection_screen( ).


i_display_btn_cancel = abap_false

i_display_btn_check = abap_false

i_display_btn_reset = abap_false

i_display_btn_execute = abap_false ).

lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'CRMT_ORDERED_PROD' ).

wd_this->m_handler->add_selection_field( i_id = 'PRODUKT' it_result = lt_range_table i_read_only = abap_false i_description = 'Produkt' i_no_intervals = abap_true ).

So far so good (I can values here in lt_range_table, but the values are not know before later in the process).

Based on another process later on I wish to change the entered values in the select option.

I've tried:


set_range_table_of_sel_field( i_id = 'PRODUKT' it_range_table = ld_data ).

SET_VALUE_OF_PARAMETER_FIELD( i_id = 'PRODUKT' i_value = ld_data ).

In various combinations but it always results in a short dump.

Any idéas?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jan 10, 2014 at 02:07 PM

    Hi Johan,

    You can change the value selection field, follow the below steps

    • Call the method GET_RANGE_TABLE_OF_SEL_FIELD , here pass your selection field name and receive data rt_produkt
    • assign this data into field symbol and change the data as per your requirement
    • Set the range table back to selection field by using method SET_RANGE_TABLE_OF_SEL_FIELD
    • To, reset selection field, use RESET_SELECTION_FIELD


    data: node type ref to if_wd_context_node.

    data: rt_produkt type ref to data. (field that you need to assign for select option)

    field-symbols: <fs_produkt_t> type table,

    <fs_produkt_s> type any. (field symbol to get the data)

    * retrieve the data from the select option

    rt_produkt =

    wd_this->m_handler->get_range_table_of_sel_field( i_id = 'produkt' ).

    * assign it to a field symbol

    assign rt_produkt->* to <fs_produkt_t>.

    loop at <fs_produkt_t> assigning <fs_produkt_s>.

    assign component 'low' of structure <fs_produkt_s> to <fs_value>.

    if <fs_value> is assigned.

    <fs_value> = “ 'your value here '.



    “set updated range table



    id = 'produkt'

    it_range_table = rt_produkt ).

    Hope this helps you.



    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.