cancel
Showing results for 
Search instead for 
Did you mean: 

Object instantiation in Webdynpro

Former Member
0 Kudos

Hi experts,

I am trying to understand one particular point in this code Below:

This code is typed in WDDOINIT method of a mainvue:

  data:   node_sflight type ref to if_wd_context_node,

            itab_sflight type standard table of sflight.

   select * from sflight into table itab_sflight.

 

     node_sflight = wd_Context->get_Child_Node( Name = `SFLIGHT_NODE` ).

     node_sflight->Bind_Table( itab_sflight ).




So my question is how the object node_sflight is instantiated ?


for me node_sflight type ref to if_wd_context_node is not an instance of the object node_sflight, it only references the interface if_wd_context_node, and this interface is implemented by  many classes and among the  the context class.

I went through get_Child_Node( Name = `SFLIGHT_NODE` ) to see if any instance of my object node_sfligh is done here, but I didn't find anything.


it will be awesome If you have any explanation on this, or any link that would allow me to understand how the standard programs behind the webdynpro instantiate the elements of the context of a view when they are declared  with type ref to an interface.


In hope that my question is understandable.





Many thanks






Message was edited by: rachid Atache

Message was edited by: rachid Atache

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

The attribute WD_CONTEXT is a reference variable of type IF_WD_CONTEXT_NODE. This attribute technically refers to the root node of the context of the controller. There are several methods available in this interface, which are used to edit the data held by context nodes.

For example:

■GET_CHILD_NODE – this method retrieves a specific child node.

■GET_ATTRIBUTE – this method retrieves the value of a context attribute.

■BIND_TABLE – This method binds an internal table to a context node.

By using GET_CHILD_NODE method of the attribute WD_CONTEXT  we instantiate the node.

Thanks

KH

Answers (0)