‎2014 Oct 30 7:45 PM
This is such a noob question, but I can't figure out if I'm approaching function design correctly. I'm creating a function that returns a list of items. I come from a curly brace language background, and when I want to do something like this in those languages I simply create an object and then return a list containing multiple objects.
Now to my ABAP issue. I have a structure and I want to return a list (internal table) of them. As far as I can tell, to do this I need to create a table type based on this structure and then reference the table type in an exporting parameter. This feels like an unnecessary step to me, so I just want to be sure I'm not missing some other mechanism to accomplish this. Is there not a way to define at the function level that I have a structure and I want to return zero or more of them?
‎2014 Oct 30 8:24 PM
Robin,
There is a Tables parameter also in which you cna pass structure and it will give table values/ Did you try that?
Ravi
‎2014 Oct 30 8:24 PM
Robin,
There is a Tables parameter also in which you cna pass structure and it will give table values/ Did you try that?
Ravi
‎2014 Oct 30 8:32 PM
I may be mistaken, but isn't a Tables parameter for passing data into a function module, not returning data from it?
Also, isn't that functionality obsolete? I realize this doesn't prevent me from using it, but it doesn't seem smart to use things that are obsolete.
‎2014 Oct 30 10:21 PM
Hi Robin,
A tables parameter can be used to return values as well. You are right that Tables parameter is obsolete so it might not be advisable. If you don't want to use tables then you have no other option other than using the table type in export parameters.
Thanks,
Naveen