on 06-25-2014 1:11 PM
Hi guys..
I have requirement like add two drop down elements in a table. And second drop down list of values dependent on first drop down element.
example: if i take ekpo table i will make PO number and item number fields as dropdown elements. And Once PO number selected from first dropdown list
second dropdown list should consist item numbers of selected PO. After selecting both the values remaining fields will get displayed based on input.
Can anyone suggest please the way of doing it.
thanks in advance...
First you need to read the row in which you want to change the DD value. this can be done using following code.
DATA lv_index type i.
lr_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
lv_index = lr_element->get_index( ).
READ TABLE itab INTO wa INDEX lv_index.
...
now read the value of 1st dd, and change the value in 2nd DD and modify the itab.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Uma,
For normal table.
1) You can write code in OnSelect event of that dropdown column as shown below.
For more information, you can refer the below document
For ALV Table,
1) For the particular column, you need to enable the cell action as shown below.
LOOP AT lt_columns ASSIGNING <fs_column>.
CASE <fs_column>-id.
WHEN '<your column>'.
CALL METHOD lv_value->if_salv_wd_column_settings~get_column
EXPORTING
id = <coumn name>
RECEIVING
value = lo_system_select_hdr.
DATA lo_dropdown TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
CREATE OBJECT lo_dropdown
EXPORTING
selected_key_fieldname = <fs_column>-id.
lo_dropdown->set_state( cl_wd_abstract_input_field=>e_state-required ).
lo_dropdown->set_read_only_fieldname( value = 'READONLY' ).
lo_dropdown->set_selected_key_fieldname( <fs_column>-id ).
<fs_column>-r_column->set_cell_editor( lo_dropdown ).
lv_value->if_salv_wd_table_settings~set_cell_action_event_enabled( abap_true ).
ENDLOOP.
and you can write the code in onselect event
Hope this helps you.
Thanks
KH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry Uma, The dynamic dropdown (second dropdown) in my example is dependent on one of the fields not the first dropdown. But since every record can have a different list, this is still relevant to your question.
probabaly you need to play around in the wddomodify method, when the first dropdown changes, you populate the context node of the second dropdown list.
Cheers again,
Tashi
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.