Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error in MOVE-CORRESPONDING statement

Former Member
0 Likes
1,885

Hi all,

I am facing issue in move-corresponding statement.

Form:

FORM get_first_data USING it_lifnr TYPE ty_lifnr

it_prdha TYPE ty_prdha

it_matnr TYPE ty_matnr

ct_list_struct TYPE yt_list_struct

pd_datab LIKE sy-datum

pd_datbi LIKE sy-datum.

In loop statment:

LOOP AT lt_eket.

  • Liste mit EKET-Einträgen anreichern

clear ld_subrc.

CLEAR ct_list_struct.

MOVE-CORRESPONDING lt_eket TO ct_list_struct.

After this statement it is giving error that, ct_list_struct is not a structure or internal table with header line.

4 REPLIES 4
Read only

Former Member
0 Likes
1,121

Hi,

Is ct_list_struct an internal table? if so, try to declare a work area for assigning data:


FORM get_first_data USING it_lifnr TYPE ty_lifnr
it_prdha TYPE ty_prdha
it_matnr TYPE ty_matnr
ct_list_struct TYPE yt_list_struct
pd_datab LIKE sy-datum
pd_datbi LIKE sy-datum.
"In loop statment:
data: wa_list_struct like lines of ct_list_struct
LOOP AT lt_eket.
* Liste mit EKET-Einträgen anreichern
clear ld_subrc.
CLEAR ct_list_struct.
MOVE-CORRESPONDING lt_eket TO wa_list_struct.
append wa_list_struct to ct_list_struct.

thanks,

Read only

Former Member
0 Likes
1,121

Hi,

What is type yt_list_struct variable whether it is a table type or structure? If it is a table type then you can follow

what Thien suggested you.

And If it is a structure then it should not have created any issue and also can you give how you have

declared lt_eket.

Your other variables are declared as ty_... so may be you mistakenly typed as yt_list_struct , may be it should be

ty_list_struct.

Regards,

Pawan

Read only

Former Member
0 Likes
1,121

Hi Siva

You have declared ct_list_struct as type of yt_list_struct.

SO you need to define ct_list_struct as table withheader line or with separate work area.

like below:

DATA: ct_list_struct type standard table of yt_list_struct with header line OR

DATA: ct_list_struct type standard table of yt_list_struct, wa_ct_list_struct type yt_list_struct.

Now Apply loop at it_eket.

move-corresponding it_eket to wa_ct_list_struct.

append wa_ct_list_struct into ct_list_struct.

endloop.

I hope this will work for you

Thanks

Lalit Gupta

Read only

Former Member
0 Likes
1,121

Moderator message - Please do not ask or answer basic questions - thread locked Rob