on 11-11-2008 12:34 PM
I am using an ALV table. Through the following piece of code out of 5 fields i am making the 2 fields as dropdown. My requirement is if we select an entry on the first drop-down, the values for the second dropdown should get fetched from the selected first drop down.
Here is the piece of code that i used to make the field as dropdown.
lr_column_settings ?= l_value.
lr_column = lr_column_settings->get_column( 'ACTY_TYP' ).
CREATE OBJECT lr_drop_down
EXPORTING
selected_key_fieldname = 'ACTY_TYP'.
lr_column->set_cell_editor( lr_drop_down ).
Any Updates ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Manjunath,
I tried embedding 2 dropdowns of type CL_SALV_WD_UIE_DROPDOWN_BY_KEY into my ALV for columns TEMP & TEMP_NEW. Depending up on the value selected in TEMP the TEMP_NEW should get populated. You will have to take care of this functionality by writing an event handler method for the ON_DATA_CHECK event. You would have to first call the data_check method of the ALV component. This method checks if any data has changed in the ALV and then triggers the ON_DATA_CHECK event if it finds that something has changed in the ALV. So you should code your logic in this event handler method for updating TEMP_NEW based up on the selection in TEMP.
So I go to the WDDOAFTERACTION method of my view & call this DATA_CHECK method to try find out if any of my data in the ALV has changed.
method WDDOAFTERACTION .
DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
lo_interfacecontroller = wd_this->wd_cpifc_alv( ).
lo_interfacecontroller->data_check( ).
endmethod.
If the user had selected a value from the dropdown then the data would get changed and then the ON_DATA_CHECK event would be triggered by the system. So now our event handler method for this event would get executed. Since am making use of an dropdownbykey the the data stored in the context element at lead selection will be overwritten by the key value related to the selected data. So I can just use the wizard to read the value of attribute TEMP & would get the value selected by the user within the dropdown.
Now here you can code your own logic to populate TEMP_NEW differently for different values in TEMP. You can use the SET_ATTRIBUTE_VALUE_SET method of IF_WD_CONTEXT_NODE_INFO for defining the value set for TEMP_NEW. Hope that this helps resolve your problem.
Regards,
Uday
UPD: Hi Manjunath is your problem solved or is it still pending?
Edited by: Uday Gubbala on Nov 14, 2008 11:48 AM
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.