Skip to Content
avatar image
Former Member

dynamic drop down list

Hi all,

I have a alv table with 2 fields. the 1st column is non editable and the 2nd column is a drop down. The value for the 1st column is already being displayed at the time of execution itself. I want a drop down in the 2 nd column which should hold values matching its corresponding row. I used a ONCLICK event and wrote the below code. But my drop down is still empty. When i debugged i found my ONCLICK event is not called.Can any one guide me what correct event i should use or if any changes i need to do in my code to solve this issue please.

DATA: LR_NODE_INFO TYPE REF TO IF_WD_CONTEXT_NODE_INFO,

LR_NODE TYPE REF TO IF_WD_CONTEXT_NODE.

DATA LO_ND_ASSESSTMENT TYPE REF TO IF_WD_CONTEXT_NODE.

DATA: LT1_VALUESET TYPE TABLE OF WDR_CONTEXT_ATTR_VALUE,

LS1_VALUESET TYPE WDR_CONTEXT_ATTR_VALUE.

data : lt_weight type STANDARD TABLE OF zest_weight,

ls_weight like LINE OF lt_weight.

Data: context_node type ref to if_wd_context_node.

data: ld_element type ref to if_wd_context_element.

context_node = wd_context->get_child_node( name = 'ASSESSTMENT').

ld_element = context_node->get_lead_selection( ).

if not ld_element is INITIAL.

ld_element->get_static_attributes( IMPORTING

static_attributes = ls_weight ).

endif.

select * from zest_weight into table lt_weight where levels = ls_weight-activity.

LOOP AT LT_WEIGHT INTO LS_WEIGHT.

LS1_VALUESET-VALUE = LS_WEIGHT-ACTIVITY.

LS1_VALUESET-TEXT = LS_WEIGHT-ACTIVITY.

APPEND LS1_VALUESET TO LT1_VALUESET.

ENDLOOP.

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

LR_NODE_INFO = LR_NODE->GET_NODE_INFO( ).

LR_NODE_INFO->SET_ATTRIBUTE_VALUE_SET(

EXPORTING

NAME = 'ASSESSMENT'

VALUE_SET = LT1_VALUESET ).

Thanks in advance,

vadivu.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    May 25, 2011 at 08:06 PM

    It is not clear what you are trying to do.

    what you do to trigger onCLICK event ?. Do you have any Linkto Action/URL like that in any of the columns . If not you may have to explain your design how you want to trigger the round trip. You can consider on lead select or on enter of an input field etc.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Sarbjeet Singh

      Oh Sabarjeet dont know what to say. I am so grateful to you. You have solved my problem and it is working fine now. Dont have words to say.Thanks a lot thanks a lot.

  • May 26, 2011 at 04:07 AM

    Hi.,

    Instead of

    >

    > LR_NODE_INFO->SET_ATTRIBUTE_VALUE_SET(

    > EXPORTING

    > NAME = 'ASSESSMENT'

    > VALUE_SET = LT1_VALUESET ).

    > .

    try using bind_table.

    LR_NODE->bind_table(  LT1_VALUESET ).

    hope this may helps u.,

    Thanks & Regards,

    Kiran

    Add comment
    10|10000 characters needed characters exceeded