Application Development 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: 

how to get data form table parameter

Former Member
0 Kudos

how can i copy data form the table parameter in the function module into internal table declared in the function module ??

thanks in advance

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

5 REPLIES 5

uwe_schieferstein
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi,

you can treat a table like an internal table.

(READ, INSERT, LOOP)

regards, Rene

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.