ā2014 Mar 25 1:57 PM
Hello,
I need your help, I have a query, someone knows how to make the result of this query into a internal table , I want to develop a program that makes this. I want to reuse the query already built and then use the data for other purpose.
Thanks so much.
ā2014 Mar 25 2:56 PM
query can be generated as a report. You would need to do this and parse the part where the data is selected
ā2014 Mar 25 5:36 PM
Hello Enrique,
Goto SQ01 --> Select the query and goto menu, Query--> more function --> Display report name.
Goto se38 open the report and copy it to your Z* program, internal table %g00 has the final data displayed in the query output.
Regards,
TP
ā2014 Mar 27 2:57 AM
My understanding is that you want to call a query from your program to get the results of the query into an internal table. If so you can also use the function RSAQ_REMOTE_QUERY_CALL. Just pass your query name, usergroup, and remember to check SKIP_SELSCREEN and DATA_TO_MEMORY. It's RFC enabled and we use it here to download data but it should work fine internally. The format in the data in the export table doesn't look as friendly as I thought though.
ā2014 Mar 27 3:12 AM
Get the query name from Goto SQ01 --> Select the query and goto menu, Query--> more function --> Display report name.
The use sumbit report statement. SUBMIT query_prgram_name AND RETURN EXPORTING LIST TO MEMORY. The call the list by FM LIST_FROM_MEMORY into your itab.
hope this will work for you.
ā2014 Mar 27 3:25 AM
Hi Tripurari,
This would produce a nicer format than my suggestion but one probelm with this is that the report behind a query is generated by the system so its name can change between development, quality and production environments. If I were to follow this approach to try to get the results of a query into an internal table I wouldn't submit the query program directly but submit the program START_REPORT as similarly as describe.
"START_REPORT with the skip initial screen checked and pass the following parameters to START_REPORT
⢠D_SREPOVARI-REPORTTYPE = AQ
⢠D_SREPOVARI-REPORT = <USER GROUP in WHICH THE QUERY IS CREATED> G "
This is an approach we use to avoid problems caused by chaning query report names between environments when we create transaction to wrap around querys but I've not tried it to export a query list.
Regards,