Skip to Content
author's profile photo Former Member
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 a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on 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 a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.