on 03-14-2011 4:57 AM
Hi All,
I want to copy selected record from one table to another, but data is not coming in sec table, i am using
following code. One more thing, in first table i am having 4 attributes in 2nd table(different node with diff struct ) i am adding one more attribute. I am appending this value to second table. I checked through debugg, it showing data in table with
new value also, but not displaying data in output. Please help..
DATA lo_nd_del TYPE REF TO if_wd_context_node.
DATA lo_el_del TYPE REF TO if_wd_context_element.
DATA ls_del TYPE wd_this->Element_del.
DATA lo_nd_et_postab_1 TYPE REF TO if_wd_context_node.
DATA lo_el_et_postab_1 TYPE REF TO if_wd_context_element.
DATA ls_et_postab_1 TYPE wd_this->Element_et_postab_1.
DATA lt_et_postab_1 TYPE wd_this->Elements_et_postab_1.
DATA: wa_temp TYPE REF TO if_wd_context_element,
lt_temp TYPE wdr_context_element_set.
navigate from <CONTEXT> to <ET_POSTAB_1> via lead selection
lo_nd_et_postab_1 = wd_context->path_get_node( path = `ZSHP_EXTENDED_DUE_LI.CHANGING_3.ET_POSTAB_1` ).
CALL METHOD lo_nd_et_postab_1->get_selected_elements
RECEIVING
set = lt_temp.
navigate from <CONTEXT> to <DEL> via lead selection
lo_nd_et_postab_1 = wd_context->get_child_node( name = wd_this->wdctx_del ).
LOOP AT lt_temp INTO wa_temp.
CALL METHOD wa_temp->get_static_attributes
IMPORTING
static_attributes = ls_et_postab_1.
ls_et_postab_1-vbeln = del. // adding new attribute value.
APPEND ls_et_postab_1 TO lt_et_postab_1.
CLEAR ls_et_postab_1.
ENDLOOP.
lo_nd_et_postab_1->bind_table( new_items = lt_et_postab_1 ).
Thanks,
Venkat.
Edited by: venkat1011 on Mar 14, 2011 6:05 AM
DATA ls_et_postab_1 TYPE wd_this->Element_et_postab_1.
DATA lt_et_postab_1 TYPE wd_this->Elements_et_postab_1.
I guess the problem is here
you need to give the element type of del here.
like as shown below
DATA ls_et_postab_1 TYPE wd_this->Element_del.
DATA lt_et_postab_1 TYPE wd_this->Elements_del.
thanks
sarbjeet singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI
Try the below code
DATA lo_nd_del TYPE REF TO if_wd_context_node.
DATA lo_el_del TYPE REF TO if_wd_context_element.
DATA ls_del TYPE wd_this->Element_del.
DATA lo_nd_et_postab_1 TYPE REF TO if_wd_context_node.
DATA lo_el_et_postab_1 TYPE REF TO if_wd_context_element.
DATA ls_et_postab_1 TYPE wd_this->Element_del.
DATA lt_et_postab_1 TYPE wd_this->Elements_del.
DATA: wa_temp TYPE REF TO if_wd_context_element,
lt_temp TYPE wdr_context_element_set.
* navigate from <CONTEXT> to <ET_POSTAB_1> via lead selection
lo_nd_et_postab_1 = wd_context->path_get_node( path = `ZSHP_EXTENDED_DUE_LI.CHANGING_3.ET_POSTAB_1` ).
CALL METHOD lo_nd_et_postab_1->get_selected_elements
RECEIVING
set = lt_temp.
* navigate from <CONTEXT> to <DEL> via lead selection
lo_nd_et_postab_1 = wd_context->get_child_node( name = wd_this->wdctx_del ).
LOOP AT lt_temp INTO wa_temp.
CALL METHOD wa_temp->get_static_attributes
IMPORTING
static_attributes = ls_et_postab_1.
ls_et_postab_1-vbeln = del. // adding new attribute value.
APPEND ls_et_postab_1 TO lt_et_postab_1.
CLEAR ls_et_postab_1.
ENDLOOP.
lo_nd_et_postab_1->bind_table( new_items = lt_et_postab_1 ).
Hi Venkat ,
Check the node to which you are binding.
If you are reffering lo_nd_del as second node , then check binding since in the end .
As lo_nd_del node is not used at all for binding . KIndly bind the table to this node.
regards
kuldeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.