04-22-2013 8:26 AM
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
04-22-2013 2:03 PM
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
04-22-2013 2:08 PM
Check Kesavadas Thekkillath'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
04-23-2013 6:00 AM
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
04-23-2013 7:31 AM
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.