on 07-31-2008 4:27 PM
Hi,
I have a context like below.
Node1
Node2
Node3
Node4
Node5
Attrib1
Attrib2
How do I read values from Node5.Attrib1 at runtime>
Thanks in Advance.
Sundar
Thomas,
Thanks for your quick reply.
The following codes are generated by wizard in WDDOMODIFYVIEW.
lo_nd_t_cells_body = wd_context->path_get_node( path = `L_BODY_DATA.S_BODY.T_ROW_BODY.T_COLUMN_BODY.T_CELLS_BODY` ).
get element via lead selection
lo_el_t_cells_body = lo_nd_t_cells_body->get_element( ).
@TODO handle not set lead selection
IF lo_el_t_cells_body IS INITIAL.
ENDIF.
alternative access via index
lo_el_t_cells_body = lo_nd_t_cells_body->get_element( index = 1 ).
@TODO handle non existant child
IF lo_el_t_cells_body IS INITIAL.
ENDIF.
get single attribute
lo_el_t_cells_body->get_attribute(
EXPORTING
name = `CAPTION`
IMPORTING
value = lv_caption ).
When this line is executed
lo_el_t_cells_body = lo_nd_t_cells_body->get_element( ).
I am getting error "Access via 'NULL' object reference not possible. ".
Note: This node attributes are bound with UI elements and it is working fine if I comment the above codes.
Thanks
Sundar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are your nodes supposed to be nested in your question? They show nested in the email version of the thread, but not in the web page itself.
Have you tried using the code wizard to generate the logic to read the subnode? That is a really deep structure. Assuming you can use the lead selection to navigate through the nodes, however the resulting logic shouldn't be complex, just verbose.
I'm not sure what support package level it was introduced, but on my release you can navigate via lead selection using the node path:
* navigate from <CONTEXT> to <SELLER_ADDR> via lead selection
lo_nd_seller_addr = wd_context->path_get_node( path = `SALES_ORDER.SELLER.SELLER_ADDR` ).
This code goes from Node:
SALES_ORDER
->SELLER
->->SELLER_ADDR
That makes things a little cleaner than having to retrieve each intermediate node via the GET_CHILD_NODE method.
Edited by: Thomas Jung on Jul 31, 2008 10:48 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.