on 03-01-2011 9:09 AM
I want create a new node in a Supply-Function and fill them with data.
It is possible to create the node,
cl_wd_dynamic_tool=>create_nodeinfo_from_struct(
parent_info = node_info
node_name = 'NODE_3'
structure_name = l_structure_name
is_multiple = abap_true
is_mandatory = abap_false ).
but I canu2019t get access to it.
l_cntx_nd_result = node->get_child_node( 'NODE_3' ).
(l_cntx_nd_result is initial)
Node_1 has already one Child-node u2018NODE_2u2019 created at Design time.
I also canu2019t get access to this node in the Supply-Function.
l_cntx_nd_result = node->get_child_node( 'NODE_2' ).
I get Access to the new Node (NODE_3) in the NODE_1-Action, but not in the Supply-Function.
Do I make any a mistake?
Thanks for Help.
It should fetch the child node.
can you post the complete code of ur supply function.
thanks
sarbjeet singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hallo sarbjeet singh,
thank you for your 1th answer, here the complete Supply-Function-code
DATA: lt_node_1 TYPE wd_this->Elements_node_1,
ls_node_1 LIKE LINE OF lt_node_1.
data: l_cntx_nd_info_self TYPE REF TO if_wd_context_node_info,
l_cntx_nd_result TYPE REF TO if_wd_context_node.
l_cntx_nd_info_self = node->get_node_info( ).
cl_wd_dynamic_tool=>create_nodeinfo_from_struct(
parent_info = l_cntx_nd_info_self
node_name = 'NODE_2'
structure_name = 'mystruct'
is_multiple = abap_true
is_mandatory = abap_false ).
"node->set_lead_selection( parent_element ).
l_cntx_nd_result = node->get_child_node( 'NODE_2' ).
" !!! l_cntx_nd_result is initial !!!
"fill node with data....
"...
"node->bind_table(...
" !!! l_cntx_nd_result is initial !!! suggest me that the cl_wd_dynamic_tool=>create_nodeinfo_from_struct did not create a child node.
You can try the following code ,which works for me. However i suspect now that the structure name is not correct.
If it is your local structure then i would have expected a Zmystruct, name space is also missing if it is a not a local object. So please check this out if your mystruct structure exists in DDIC.
lv_struct-name = 'mystruct'.
call method l_cntx_nd_info_self>add_new_child_node
exporting
* supply_method =
* supply_object =
* dispose_method =
* dispose_object =
static_element_type = lv_struct_name
name = `NODE_2`
* is_mandatory = ABAP_FALSE
* is_mandatory_selection = ABAP_FALSE
is_multiple = abap_true
* is_multiple_selection = ABAP_TRUE
* is_singleton = ABAP_FALSE
* is_initialize_lead_selection = ABAP_TRUE
* static_element_rtti = lv_struct_name
is_static = abap_false
* attributes =
receiving
child_node_info = lo_child_node_info
.
if not lo_child_node_info is initial.
l_cntx_nd_result = nodt->get_child_node( name = `NODE_2` ).
endif.
User | Count |
---|---|
76 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.