Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

WEB DYNPRO ABAP - QUERY

HI EXPERTS,

I HAVE A REQUIREMENT LIKE WHEN I SELECT A DATA FROM A DROP DOWN LIST IN A FIELD, THE CORRESPONDING VALUE SHOULD BE DISPLAYED IN THE NEXT FIELD IN A ALV TABLE. CAN ANY ONE GUIDE ME HOW TO DO THIS. OR SUPPORT ME WITH ANY ANY AVAILABLE SOLUTIONS. KINDLY HELP.

THANKS AND REGARDS,

VADIVU.

Former Member
Former Member replied

Hi vadiv,

Sorry for late reply.

You can go like this:---

1.Set drop down by key in the column which you want to display as drop down using

After instantiate ur alv component and using get model method,

lr_dropdown type ref to cl_salv_wd_uie_dropdown_by_key.

lv_value = lo_interfacecontroller->get_model( ).

lv_value->if_salv_wd_table_settings~set_read_only( abap_false ).

lr_column = lv_value->if_salv_wd_column_settings~get_column( id = 'Column_name' ).

create object lr_dropdown exporting selected_key_fieldname = 'Column_name'.

lr_column->set_cell_editor( lr_dropdown ).

call method lo_value->if_salv_wd_table_settings~set_cell_action_event_enabled

exporting

value = ABAP_TRUE .

2. Set values in the particular attribute by using SET_ATTRIBUTE_VALUE_SET.

DATA: LT_VALUESET TYPE STANDARD TABLE OF WDR_CONTEXT_ATTR_VALUE,

LS_VALUESET TYPE WDR_CONTEXT_ATTR_VALUE,

LR_NODE_INFO TYPE REF TO IF_WD_CONTEXT_NODE_INFO,

LR_NODE TYPE REF TO IF_WD_CONTEXT_NODE.

LR_NODE = WD_CONTEXT->GET_CHILD_NODE( 'node_name' ).

LR_NODE_INFO = LR_NODE->GET_NODE_INFO( ).

LT_VALUESET-VALUE = '0'.

LS_VALUESET-TEXT = '0'.

APPEND LS_EXTENSION TO LT_EXTENSION.

LS_VALUESET-VALUE = '1'.

LS_VALUESET-TEXT = '1'.

APPEND LS_VALUESET TO LT_VALUESET.

set values no of values for dropdown like this.

LR_NODE_INFO->SET_ATTRIBUTE_VALUE_SET(

EXPORTING

NAME = 'Column_name' "attribute name

VALUE_SET = LT_VALUESET ).

3.In methods create a event handler for ON_CELL_ACTION.

In that:-

DATA: INDEX_VALUE TYPE I.

INDEX_VALUE = R_PARAM->INDEX.

By using this index value you fetch the node by code wizard.

use like this:-

  • alternative access via index

lo_el_node_name = lo_nd_node_name->get_element( index = INDEX_VALUE ).

Fetch the particular value set in dropdown and the by using code wizard set it to the required field.

Your value will be displayed.

Hope this can resolve your issue.

Regards,

Monishankar C

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question