‎2009 Aug 19 12:55 PM
Hi ALl,
I have a class in which the incoming paramter is type table. In this clas I need to copy this itab to another itab1 which is of some structure type.
Eg:
data :itab type table,
itab1 type table of zstructure,
wa1 type zstructure.
I have tried the following things
1. itab1 = itab
2. loop at itab into wa1.
append wa1 to itab1.
endloop.
3. move itab to itab1.
All three give dump.(2 internal tables are not mutually convertible and compatible).
At runtime I can see that itab has the same structure like itab1.
Please guide.
Regards,
Ruby.
‎2009 Aug 19 1:11 PM
HI,
Do as follows:-
data: y_obj_data type ref to data.
field-symbols: <Y_F_LINE> type any.
CREATE DATA y_obj_data LIKE LINE OF itab.
ASSIGN y_obj_data->* TO <y_f_line>.
if <y_f_line> is assigned.
loop at itab into <y_f_line>.
move-corresponding <y_f_line> to wa1.
append wa1 to itab1.
endloop.
endif.Regards,
Ankur Parab
‎2009 Aug 19 1:11 PM
HI,
Do as follows:-
data: y_obj_data type ref to data.
field-symbols: <Y_F_LINE> type any.
CREATE DATA y_obj_data LIKE LINE OF itab.
ASSIGN y_obj_data->* TO <y_f_line>.
if <y_f_line> is assigned.
loop at itab into <y_f_line>.
move-corresponding <y_f_line> to wa1.
append wa1 to itab1.
endloop.
endif.Regards,
Ankur Parab
‎2009 Aug 19 1:54 PM
try this way if both internal tables are same strcture...
1. itab1[] = itab[]