on 02-18-2009 7:28 AM
Hi friends...
I am new to WDA..
I hav some basic doubts...
l_sflight = wd_context->get_child_node( 'DATA_TAB' ).
l_sflight->bind_table( t_table1 ).
in tha above statement, get_child_node and bind_table are the methods of interface IF_WD_CONTEXT_NODE. if its correct..
why get_child_node is reference by attribute wd_context and bind_table is not reference by wd_context attribute..
give me some ideas..
Regards
Deva
Hi Deva,
WD_CONTEXT is the reference to the controller's context root node, and thus to the entire context.
Each controller method automatically recognizes the reference to the root node of its associated context. This reference is called WD_CONTEXT and is always of the type IF_WD_CONTEXT_NODE. The GET_CHILD_NODE method now enables the generation of a reference to the required subnodes. In Webdynpro ABAP you basically work with context nodes and attributes. So suppose if you want to read the value from a context attribute then you need to do 2 things:
1) Get the reference of the node under which the attribute has been created.
2) Use the corresponding class method up on this obtained reference
So in your example you were trying to bind an internal table with values to a context node. So you first get the node reference using the statement:
l_sflight = wd_context->get_child_node( 'DATA_TAB' ).
And then you are calling the bind_table method on the obtained reference to set the desired values to the context node.
l_sflight->bind_table( t_table1 ).
Arjun has given you the link to a very good document on SDN which would help you grasp the basics of working with context in WebDynpro ABAP. Just through it and you would have all your doubts cleared.
Regards,
Uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
wd_context refers to the root node context and whatever nodes you create under this root node context,in order to access them we use wd_context->get_child_nodes() method.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deva
l_sflight = wd_context->get_child_node( 'DATA_TAB' ).
explaination: since your context can have any number of node, get_child_node needs to find which node it has to refer to ?? nodes may be DATA_TAB, DATA_TAB2 , DATA_TAB3 etc etc.
Almost like XML where you need to get THRU parent to reach CHILD node
after
l_sflight = wd_context->get_child_node( 'DATA_TAB' ).
executes
we have traversed till CHILD node in this case DATA_TAB and we can get or set its attribute. we dont need to use its GRAND PARENT
l_sflight->bind_table( t_table1 ).
hope you could make sense.
Greetings
Prashant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deva,
Please refer this [article|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60730016-dbba-2a10-8f96-9754a865b814], it will provide you some clearity.
Regards
Arjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
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.