cancel
Showing results for 
Search instead for 
Did you mean: 

Webdynpro ALV Dropdown Values

Former Member
0 Kudos

Hi,

I have an ABAP webdynpro ALV grid lay out which has all editable columns. Some of the columns have drop down values . I have written the below code to display the dropdown values but these are only obtained when the Domain have values range. I am looking to display the drop down values which have value table with description under the dropdown which are sap standard data elements having search help key and value desc. Any sample code is very helpfull.

DATA ddlb TYPE REF TO cl_salv_wd_uie_dropdown_by_key.

*Set the dropdown columns for the ALV Grid

l_column = l_table->if_salv_wd_column_settings~get_column( 'TEST' ).

CREATE OBJECT ddlb

EXPORTING

selected_key_fieldname = 'TEST'.

ddlb->set_read_only( abap_false ).

l_column->set_cell_editor( ddlb ).

Thanks,

Vind

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Vind,

I came across the same problem, as you are facing now. For that you need the use the following coding, where you have written the coding for ALV and not in the drop down fill area.

DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .

DATA lr_node type ref to If_Wd_Context_Node.

lr_node is the node, which holds the value of the drop down.

lo_interfacecontroller = wd_this->wd_cpifc_alv_transfer_hist( ). "

You have to set the data of the node to your intereface controller as below:

lo_interfacecontroller->set_data(

r_node_data = lr_node type ).

Hope this helps.

Regards,

Krishnan

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

If you need something beyond the range values, then you need to fill the Context Node Info Object ValueSet.

It is also possible to determine the value set yourself and to set up the list dynamically (also refer to Fixed Values of Attributes):

IF_WD_CONTEXT_NODE_INFO=>SET_ATTRIBUTE_VALUE_SET

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/bb/69b441b0133531e10000000a155106/frameset.htm

Former Member
0 Kudos

Hi Thomas,

I have written the following code as per your adivse but not able to get the actual drop drow column in the editable ALV grid. Could you pls suggest me if am doing any thing wrong.

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 XYYYYYY .

lr_node = wd_context->get_child_node( 'CREATE' ).

lr_nodeinfo = lr_node->get_node_info( ).

SELECT * FROM XYYYYYY INTO WA.

ls_valueset-value = wa-value. " actual values

ls_valueset-text = wa-text. " text displaying on the dropdown

append ls_valueset to lt_valueset.

ENDSELECT.

lr_nodeinfo->set_attribute_value_set(

exporting

name = 'SOURCE' "ALV COLUMN

value_set = lt_valueset ).

Regards,

Vind

Former Member
0 Kudos

hi,Vind.

Your coding and the solution Thomas suggested, all are right.

One more thing:

Did you have really defined your ALV column(which your context attribute "SOURCE" is bound to) as "Dropdown by key", the context attibute must be the same, however you used "TEST" and "Source" differently, i am sure you must know it..

In addition , in order to display your Dropdownlist, you should make your ALV Table as editable. Pls, refer to the following:


CALL METHOD lr_table->IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY
    EXPORTING
      VALUE  = ABAP_false
      .

Hope it can help you a little.

Best wishes.