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

how to get data form table parameter

Former Member
0 Likes
841

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
Read only

Former Member
0 Likes
705

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
Read only

uwe_schieferstein
Active Contributor
0 Likes
705

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

Read only

Former Member
0 Likes
705

Hi,

you can treat a table like an internal table.

(READ, INSERT, LOOP)

regards, Rene

Read only

Former Member
0 Likes
706

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

Read only

Former Member
0 Likes
705

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.

Read only

Former Member
0 Likes
705

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.