<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Attachment file error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/attachment-file-error/m-p/11166140#M1907855</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I did in my custom program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* get the document from app server (AL11).&lt;/P&gt;&lt;P&gt;* get the content using OPEN, READ, CLOSE Dataset.&lt;/P&gt;&lt;P&gt;* Convert XSTRING (from al11) to Binary using SCMS_XSTRING_TO_BINARY&lt;/P&gt;&lt;P&gt;* Use FM SO_FOLDER_ROOT_ID_GET&lt;/P&gt;&lt;P&gt;* Use FM SO_OBJECT_INSERT&lt;/P&gt;&lt;P&gt;* Use BINARY_RELATION_CREATE_COMMIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on how to address the issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Isaac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Jul 2015 09:22:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2015-07-12T09:22:01Z</dc:date>
    <item>
      <title>Attachment file error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/attachment-file-error/m-p/11166140#M1907855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I did in my custom program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* get the document from app server (AL11).&lt;/P&gt;&lt;P&gt;* get the content using OPEN, READ, CLOSE Dataset.&lt;/P&gt;&lt;P&gt;* Convert XSTRING (from al11) to Binary using SCMS_XSTRING_TO_BINARY&lt;/P&gt;&lt;P&gt;* Use FM SO_FOLDER_ROOT_ID_GET&lt;/P&gt;&lt;P&gt;* Use FM SO_OBJECT_INSERT&lt;/P&gt;&lt;P&gt;* Use BINARY_RELATION_CREATE_COMMIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on how to address the issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Isaac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Jul 2015 09:22:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/attachment-file-error/m-p/11166140#M1907855</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-07-12T09:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Attachment file error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/attachment-file-error/m-p/11166141#M1907856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Isaac,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest you to implement note #1430123 and check if it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Wen Peng&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 01:32:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/attachment-file-error/m-p/11166141#M1907856</guid>
      <dc:creator>peng_wen</dc:creator>
      <dc:date>2015-07-13T01:32:50Z</dc:date>
    </item>
  </channel>
</rss>

