12-14-2006 11:32 AM
how can i copy data form the table parameter in the function module into internal table declared in the function module ??
thanks in advance
12-14-2006 11:39 AM
Hello,
If the internal table is of the same structure as the tables parameter, you can use the assignment operator.
itab_internal[] = itab_parameter[].
If they are not, you will have to use move-corresponding.
loop at itab_parameter.
move-corresponding itab_parameter to itab_internal.
append itab_internal.
endloop.
Regards,
Manoj
12-14-2006 11:38 AM
Hello Naval
Assuming that you have a TABLES parameter IT_MARA of type mara, then you can code within your function module.
DATA:
ls_mara TYPE mara,
lt_mara TYPE STANDARD TABLE OF mara.
lt_mara = it_mara[].
LOOP AT lt_mara INTO ls_mara.
* do something...
ENDLOOP.
Regards
Uwe
12-14-2006 11:38 AM
Hi,
you can treat a table like an internal table.
(READ, INSERT, LOOP)
regards, Rene
12-14-2006 11:39 AM
Hello,
If the internal table is of the same structure as the tables parameter, you can use the assignment operator.
itab_internal[] = itab_parameter[].
If they are not, you will have to use move-corresponding.
loop at itab_parameter.
move-corresponding itab_parameter to itab_internal.
append itab_internal.
endloop.
Regards,
Manoj
12-14-2006 11:47 AM
Hi
If they are of same structure you can do like this
itab1[] = itab2[]
else.
move-correspoding itab2 to itab1.
But the structure which you have created inside the function module can not be called anywhere.
Regards
Haritha.
12-14-2006 11:51 AM
ur internal table is itab & parameter table is ptab.
Now, itab & ptab should be of similar structure...
Now, itab[] = ptab[].........
If structure is different.
loop at ptab.
itab-field1 = ptab-field.
itab-field2 = ptab-field..........
append itab.
clear: itab, ptab.
endloop.