cancel
Showing results for 
Search instead for 
Did you mean: 

Internal Table Data Process

Former Member
0 Kudos

Hi,

I am trying to move corresponding data of one context node data into another table context node

and getting the below error. could you pls let me know whts wrong with the below code.

Error:-LS_CREATE is not a structure or internal table with header line.

DATA lo_nd_create TYPE REF TO if_wd_context_node.

DATA lo_el_create TYPE REF TO if_wd_context_element.

DATA lt_create TYPE STANDARD TABLE OF wd_this->elements_create.

DATA ls_create TYPE wd_this->elements_create.

DATA lt_submit TYPE STANDARD TABLE OF wd_this->elements_submit.

DATA ls_submit TYPE wd_this->elements_submit.

*Get the inputs of the ALV Table.

lo_nd_create = wd_context->get_child_node( name = wd_this->wdctx_create ).

lo_nd_create->get_static_attributes_table(

importing

table = lt_create ).

LOOP AT lt_create INTO ls_create.

MOVE-CORRESPONDING ls_create TO ls_submit.

APPEND ls_submit TO lt_submit.

ENDLOOP.

Thanks,

vind

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi ,

You can try decalring ls_create as ,

DATA ls_create LIKE LINE OF lt_create .

This would be a safer option.

Thanks,.

aditya.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Vind,

First check the Cardinality of the Both Nodes,,Cardinality of both nodes should be 0..n or 1..n

Copy the below Code


 DATA lo_nd_create TYPE REF TO if_wd_context_node.
DATA lo_el_create TYPE REF TO if_wd_context_element.
DATA lt_create TYPE wd_this->elements_create.  " Internal Table
DATA ls_create TYPE wd_this->element_create.  " Work Area
DATA lt_submit TYPE wd_this->elements_submit.  " Internal Table
DATA ls_submit TYPE wd_this->element_submit.   " Work Area

*Get the inputs of the ALV Table.
lo_nd_create = wd_context->get_child_node( name = wd_this->wdctx_create ).
lo_nd_create->get_static_attributes_table(
importing
table = lt_create ).

LOOP AT lt_create INTO ls_create.
MOVE-CORRESPONDING ls_create TO ls_submit.
APPEND ls_submit TO lt_submit.
ENDLOOP.