‎2020 Jun 09 2:30 AM
Hi all,
Is there a way to make program Z to upload attachment like ,word,excel,ppt,jpeg,pdf to server SAP, and we can download this file ??
i just try upload program from tcode OAOR , standard BDS SAP and then i read my file from Z custom.
but i dont know how to make program upload this file..
if you have a way, I'm very happy if you can share ^^.
‎2020 Jun 09 3:16 AM
Hi Steward,
If you want to upload files from presentation server, you can use GUI_UPLOAD in your program and place them on AL11(Application server), and you can download whenever needed using Open Dataset and Close Dataset.
https://answers.sap.com/questions/10997529/download-and-upload-of-file-to-server-dir-al11.html
Please let me know if this helps.
Regards,
Shiromani Soni
‎2020 Jun 09 8:51 AM
I guess you mean upload a file stored in user's laptop. If you want to upload it to OAOR, the same way as a user does it manually:
‎2020 Jun 10 2:46 AM
Hi sandra.rossi ,
do you have a sample program using that class method ?
im just see Function Module when i save and debug from OAOR like this.

‎2020 Jun 10 7:41 AM
Hello jandrivay
What exactly do you want to achieve?
Upload a file in a Z* report with relation to an existing SAP document (Sales Order, Invoice, etc)?
Upload a file in a Z* report (without relation to a document) and be able to download it when needed?
Kind regards,‎2020 Jun 10 7:50 AM
jandrivay Did you search CL_BDS_DOCUMENT_SET? Do you have issues with those snippets?
‎2020 Jun 11 2:22 AM
Hi mateusz_adamus_dd
Yes, i want to create program Z* with feature attach file ( pdf,word,excel,ppt, image ) to server SAP, and then i will create program to download that files.
im just read some website how to upload that files and i refer to BDS tcode OAOR.
Hi, sandra.rossi
I've tried debugging, but I haven't found where the file is saved, and the process >.<
cause it tcode standard
‎2020 Jun 11 7:43 AM
Why debugging? I'm telling you to search the web, there are existing snippets to write documents to BDS. Just search CL_BDS_DOCUMENT_SET.
‎2020 Jun 11 11:34 AM
Hello jandrivay
If you want to just upload/download files from the application server (without attaching them to SAP documents) then have a look at Shiromani's answer. Look for CL_GUI_FRONTEND_SERVICES class with GUI_UPLOAD/GUI_DOWNLOAD methods and for the OPEN DATASET ABAP keyword.