on 10-29-2009 10:28 AM
Hi
I have create a Node TP which has a sub node general with an attribute BU_GROUP.
Plus on the layout I have created a fields of type Drop down by Key and is binded with the field BU_GROUP.
Now I have to set value to this field. I have added the following code, but its restrns with an error message of TAXPAYER.TP.GENERAL Node not found while running.
Code is TYPES : BEGIN OF sty_grp,
bu_group TYPE tb001-bu_group,
END OF sty_grp.
DATA: git_data TYPE STANDARD TABLE OF sty_grp,
gwa_data LIKE LINE OF git_data.
DATA lo_node_info TYPE REF TO if_wd_context_node_info.
DATA value1 TYPE wdy_key_value.
DATA set TYPE wdy_key_value_table.
DATA lo_nd_general TYPE REF TO if_wd_context_node.
DATA lo_el_general TYPE REF TO if_wd_context_element.
DATA ls_general TYPE wd_this->Element_general.
DATA lv_bu_group TYPE wd_this->Element_general-bu_group.
navigate from <CONTEXT> to <GENERAL> via lead selection
lo_nd_general = wd_context->path_get_node( path = `TP.GENERAL` ).
@TODO handle non existant child
IF lo_nd_general IS INITIAL.
ENDIF.
get element via lead selection
lo_el_general = lo_nd_general->get_element( ).
@TODO handle not set lead selection
IF lo_el_general IS INITIAL.
ENDIF.
get single attribute
lo_el_general->get_attribute(
EXPORTING
name = `BU_GROUP`
IMPORTING
value = lv_bu_group ).
SELECT bu_group FROM tb001 INto TABLE git_data.
LOOP AT git_data INTO gwa_data.
move gwa_data-bu_group to value1-key.
move gwa_data-bu_group to value1-value.
APPEND value1 to set.
endloop.
lo_nd_general = wd_context->get_child_node( name = 'TP.GENERAL' ).
lo_node_info = lo_nd_general->get_node_info( ).
lo_node_info->SET_ATTRIBUTE_VALUE_SET( name = 'BU_GROUP' value_set = set ).
Please help
Rgrds
Shakti
Hi.
U can not access the sub node directly....
use the following code...
navigate from <CONTEXT> to <CN_NODE> via lead selection
lo_nd_cn_node = wd_context->get_child_node( name = wd_this->wdctx_cn_node ).
@TODO handle not set lead selection
IF lo_nd_cn_node IS INITIAL.
ENDIF.
navigate from <CN_NODE> to <CN_DROPDOWN1> via lead selection
lo_nd_cn_dropdown1 = lo_nd_cn_node->get_child_node( name = wd_this->wdctx_cn_dropdown1 ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
You seems to have created three nodes but in path only two nodes.
Pls check the same.
Where have you written code.
Write in Supply funciton.
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.