‎2010 Oct 08 9:12 AM
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.
‎2010 Oct 08 9:18 AM
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,
‎2010 Oct 08 11:57 AM
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
‎2010 Oct 08 12:06 PM
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
‎2010 Oct 08 2:40 PM
Moderator message - Please do not ask or answer basic questions - thread locked Rob