05-15-2009 8:14 AM
Hi all,
I have to run a standard report(IW39) in background and save the result ALV as excel or text file.
How to get the result saved in excel / text format if I don't want to customize the standard program?
(In the spool, there is an option to save list in file "Spreadsheet", but the saved format is not what we expected.
It is expected the data to be put is separated in each column / tab-delimited in the text file....)
Many Thanks!
05-15-2009 8:18 AM
hi
Try to create ALV output to spool in background then try to use any of the below mentioned fm
SAP_CONVERT_TO_XLS_FORMAT
MS_EXCEL_OLE_STANDARD_DAT
RSPO_DOWNLOAD_SPOOLJOB
RH_START_EXCEL_WITH_DATA
or
create CSV using OPEN DATASET & TRANSFER
05-15-2009 8:52 AM
Thanks!
But must I rewrite the standard program to a customized one?
05-15-2009 9:45 AM
If you want to be in charge of the exact layout of the output, you should create your own report, and do a SUBMIT of the standard report. You can then retrieve it from the SPOOL and present (download) to your own preferred layout.
No need to change standard report this way.
05-18-2009 7:05 AM
05-18-2009 7:18 AM
I don't have any ready made coding examples, but using the F1 help on SUBMIT statement will help to get you quite a way:
DATA list_tab TYPE TABLE OF abaplist.
SUBMIT 'RIAUFK20'
USING SELECTION-SCREEN
EXPORTING LIST TO MEMORY
AND RETURN.
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.
Edited by: Micky Oestreich on May 18, 2009 8:18 AM
06-04-2009 3:23 AM
03-25-2011 7:55 AM
Hi Macy,
Even we are having similar problem,can you please let us know in details how you achieved the same.
Thanks in advance
Muninarase gowda