07-12-2015 10:22 AM
Hi,
I have a requirement where we are going to attach a document (pdf, gif, png, bmp, jpg) from Application server to a sap document (invoice, contracts).
I was able to successfully link/attach the document to the invoice. The problem is when i tried to open the attachment i am getting an error "file is damaged and could not be repaired", this is for PDF.
This is what I did in my custom program:
* get the document from app server (AL11).
* get the content using OPEN, READ, CLOSE Dataset.
* Convert XSTRING (from al11) to Binary using SCMS_XSTRING_TO_BINARY
* Use FM SO_FOLDER_ROOT_ID_GET
* Use FM SO_OBJECT_INSERT
* Use BINARY_RELATION_CREATE_COMMIT.
Any ideas on how to address the issue?
Thanks,
Isaac
07-13-2015 2:32 AM
Hello Isaac,
I would suggest you to implement note #1430123 and check if it works.
Best Regards,
Wen Peng