Skip to Content
avatar image
Former Member

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 15, 2011 at 11:42 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 14, 2011 at 04:32 AM

    hi,

    please specifuy the requirement ...for now

    i guess you can get that vaue when you read that node and den you can put the value in the wa and then append it to the table.....do the coding in modify view so that the thing gets refreshed everytime

    regards,

    sahai.s

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 14, 2011 at 06:08 AM

    Hi vadiv,

    Go like this:-

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

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

    3. There is a event handler like ' ON_CELL_ACTION' which will be triggered when you select particular value in drop down. GO to the event handler and get the value. Also get the index_value to identify the row.

    In the event handler bind the value with the required attribute and then bind with context node.

    Now whenever you set some value in drop down , it will be displayed in the required field in alv.

    Reply if you need any coding reference.

    Regards,

    Monishankar C

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 18, 2011 at 11:20 AM

    Hi vadiv,

    Sorry for late reply. But good to see that you have solved the error. Enjoy Web dynpro.

    All the best.

    Regards,

    Monishankar C

    Add comment
    10|10000 characters needed characters exceeded