Application Development and Automation 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: 
Read only

Program Custom Upload attachment

jandrivay
Participant
0 Likes
4,302

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 ^^.

8 REPLIES 8
Read only

shiromani_soni1
Active Participant
0 Likes
3,062

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

Read only

Sandra_Rossi
Active Contributor
0 Likes
3,062

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:

  1. Read the file from the user's laptop into memory (you can find snippets easily)
  2. Use CL_BDS_DOCUMENT_SET to write the file (you can find snippets easily)
Read only

jandrivay
Participant
0 Likes
3,062

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.

Read only

MateuszAdamus
Active Contributor
3,062

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,
Mateusz
Read only

Sandra_Rossi
Active Contributor
3,062

jandrivay Did you search CL_BDS_DOCUMENT_SET? Do you have issues with those snippets?

Read only

jandrivay
Participant
0 Likes
3,062

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

Read only

Sandra_Rossi
Active Contributor
0 Likes
3,062

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.

Read only

MateuszAdamus
Active Contributor
0 Likes
3,062

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.


Kind regards,
Mateusz