How to Read Structure from Context Element in ABAP Webdynpro
How to Read Structure from Context Element in ABAP Webdynpro
In the previous ,we have learnt reading attribute value of context element ,in this lesson,we will learn how to read structure from context element.It is most important as a ABAP WebDynpro developer ,second step is to learn reading structure static attributes ,reading the structure of any element and reading specific element of node .So now let us start learning method structures to access values.
In the first step,we will learn reading static attributes of structure.
Method ABAP_TUTOR. DATA:I_node type ref to IF_WD_CONTEXT_NODE, I_my_struc type ref to IF_MY_CONTROLLER=>element_node_1. I_node = wd_context->get_child_node(wd_this->wdctx_node_1). I_node->get_static_atributes(importing static_attributes= i_my_struc). Endmethod.
In the second step,we can also read a structure of any element using the index parameter.
Method ABAP_TUTOR2. DATA:I_node type ref to IF_WD_CONTEXT_NODE, I_my_struc type ref to IF_MY_CONTROLLER=>element_node_1. I_node = wd_context->get_child_node(wd_this->wdctx_node_1). I_node->get_static_atributes(Exporting index = 2 importing static_attributes= i_my_struc). Endmethod.
In the third step, we can also navigate to a specific element of the node before reading the structure.
Method ABAP_TUTOR3. DATA:I_node type ref to IF_WD_CONTEXT_NODE, I_elemnt type ref to IF_WD_CONTEXT_ELEMENT, I_my_struc type ref to IF_MY_CONTROLLER=>element_node_1. I_node = wd_context->get_child_node(wd_this->wdctx_node_1). I_element = I_node->get_element(3) I_element->get_static_attributes(importing static_attributes= i_my_struc). Endmethod.From this lesson, we have learnt the how to read structure in different possible ways in ABAP webdynrpo applications .
Comments
Post a Comment