Download Text File in Background

I need to develop a program that is able to download a text file into the user's local directory as a background job. I'm aware that function modules WS_DOWNLOAD and GUI_DOWNLOAD are only for online execution. Is there a way to manipulate OPEN/TRANSFER/CLOSE DATASET to save the text file into the user's directory instead of AL11? Many thanks in advance.

Answer Wiki

Thanks. We'll let you know when a new response is added.

You have to make an extra program, which read your created file (in background job via Transfer) and write it in your PC via WS_DOWNLOAD. This program must be run in foreground.

Background jobs can?t access presentation server.

Discuss This Question: 3  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • ABAP101
    To expand a little on Hassan's answer: During background processing SAP can only write to storage locations defined to the SAP environment. To accomplish something similar to what you describe we defined a network share (I believe it's called an NFS mount) to SAP so we could write text data to a location accessible from our PC's. We then use an automated WebMethods application to archive the data and also copy it to other locations as needed. This works very well for us. I am not familiar with the specifics as I am more a user of this functionality than a definer. You will likely have to work with your BASIS team to get this set up.
    0 pointsBadges:
  • Clemenss
    In main the question has been answered. Let me explain from another point of view: In background, the SAP server running the job has no connection to your PC, it even does nor know from which PC the job has been scheduled or started. As you know you may log on from anywhere. So if you still want to do as asked: - Your PC has acces to a network drive which can be accessed from SAP server. This is easy for basis people if SAP runs on WINDOWS server - server needs file write access for the drive and path; PC at least read access - background job's program mus use ABAP commands OPEN DATASET and TRANSFER to write the output data. Possibly one of the function modules ARCHIVEFILE_... is useful for this. Regards, Clemens
    0 pointsBadges:
  • SuperSapper
    There is a CLASS called CL_GUI_FRONTEND_SERVICES. it has methods to create subdirectories, see if they exists or delete them. It has many useful methods that deal with files and subdirectories.
    380 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: