2012 Jan 24 4:52 AM
I have a SAP Query written in SQ01. However I want to use this Query in ABAP Program.
I have written the code
SUBMIT aqzzzhtr_persadme_y=========== via SELECTION-SCREEN
EXPORTING LIST TO MEMORY AND RETURN.
aqzzzhtr_persadme_y=========== - Is the Program Generated for my SQ01 Report Query.
Going to System --> Status --> aqzzzhtr_persadme_y===========
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = itab_list
EXCEPTIONS
not_found = 4
OTHERS = 8.
But the List is not showing the correct value, in turn showing some Junk Value which is not the actual output of the report.
I have also used Write_List, Display_List but none fo them is working correctly.
aqzzzhtr_persadme_y=========== - Is the Program Generated for my SQ01 Report Query.
Kindly suggest and guide me throught right steps.
2012 Jan 24 5:37 AM
in the output format of the query (inSQ01) check if its set to SAP List viewer. set it if not set. then this below query works. .change your query name..
submit aqzzzdmscm======zdm_po======== using selection-set 'V1' EXPORTING LIST TO MEMORY
AND RETURN.
DATA list_tab TYPE TABLE OF abaplist.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = list_tab
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
CALL FUNCTION 'WRITE_LIST'
TABLES
listobject = list_tab.
ENDIF.
2012 Jan 24 5:39 AM
Hi Ritesh,
If your are using LIST_FROM_MEMORY and if your output is in junk value,
Use FUNCTION MODULE 'LIST_TO_TXT' , surely you will get your actual output.
Regards,
Saravana.S
2012 Jan 24 12:20 PM
No This is not working...
Suppose there are 2 Programs A and B.
In A i have written Submit B Exporting to memory list and return
I want the data of B Report that is run.
Please suggest.
2012 Jan 24 3:31 PM
You can use this blog to learn how to get output of a submitted report :
Some example usage:
DATA:lf_ref TYPE REF TO data,
lf_ref1 type ref to data.
cl_salv_bs_runtime_info=>set(
EXPORTING display = abap_false
metadata = abap_true
data = abap_true ).
Submit (program) USING SELECTION-SET variant EXPORTING LIST TO MEMORY
AND RETURN.
TRY.
cl_salv_bs_runtime_info=>get_data_ref(
IMPORTING r_data = lf_ref ).
ASSIGN lf_ref->* TO <lt_data>.
CATCH cx_salv_bs_sc_runtime_info.
MESSAGE `Programdan veri çekilemedi` TYPE 'E'.
ENDTRY.
cl_salv_bs_runtime_info=>clear_all( ).
CREATE DATA lf_ref1 LIKE LINE OF <lt_data>.
ASSIGN lf_ref1->* TO <lt_line>.Edited by: kerimmkilic on Jan 24, 2012 4:31 PM
2012 Jan 24 5:12 PM
what error are you facing when you tried the code which I suggested along with the option of SAP list viewer?
2014 Oct 07 11:23 AM
Hi Ritesh,
Have you solved the issue? Can you please share if yes.
I have same problem (can't get results when submitting to query generated report)
Thank you!
2025 Jun 17 9:34 PM