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

Bulk upload in Services for Object

Former Member
0 Likes
2,621

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

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

Clemenss
Active Contributor
0 Likes
1,371

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

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,371

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

Read only

0 Likes
1,371

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

Read only

0 Likes
1,371

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.