on 08-03-2007 8:48 AM
Hi,
After facing issue in:
Now I've encountered another problem. Dropdown is created in alv, however once user select value from the list it shows selected value in the cell, however value in context remains unchanged.
Here is the way I implemented dropdown:
1) I added new field to the structure which is shown in the alv FIELD1 of WDR_CONTEXT_ATTR_VALUE_LIST type.
2) I initialize the column, where dropdown is supposed to be:
- first column
l_col_name = 'COL1'.
lr_column = lr_model->if_salv_wd_column_settings~get_column( l_col_name ).
DATA: lr_drdn_by_idx_col1 TYPE REF TO cl_salv_wd_uie_dropdown_by_idx.
CREATE OBJECT lr_drdn_by_idx_col1 EXPORTING selected_key_fieldname = l_col_name.
lr_drdn_by_idx_col1->set_valueset_fieldname( value = 'FIELD1' ).
lr_drdn_by_idx_col1->set_read_only( value = abap_false ).
lr_drdn_by_idx_col1->set_type( if_salv_wd_c_uie_drdn_by_index=>type_key_value ).
lr_column->set_cell_editor( lr_drdn_by_idx_col1 ).
3) I load the data,
Piece of code loading data into structure with dropdown:
DATA: ls_valueset TYPE wdr_context_attr_value,
lt_itab LIKE TABLE OF ls_line.
ls_valueset-value = 'KG'.
ls_valueset-text = 'KG'.
APPEND ls_valueset TO lt_itab[].
ls_valueset-value = 'ST'.
ls_valueset-text = 'ST'.
APPEND ls_valueset TO lt_itab[].
zstructure is type of the row show in the alv
Data:
ls_po_result TYPE zstructure.
lt_po_result TYPE table of zstructure.
...
ls_po_result-FIELD1[] = lt_itab[].
....
APPEND ls_po_result TO lt_po_result[].
Everything works so far good. The thing is that once I changed value from e.g. ST to KG, value in Attribute COL1 is still ST.
I would appreciate your help,
kind regards,
Adam
Hi,
it seems that after update with note 1013587 all dropdown-issues has been fixed
regards,
Adam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Adam,
In the loading the values part, where are you binding the value set to the context attribute FIELD1? I do not see it in your code.
Otherwise, your code looks fine, and as I mentioned in the previous thread, this works for me. Could it be yet another issue with the SP that you are in?
Regards
Nithya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nithya,
it could another issue with the SP, I will inform you if it's the case.
Passing values comes up with function when I load data into alv.
structure_name - alv columns structure
DATA: l_name1 TYPE t001w-name1,
ls_po_result TYPE structure_name
lt_po_result TYPE table of structure_name,
load data from DB into l_itab
....
LOOP l_itab AT ASSIGNING item.
this method return value_set to field1
CALL METHOD fill_single_dd
EXPORTING
i_id = item-id
IMPORTING
rt_dd_table = ls_po_result-field1[].
APPEND ls_po_result TO lt_po_result[].
ENDLOOP.
binding to node ....
Hi Adam.
I guess the problem is with the selected key name:
CREATE OBJECT lr_drdn_by_idx_col1 EXPORTING selected_key_fieldname = l_col_name.
You have to set it to the name of the attribute the column is bound to. FIELD1 ???
Furthermore do not use the brackets []. These are not necessary.
Cheers,
Sascha
Message was edited by:
Sascha Dingeldey
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sascha,
thanks for your reply.
FIELD1 contains list of values for dropdown.
COL1 is column where the dropdown should be shown and where the values from dropdown should be passed to.
Both are attributes of the same node.
In this case Is it correct?
CREATE OBJECT lr_drdn_by_idx_col1 EXPORTING selected_key_fieldname = 'COL1'.
lr_drdn_by_idx_col1->set_valueset_fieldname( value = 'FIELD1' ).
regards,
Adam
User | Count |
---|---|
91 | |
10 | |
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.