Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the alv saved in background mode without modifying the program?

Former Member
0 Kudos

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!

7 REPLIES 7

Former Member
0 Kudos

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

0 Kudos

Thanks!

But must I rewrite the standard program to a customized one?

0 Kudos

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.

0 Kudos

Thanks! Could you please show me some coding examples?

Thanks!

0 Kudos

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

Former Member
0 Kudos

I just wrote a Z program to do so.

thanks!

0 Kudos

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