Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Accessing Deeply Nested Value

Former Member
0 Likes
440

Thread followed on from [here|;

Hi Folks,

Following on from a thread I started in the SRM forum, I now have access to a very deeply nested variable see [this|http://img59.imageshack.us/i/variable.png/] image for path.

How can I change the value in this variable using OO code?

All help is much appreciate,

Colm

2 REPLIES 2
Read only

uwe_schieferstein
Active Contributor
0 Likes
403

Hello Colm

Do you have access to the instance (of TYPE REF TO cl_wdr_context_element)?

If so then you may try to call its method IF_WD_CONTEXT_ELEMENT~SET_ATTRIBUTE.

Regards

Uwe

Read only

Former Member
0 Likes
403

Uwe,

I did not have access to that particular instance but I was able to use your help to find the values that I needed to change. I needed to create a post-exit enhancement on my WDDOINIT method and implement the following code. Thank you very much.


  DATA: lo_wd_child_node      TYPE REF TO if_wd_context_node,
        lo_root_node          TYPE REF TO if_wd_context_node,
        lo_context            TYPE REF TO if_wd_context.

  lo_context      = wd_context->get_context( ).
  lo_root_node    = lo_context->root_node.

  lo_wd_child_node = lo_root_node->get_child_node( name = 'ACTIVE' ).
  lo_wd_child_node->set_attribute( EXPORTING name  = 'ACTIVE_LOC'
                                             value = '02' ).

Edited by: Colm Gavin on Mar 9, 2011 12:46 PM