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 schedule output of flat file

michele_williams
Participant
0 Kudos
155

I need to provide data to an external entity on a regular basis. They require this data to be in either fixed length/flat file or a delimited text file, not Excel.

I am using standard SAP transactions, e.g. F.21, to provide the data I need. If I run the report interactively and choose List > Export > Spreadsheet, I can output the data using the MHTML format into Excel and from there do a "Save As" into the desired format.

However, I would like to schedule this job and download without manual intervention. Is there a standard program / function / transaction that can be used in this case?

1 REPLY 1

naimesh_patel
Active Contributor
0 Kudos
85

I'm not sure if there is any program which does the same steps what you do to generate the file.

But, you can create a report and submit the program behind F.21 with option EXPORTING LIST TO MEMORY. Get this list after Submit using the FM LIST_FROM_MEMORY. You can then cleans the output and save this to the file.


DATA list_tab TYPE TABLE OF abaplist. 

SUBMIT report EXPORTING LIST TO MEMORY 
              AND RETURN. 

CALL FUNCTION 'LIST_FROM_MEMORY' 
  TABLES 
    listobject = list_tab 
  EXCEPTIONS 
    not_found  = 1 
    OTHERS     = 2. 

Regards,

Naimesh Patel