Skip to Content

How to store files in shared-folder in background mode

Hello All,

My requirement seems to be simple but I have tried many ways in achieving this, but failed. So require the help in accomplishing this task.


Requirement

I have to create a program in SE38 which will create a internal table with data in it in .XML format(which I can achieve).

My requirement is this .XML file needs to be placed in a shared-folder in "BACKGROUND MODE".

I have tried using GUI_DOWNLOAD function module, but this FM only runs in Foreground mode and fails in Background mode. I have tried convincing my client that I will keep the file in Application Server as it is achievable using OPEN DATASET statements, but they are not willing to accept this.

So can you please help me in achieving this task as I am not getting any solution how to keep the file in Shared-folder in BACKGROUND mode itself(not Foreground).

Best Regards,

Tousif

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Posted on May 21, 2014 at 05:26 AM

    Hi Tousif,

    can you please share your code, only relevant code.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 21, 2014 at 06:14 AM

    1. GUI_DOWNLOAD has "GUI" in it's name. Of course there is no GUI / client when run in background. Even if there was any, download means transfer SAP => CLIENT.

    2. what is the shared folder - transaction SBWP? If so, you are not uploading files to any place in the application server, rather you are using (in most cases suitable) sap office documents uploaded to the specific place.

    You can try using FM SO_FOLDER_ROOT_ID_GET - for a particular user this returns ID of the folder, which belongs to the "shared folder" folder in SBWP. Then you can play around with FM SO_DOCUMENT_INSERT of the binary / hex data to the specific folder (parameter parent_id specifies, where to put the file). So probably here is your first problem - you want to upload the files in background, which means first generating it (I suppose you have already the .xml data).

    3. if shared folder is something on the network (not SBWP shared folder), once you have got mapped the folder and enough authorization, you can upload it using OPEN DATASET... In this case searching for solution should be your first step.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 21, 2014 at 06:20 AM

    Hi Tousif,

    A file can be saved on desktop/presentation server only when the program is run in foreground using GUI_Download.

    Are you try to download a file to desktop in background job ?

    If your answer is yes .. please check the below link

    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/9831750a-0801-0010-1d9e-f8c64efb2bd2?quicklink=index&…

    Regards,

    Sivaganesh

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 21, 2014 at 07:17 AM

    Hi,

    Ayyam has provided the correct solution above.

    You need to configure the network folder to SAP system using T-Code AL11.

    After which you can use DATASET statement normally for the folder.

    Regards,

    Ashish

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 05, 2014 at 07:58 AM

    Hi Everyone,

    I have had a big discussion with my BASIS team on it and the solution for this is to Place the files in Application server itself. These files will be then extracted from the Application server to the Network Drive through a small Unix program(written by the Unix team).

    So in this case the files which will be stored in Application server will get physically present in Network Drive.

    Best Regards,

    Tousif

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.