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

Passingf an Internal Table to a function

Former Member
0 Likes
1,801

Hi,

how can i pass an internal table to an function.

Arun

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,767

Hi Arun,

Passing the table using the TABLES parameters in a function module is one solution. However, using the IMPORT or CHANGING parameters is a better solution. Just create in the Dictionary a table type like your internal table to be able to TYPE your parameters.

Regards,

John.

10 REPLIES 10
Read only

Former Member
0 Likes
1,767

You can pass a internal table to a function In the "TABLES" parameter.The function module should be defined to accept that parameter.For example You can check function "BAPI_REQUIREMENTS_CHANGE" function in

SE37 transaction.

Read only

Former Member
0 Likes
1,768

Hi Arun,

Passing the table using the TABLES parameters in a function module is one solution. However, using the IMPORT or CHANGING parameters is a better solution. Just create in the Dictionary a table type like your internal table to be able to TYPE your parameters.

Regards,

John.

Read only

0 Likes
1,767

Hi,

John, is there any particular reason why you say, IMPORT or CHANGING parameters is a better solution than using TABLE parameters in a function module ?

Regards,

Subramanian V.

Read only

0 Likes
1,767

John ,

Could you please tell me in detail.

regards

Arun

Read only

ssimsekler
Product and Topic Expert
Product and Topic Expert
0 Likes
1,767

Hi

There was a very recent discussion on this topic .

John's suggestion is somehow better because by doing so you prevent operations concerned with the header of the internal table which consume some time.

A slight difference but may someone care it.

*--Serdar

Read only

0 Likes
1,767

Hi,

The tables parameter is something which in my opinion is going to be "history". If you take a look at the SAP help on the PERFORM statement you will find a similar remark there "Instead of the TABLES addition, you should use the USING or CHANGING addition wherever possible".

I wouldn't be surprised if SAP will get rid of this parameter in future releases..

Regards,

John.

Read only

0 Likes
1,767

Hi Arun,

If you need more details please send me your Email address and I will send you some screen copies which will be of more help than plain text.

Regards,

John.

Read only

0 Likes
1,767

hi john ,

please send it to r_arun@indiatimes.com

regards

arun

Read only

0 Likes
1,767

Hi Arun,

I have sent an Email to your address. Hope this helps.

Regards,

John.

Read only

0 Likes
1,767

Yes I have seen the topic you mentioned about not using TABLES in subroutines. I wondered if there were any performance issues with using TABLES in Function Modules.

Well I hope , they don't get rid of this in future releases as it would mean problems during upgrade.

Regards,

Subramanian V.