Download files from AL11 is common requirement for any SAP Consultant.
In this guide, you will find different methods to ABAP Download files for Application server to Presentation server (locally).
We will try to use Standard SAP Transaction Codes, SAP Standard Report, SAP Function module and Custom ABAP Report.
Table of Contents
If you want to write ABAP Download file Report, the SAP Transaction codeCG3Y is a fast way to download a large file from AL11 to local directory.
Set the Source File and the Target file on front End and Execute !
There are some extra parameters which can be useful in same case:
Here a screenshot of the CG3Y (Download File: Parameters)
This Program CACS_FILE_COPY is very useful also ( can be launched from SE38/SE80).
In fact, the huge advantage of the CACS_FILE_COPY SAP Standard Report is the fact that you use it to Copy SAP File from Application to Presentation Server and Presentation to Application ( in others terms: SAP Server <-> Local ).
Set the Copy direction
The Set the file source and the file destination paths.
If the file is no so long, you can directly download the content in AL11.
Navigate to the file. Then Open the file.
On System Menu, go to List > List > Save > Local File.
In some case, the exported file is truncated.
For List export in AL11, the limit is 512 Characters.
Apply SAP Note 952766 to increase the limit in AL11 ( if your SAP System has the prerequisite for this note)
Usually, I checked the file to be transferred and use this method ( AL11> Save to Local File ) in the first way. It works fine with small file.
The standard Function module ARCHIVFILE_SERVER_TO_CLIENT can also do the work and download file from AL11. ( At lease, check it with SE37 and validate if it is ok for you to use it)
Therefore, you have just to fill :
Here the signature of ARCHIVEFILE_SERVER_TO_CLIENT
FUNCTION ARCHIVFILE_SERVER_TO_CLIENT. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" VALUE(PATH) LIKE SAPB-SAPPFAD *" VALUE(TARGETPATH) LIKE SAPB-SAPPFAD DEFAULT SPACE *" EXCEPTIONS *" ERROR_FILE *" NO_AUTHORIZATION *"----------------------------------------------------------------------
Note that SAP offers in Standard 3 functions modules:
If all the previous solutions are not enough for you or your requirement is more complex to be done with the above SAP Standard Tools ( tcodes or reports ), in order to download in abap the file, you can ask for/ develop a new ABAP custom Program to download files.
Here SAP offers more powerful tools to play with files both on Front-End and Back-End.
The main options are:
If you want to go further about how to manage Files in SAP with ABAP code or with Standard SAP Tcodes/Reports
SAP ISU Tables for Technical master data, for Billing Master Data, Billing and invoicing Tables?…
SAP Fiori 3 UX and Design of SAP Fiori Apps for SAP S/4HANA, SAP TechEd…
Dunning is the business practice of informing a customer of past due payment. Dunning letters…
SAP AP Tcodes & SAP AR Tcodes: House Banks Tcodes, Advance Payments or Down Payments,…
What are the main SAP Payment Terms Tables ? What are the related Tables in…
Work center consists of master data related to routing of products. It contains data related…