on 09-10-2014 9:11 AM
Hi,
we have a variable MO_Current_ORGval which refers to IF_WD_CONTEXT_element.
During runtime i need to check wether the node is initial or not ?
how to achieve this ?
i have tried using MO_Current_ORGval->get_node( ) is initial .
But no use.
source code:
check wd_comp_controller->mo_current_orgval is not initial.
"" Here i need to check , whether the node is having any value or not.
Hi Aravindan,
In general,you can access the attributes of an object as below
object->name_of_attribute.
In your case, you need to get the node reference and get the no. of elements inside the context element.
Here is one point:
as mo_current_orgval is a context element of a node, if element is not initial, that means : the node is already having at least one element.
Hence NODE will never be initial if mo_current_orgval is not initial
If you want to know how many elements inside the context node.
check wd_comp_controller->mo_current_orgvalis not initial.
"" Here i need to check , whether the node is having any value or not.
data lo_node type ref to if_wd_context_node.
data lv_no_of_elements type i.
lo_node = wd_comp_controller->mo_current_orgval->get_node( ).
if lo_node is bound. "mean, object reference to node bound
lv_no_of_elements = lo_node->GET_ELEMENT_COUNT( ).
endif.
" similarly you can use the GET_STATIC_ATTRIBUTES_TABLE method to retrieve static attributes of node ( 0..n )
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aravindan,
Okay, I could see from snap shot that, NODE is an attribute of class CL_WDR_CONTEXT_ELEMENT.
Please try the below code
data lo_wdr_element type ref to cl_wdr_context_element.
lo_wdr_element ?= wd_comp_controller->mo_current_orgval.
if lo_wdr_element is bound.
if lo_wdr_element->node is bound.
endif.
endif.
Hope this resolves your issue.
Regards,
Rama
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.