on 10-30-2008 7:29 PM
Hello experts,
I have a alv table in my web-dynpro and have made one
field to a dropdown field.
But how can I fill this dropdown field ?
Here my coding in order to make the field a dropdown field:
DATA :list_field TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
LOOP AT lt_columns INTO ls_column.
CASE ls_column-id.
WHEN 'CONCATSTATUSER'.
CREATE OBJECT list_field
EXPORTING
selected_key_fieldname = 'CONCATSTATUSER'.
ls_column-r_column->set_cell_editor( list_field ).
ENDCASE.
ENDLOOP.
I've read in other threads that i can use
mehtod set_selected_key_fieldname.
But how can I use this method ?
Has somebody an example ?
Thanks Gerd
Hi,
I've checked the coding but I do not understand
how to do the method.
This is what I do, but I still do not get some values in
the dropdown-field:
DATA lr_dropdown TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
LOOP AT lt_columns INTO ls_column.
CASE ls_column-id.
WHEN 'CONCATSTATUSER'.
CREATE OBJECT lr_dropdown
EXPORTING
selected_key_fieldname = 'CONCATSTATUSER'.
lr_dropdown->set_selected_key_fieldname( 'DRP_DWN_VALUES' ).
ENDCASE.
ENDLOOP.
Is there something wron or missing ?
Best regards
Gerd
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
problem is solved now.
I had to extend my output-structure with the field 'valueset',
and then I could fill it with the values for the dropdown.
That was the problem.
But it would be nice if someone of the experts could write
a small tutorial about this, so many user could do much
easier !
T H A N K S
Gerd
> I had to extend my output-structure with the field 'valueset',
> and then I could fill it with the values for the dropdown.
You shouldn't have had to do any such thing. You don't create an additional attribute for the valueset; you should create the valueset directly against the attribute that will hold you key value. If you had to create a new context node for the value set then it sounds like you are actually using DDLBbyIndex instead of DDLBbyKey.
>But it would be nice if someone of the experts could write
a small tutorial about this, so many user could do much
easier !
There is a tutorial already in the online help:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/bb/69b441b0133531e10000000a155106/frameset.htm
If you are using CL_SALV_WD_UIE_A_DRDN_BY_KEY as dropdown
use SET_SELECTED_KEY_FIELDNAME method to set the selected key property and fill the values using
data:
lr_node type ref to If_Wd_Context_Node.
data : lr_nodeinfo type ref to if_wd_context_node_info,
lt_valueset type wdr_context_attr_value_list,
ls_valueset type wdr_context_attr_value,
WA TYPE SPFLI.
lr_node = wd_context->get_child_node( 'node name' ).
lr_nodeinfo = lr_node->get_node_info( ).
* USE UR TABLE AND FILL ACCORDINGLY
SELECT * FROM SPFLI INTO WA.
ls_valueset-value = 'key1'. " actual values
ls_valueset-text = WA-CARRID. " text displaying on the dropdown
append ls_valueset to lt_valueset.
ENDSELECT.
lr_nodeinfo->set_attribute_value_set(
exporting
name = '<attribute name>'
value_set = lt_valueset
).
Hope it will work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.