Skip to Content
avatar image
Former Member

Values for dynamically created attributes not being displayed in ALV

Hi experts,

I have created a Web Dynpro application where the user enters a range of months, and certain cash amounts are displayed in each month in an ALV based on a set of predefined criteria. To create these months, I created a node, and to this node I added the dynamic attributes as shown below.

LOOP AT lt_dates INTO lv_date.

alv_node_info = alv_node->get_node_info( ).

"GET THE NAME OF THE COLUMN BASED ON THE BUSINESS RULES

lv_name = zcl_dpr_shared=>get_date_name( lv_date ).

attr_info-name = lv_name.

attr_info-type_name = 'NUMC15'.

alv_node_info->add_attribute( attr_info ).

ENDLOOP.

This piece of code works. I then add elements of this type to the alv_node as follows

lr_alv_data_elem = lr_node->create_element( ).

......

lr_alv_data_elem->set_attribute( name = 'lv_name'

value = lv_amount ).

.....

lr_alv_data_elem->set_attribute( name = lv_date_name

value = lv_amount ).

The node has already been bounded to the ALV, and all the static attributes are displayed, but not the dynamic attributes

Any idea why?

Thanks in advance

Johan Kriek

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Oct 13, 2008 at 07:40 AM

    Hi Johan,

    After setting attribute values you have to bind the newly created element to the node.

    Do this and ur problem will be solved.

    alv_node->bin_element(

    new_item = lr_alv_data_elem

    set_initial_elements = abap_false).

    Regards,

    Sumit Oberoi

    Add comment
    10|10000 characters needed characters exceeded