05-13-2013 7:34 AM
I'm using ABAP Query SQ01 and try to get the data using function LIST TO MEMORY and WRITE LIST resulting garbage value.
Try the suggestion give our fellow SCN members in this link http://scn.sap.com/thread/2122861 but still not resolved. Appreciate if there is any idea and input on this.
submit aqzzzmm_group_01zmm_q01======= exporting list to memory
and return.
call function 'LIST_FROM_MEMORY'
tables
listobject = listtab.
call function 'WRITE_LIST'
* EXPORTING
* WRITE_ONLY = ' '
tables
listobject = listtab
* EXCEPTIONS
* EMPTY_LIST = 1
* OTHERS = 2
.
.
call function 'LIST_FREE_MEMORY'
tables
listobject = listtab
.
call function 'GUI_DOWNLOAD'
exporting
filename = 'c:\test.csv'
header = '00'
tables
data_tab = listtab.
05-13-2013 7:46 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.
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.
05-13-2013 7:46 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.
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.
05-13-2013 7:58 AM
unfortunately this SQ01 is checked as - SAP List Viewer,
is there any work around to help me on this? Generally I need the data from SQ01, and downloaded it to SAP folder.
Thanks.
05-13-2013 8:04 AM
Try LIST_TO_ASCI instead of write_list.
SUBMIT ztestaks1 WITH s_matnr IN s_matnr EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = t_listobject
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
CALL FUNCTION 'LIST_TO_ASCI'
* EXPORTING
* LIST_INDEX = -1
* WITH_LINE_BREAK = ' '
TABLES
listasci = t_ascilist
listobject = t_listobject
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
WRITE:/ 'Below are the lines from the submitted program.'.
LOOP AT t_ascilist.
WRITE:/ t_ascilist-line.
ENDLOOP.
SKIP 2.
ENDIF.
ENDIF.
05-13-2013 8:35 AM
i think this one is not working also, data downloaded with unreadable value.
10-07-2014 1:01 PM
Don't you get a button "EXPAND" next to SAP List viewer radio button?
10-07-2014 12:10 PM
Hi Badz,
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!