Skip to Content
Apr 07, 2011 at 01:44 PM

Is there a FM to list records in an internal table? Query functionality?


Good day, everyone!

I have a little "scratch" program I use for doing ad-hoc queries. I know there's SAP Query, but I prefer to have a program where I can explicitly write my SQL to see the results.

The program is very simple: I have an area where I define the fields as a type, create an internal table of that type, then I do my SQL. To display the results, I loop through the table and write each field value.

This is okay for queries with just a few fields in my resulting table, but it's getting to be a pain having to go into the display code and change all my WRITE statements to match the fields in my internal table.

I did a LOT of searching trying to find a simple FM that will dump my internal table contents to the screen. It can be a simple list, nothing fancy, no ALV needed. Unfortunately I can't find anything. I've found things that are close, but they seem to want to work against established SAP tables only instead of my internal tables.

Any ideas?

Also, while I'm on the subject -- are there are good sample programs out there providing this open, ad-hoc "query" functionality that might be better than the way I'm doing it?

Thanks everyone!