Application Development 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: 

Bulk upload in Services for Object

Former Member
0 Kudos

Hi Experts,

I want to upload documents using services for object facility in SAP. I tried with CALL METHOD lo_gos->create_attachment, but user has to manually select a file from the popup. Is there any FM which uploads data if I provide file name and document number in an Excel file? I used BAPI_DOCUMENT_CREATE2 in DMS for bulk upload.

Regards,

Sam

4 REPLIES 4

Clemenss
Active Contributor
0 Kudos

I don't think there is anything readily available.

But you can write a program for it.

Hint: Read a directory first and then upload all files found there.

Regards,

Clemens

raymond_giuseppi
Active Contributor
0 Kudos

Check 's answer in Attach multiple files in GOS.

(You could also try to replace FM BINARY_RELATION_CREATE with Method CL_BINARY_RELATION=>CREATE_LINK.)

Regards,

Raymond

0 Kudos

Hi Raymond,

Thanks for your valuable input. I have used call function 'BINARY_RELATION_CREATE_COMMIT'. Document is getting uploaded but if we double click on this attachment an export to popup window is getting displayed instead of the file getting opened directly. If we save this file to desktop and open it separately, it gets opened. How to rectify this?

Regards,

Sibin

0 Kudos

HI,

"Document is getting uploaded but if we double click on this attachment an export to popup window is getting displayed instead of the file getting opened directly".

This is because you have not uploaded it correctly( check file extension, you will have to translate it to upper case  etc etc ). If every thing is fine it will open correctly.

If you are not ready to try hard 😉 , then for easy solution you can also have a look at , the include macro is different in my code and the file extension is identified differently.