on 01-14-2009 4:20 AM
Hi
I have two web dynpro components: zwd_parent having context node parent_data and zwd_child having context node child_data. i declared to usage of zwd_child into zwd_parent.
Now as we do mapping of nodes in WD ALV creation(reverse mapping). similar mapping of nodes i have done here. node parent_data is having attributes a and b. and zwd_child is not having any attribute.
I mapped zwd_parent node to zwd_child node.
now in child component I want to get the data passed through mapping of parent_data to child_data.
I used this code:
DATA lo_nd_data TYPE REF TO if_wd_context_node.
DATA lo_el_data TYPE REF TO if_wd_context_element.
navigate from <CONTEXT> to <DATA> via lead selection
lo_nd_data = wd_context->get_child_node( name = wd_this->wdctx_data ).
@TODO handle not set lead selection
IF lo_nd_data IS not INITIAL.
data:
lr_node_info TYPE REF TO if_wd_context_node_info,
attrib_info type WDR_CONTEXT_ATTR_INFO_MAP.
lr_node_info = lo_nd_data->get_node_info( ).
CALL METHOD lr_node_info->get_attributes
receiving
attributes = attrib_info
.
it is returning the mapped attribute info but data is not available.. how to get data ?
Thanks
Vishal kapoor
Hi Vishal,
Check the InputElement(Ext). property of the child node i.e zwd_child node. Use code wizard to get the values from this node.
Regards
Arjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you can get the same code by clicking on the button code wizard in your SAP..... (button with a yellow tourch like image).. just click on that button a screen will come in that screen select read context and using f4 help select your attribute and click on ok.... you will get the similar code with value in importing parameter.. here in my code value is in lv_cb1....
regards
Pranav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check this code to get attributes
data lo_el_context type ref to if_wd_context_element.
data ls_context type wd_this->element_context.
data lv_cb1 like ls_context-cb2.
* get element via lead selection
lo_el_context = wd_context->get_element( ).
* get single attribute
lo_el_context->get_attribute(
exporting
name = `CB2`
importing
value = lv_cb1 ).
here cb2 is the attribute from which i am getting data....
and I am not able to find any error here in the procedure you have provided if you are not able to get data..... check all the mappings and see if you are not doing any thing like invalidating a node...
regards
Pranav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.