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: 

Attachment file error

Former Member
0 Kudos

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

1 REPLY 1

peng_wen
Active Participant
0 Kudos

Hello Isaac,

I would suggest you to implement note #1430123 and check if it works.

Best Regards,
Wen Peng