Skip to Content
author's profile photo Former Member
Former Member

WD_CONTEXT&CHILD_NODE

Hi all,

In view, we can see WD_CONTEXT which is TYPE REF TO IF_WD_CONTEXT_NODE.

In IF_WD_CONTEXT_NODE-GET_CHILD_NODE, we can see parameter CHILD_NODE is also TYPE REF TO IF_WD_CONTEXT_NODE.

I tried to use WD_CONTEXT directly when I want to get the value of the element like WD_CONTEXT->GET_CHILD_NODE(but this is wrong).

Could anyone tell me what exactly is WD_CONTEXT&CHILD_NODE?

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 09, 2014 at 10:53 AM

    Hi,

    The WD_CONTEXT attribute is a reference to the root node of the context of the controller. Regardless of the edited controller, it is always a reference variable of the type IF_WD_CONTEXT_NODE.

    You can use WD_CONTEXT and the interface methods to edit the content of a

    context node in your controller method.

    Ex:- The controller context contains the MY_NODE1 node.

    data: TABLE_NODE type ref to IF_WD_CONTEXT_NODE.

    TABLE_NODE = WD_CONTEXT->GET_CHILD_NODE( 'MY_NODE1').

    Hope this helps you.Pls revert for further clarifications.

    Thanks

    KH

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Ramakrishnappa Gangappa

      Hi, I have checked the code of 'CL_WDR_CONTEXT_ELEMENT' in which 'IF_WD_CONTEXT_ELEMENT' is defined.

      It seems that when you create a node like 'NODE1' in the view.

      Based on code, the system creates a node object, this object has two parameters which are node name and node object reference(meanly it's address). They are appended to an internal table.

      When you use GET_CHILD_NODE, the system will search the internal table and find the object reference according to the node name.

      And no matter at which level the nodes are, they are not allowed to have the same name.

      It means that you cannot define a NODE1 under a NODE1. I think that based on the source code, the nodes do not have levels.

  • author's profile photo Former Member
    Former Member
    Posted on Dec 09, 2014 at 09:41 AM

    wd_context is just a reference to you ROOT node

    If you have attributes directly in root - context (without any node) you can get These values wie wd_context->get_attribute

    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.