cancel
Showing results for 
Search instead for 
Did you mean: 

returning tables from classes

Former Member
0 Kudos

Hi experts,

I have some doubts concerning the use of tables as parameters of classes.

When we use RFC's we have the Addition "Tables" to receive a table from a function.

But, when we're using classes, we don't have this addition.

I am creating a class that will return 10 tables.

This class is calling a RFC.

How would be the best option to return these tables from my class? Should I have a method get for each table?

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>> When we use RFC's we have the Addition "Tables" to receive a table from a function.

First of all you aren't limited to passing internal tables via this Tables parameter of a function module. This is really legacy stuff. Now most of the time you see internal tables passed perfectly fine via the importing and exporting parameters.

You do exactly the same thing with methods. It is normal to pass internal tables via the importing, exporting - heck even the changing and returing parameters.

Now if you should make separate methods for each table - that really depends upon your use case. If you often will need the majority of the tables at the same time then no there is no reason for the overhead of having separate method calls. If you will often only need a subset of the tables then you can save some processing time of processing all the tables by only calling the methods of the ones you want.

And now that I have answered this question, it occurs to me that this question is not related directly to Web Dynpro ABAP. Since I've already typed an answer before I thought about this, I'm not going to delete it. However, this is just a normal ABAP question and therefore not appropriate for the Web Dynpro ABAP forum. In the future please post your questions in the correct form. This question will not be locked because it is in the incorrect form.

Former Member
0 Kudos

Hi castro,

Create 10 internal tables of table types are from required tables in the attributes of class and fill those internal tables.you can access those internal tables in appliation by creating the instance of class and access them into the application Where ever you want .

(or)

If you can fill all the tables at a time means from the method then make those internal tables are as exporting parameters to the method.