cancel
Showing results for 
Search instead for 
Did you mean: 

context node

Former Member
0 Kudos

hi

i have a master node and the master node in child node

i want to attain this child node for bind a internal table on a supply function

i use code wizard but error message : mainView.child absent on this page. . ..

my code :

Node_sflight = wd_Context->get_Child_Node( Name = 'lo_nd_child' ). -->error row

Node_sflight->Bind_Table( gt_tab ).

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

uday_gubbala2
Active Contributor
0 Kudos

Hi Mesut,

I see that you are trying to get the reference of a node for binding some data to it. I see 2 things here.

1) You have mentioned your node name in lower case.

2) You seem to be passing some object reference to it by the way you have named your node starting with "lo"

You should always pass your node name in upper case like:

Node_sflight = wd_Context->get_Child_Node( Name = 'NODE1' ).

For every node you create in the context of a controller, a constant with the name WDCTX_<node name> is automatically created in the corresponding interface IG_<Controller_Name> and IF_<Controller_Name>. In the program source code for the controller, this constant can then be used instead of a string literal for the node name by using the reference to the local controller interface (WD_THIS attribute). Example:

wd_context->get_child_node( wd_this->wdctx_node_1 ).

instead of

wd_context->get_child_node( 'NODE_1' ).

The advantage of using constants is that the compiler knows the constant and, therefore, syntax errors are reported if the name of the context node contains typing errors. However, it is also possible to pass a string literal.

Regards,

Uday

Former Member
0 Kudos

hi

this link my context type

[http://menstasarim.com/mmesut/res/state.jpg]

method fill_kirilim

data: gt_tab TYPE if_componentcontroller=>elements_KIRILIM,

gs_tab TYPE LINE OF if_componentcontroller=>elements_KIRILIM.

SELECT * INTO CORRESPONDING FIELDS OF gs_tab FROM zmstPA01.

gs_tab-nam = gs_tab-nam+2(5).

APPEND gs_tab to gt_tab.

ENDSELECT.

i add with code wizard

DATA lo_nd_root TYPE REF TO if_wd_context_node.

DATA lo_nd_mastern TYPE REF TO if_wd_context_node.

DATA lo_nd_child TYPE REF TO if_wd_context_node.

DATA lo_el_child TYPE REF TO if_wd_context_element.

DATA ls_child TYPE wd_this->element_child.

  • navigate from <CONTEXT> to <ROOT> via lead selection

lo_nd_root = wd_context->get_child_node( name = wd_this->wdctx_root ).

  • navigate from <ROOT> to <MASTERN> via lead selection

lo_nd_mastern = lo_nd_root->get_child_node( name =

wd_this->wdctx_mastern ).

  • navigate from <MASTERN> to <CHILD> via lead selection

lo_nd_child = lo_nd_mastern->get_child_node( name =

wd_this->wdctx_child ).

  • @TODO handle not set lead selection

IF lo_nd_child IS INITIAL.

ENDIF.

  • get element via lead selection

lo_el_child = lo_nd_child->get_element( ).

  • @TODO handle not set lead selection

IF lo_el_child IS INITIAL.

ENDIF.

wd_context->get_child_node( wd_this->wdctx_ lo_nd_child ).

Node_sflight = wd_Context->get_Child_Node( Name = 'LO_ND_CHILD' ).

Node_sflight->Bind_Table( GT_TAB ).

endmethod .

uday_gubbala2
Active Contributor
0 Kudos

Hi,

Can u send me the snapshot to the id mentioned in my business card? The URL that you have posted is blocked by my companies network security team. Also specify the line of your code in which you are getting the error message.

Regards,

Uday

uday_gubbala2
Active Contributor
0 Kudos

Hi,

I have replied back to your mail with the resolution. Just check it out & let me know if you still have any problems.

Regards,

Uday

Former Member
0 Kudos

Hi,

use PATH_GET_NODE of if_wd_context_node to get the reference of child node.Check the article which i posted in my previous reply there you can find the example coding also.I hope this will solve your problem.

Answers (2)

Answers (2)

Former Member
0 Kudos

my code :

Node_sflight = wd_Context->get_Child_Node( Name = 'LO_ND_CHILD'' ). --> IT SHOULD BE IN CAPS.

Node_sflight->Bind_Table( gt_tab ).

Former Member
0 Kudos

Hi Mesut,

Your question is not clear.What exactly you want to do,in which context node(master or child )supply function you want to bind the internal table.

Check this article about Context node in detail.You can also find about the supply fnction htps://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60730016-dbba-2a10-8f96-9754a865b814