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

Passing 3 internal tables as using parameter in subroutine

Former Member
0 Likes
823

Hi Experts,

I am passing three internal tables as using parameters in a subroutine in my program. I am little confused if it is recommended to pass so many tables as parameters.

Could you please let me know.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

nishantbansal91
Active Contributor
0 Likes
787

Hi Tiki,

Previously i was thinking like Gaurav, but some days back, i read one document that SAP never recommended to define the data variable at global level.

Because when the program load SAP collect all the data object into Stack memory global objects always remain same till that program is in memory.

So if we can define the data at local level it will automatically clear from memory when the scope of the blocks end.


Thanks and Regards,

Nishant

Hi Experts,

I am passing three internal tables as using parameters in a subroutine in my program. I am little confused if it is recommended to pass so many tables as parameters.

Could you please let me know.

Thanks in advance.

4 REPLIES 4
Read only

Former Member
0 Likes
787

Hi ,

I was also curious to know if it is recommended to pass these many tables in the perform.

The F1 help also does not gives any such information.

If your table are globally defined you dont have to pass them in using parameters, but depending on your requirement, you can use USING and CHANGING parameters of the perform apropriately.

Would like other Gurus also to comment/share their views on this.

Hope this helps.

Read only

Former Member
0 Likes
787

Hi!

I think if you are not passing huge tables by value, it's not a problem.

But as far as PERFORMs are obsolete now you can use local classes for your program. Defining these 3 tables as class attributes will let you forget about USING parameters.

Read only

nishantbansal91
Active Contributor
0 Likes
788

Hi Tiki,

Previously i was thinking like Gaurav, but some days back, i read one document that SAP never recommended to define the data variable at global level.

Because when the program load SAP collect all the data object into Stack memory global objects always remain same till that program is in memory.

So if we can define the data at local level it will automatically clear from memory when the scope of the blocks end.


Thanks and Regards,

Nishant

Read only

Former Member
0 Likes
787

Thank you all for your valuable responses.