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: 

Returning tables from classes

Former Member
0 Kudos
92

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

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos
73

You need to create a table type in SE11 and use them as a reference in the parameters.

Regards,

Naimesh Patel

5 REPLIES 5

naimesh_patel
Active Contributor
0 Kudos
74

You need to create a table type in SE11 and use them as a reference in the parameters.

Regards,

Naimesh Patel

0 Kudos
73

Patel,

so, will I have to create a table type for each table that I want to return?

Thanks

0 Kudos
73

Yes.

Your tables in the RFC FM will some reference Strucutres.

First, try to find out if there are any predefined table type for those structures or not.

To do so:

Go to SE11

Enter your Strucutre

Now do the where Used list

Select the "Table Type"

If you don't find any predefined table type for those structures, create them in the SE11.

Enter Select the Data Type and enter name.

Select the "Table Type" from next popup.

You can also create Local Data type for the classes throught button "Local Types" in the SE24. But this table types can only be used as a parameters of the methods which are Private.

Regards,

Naimesh Patel

0 Kudos
73

Thanks Patel.

Former Member
0 Kudos
73

Hi,

how about storing your tables into a kind of an array (wa, structure, itab) and return it via your own get() function and an array would be as a return value?

Best regards,

John