<?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>Question Re: Input file through webservice - binary content in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/input-file-through-webservice-binary-content/qaa-p/12219116#M4573402</link>
    <description>&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;In case someone else need it : carriage return AND line feed are needed (I had only one of them). This means, you need to add " \r\n " at the end of each item of the file. &lt;/P&gt;</description>
    <pubDate>Fri, 13 Nov 2020 12:38:26 GMT</pubDate>
    <dc:creator>solene_roques</dc:creator>
    <dc:date>2020-11-13T12:38:26Z</dc:date>
    <item>
      <title>Input file through webservice - binary content</title>
      <link>https://community.sap.com/t5/technology-q-a/input-file-through-webservice-binary-content/qaq-p/12219115</link>
      <description>&lt;P&gt;Hello everyone, &lt;/P&gt;
  &lt;P&gt;I created a webservice for the standard BO CompanyPaymentFileRegister in order to generate Inbound bankstatement file through PDI. I manage to generate the txt file. The binary content is generated with the function Binary.ParseFromString.&lt;/P&gt;
  &lt;P&gt;The inbound file and text file are correctly created :&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1849946-2020-10-07-15h55-59.png" /&gt;&lt;/P&gt;
  &lt;P&gt;(so far so good)&lt;/P&gt;
  &lt;P&gt;However when I tried to Start File Upload, the following error message pops up: &lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1849949-2020-10-07-16h01-29.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG alt="" /&gt;&lt;/P&gt;
  &lt;P&gt;It can be any error in the content. But strange thing : &lt;STRONG&gt;if I download the txt file generated above, copy paste it into a new txt file without making any change, and upload it manually and click on "Start file upload" everything works fine. &lt;/STRONG&gt; &lt;/P&gt;
  &lt;P&gt;It make me thinks that the the issue in not due to the "visible content" but to a file characteristic (mimeCode....) or maybe to the carriage return. I use&lt;STRONG&gt; \n&lt;/STRONG&gt; is it the correct one for conversion into binary and upload in SAP ByD ? &lt;/P&gt;
  &lt;P&gt;Thanks for any lead,&lt;/P&gt;
  &lt;P&gt;Best regards,&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;Edit : &lt;/STRONG&gt;additional information, some SAP blogs indicate that Binary file content are Base64 encoded string so I tried the following absl code : &lt;/P&gt;
  &lt;P&gt;body is a basic string.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1850490-2020-10-08-10h38-45.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Base64 string is not valid for BinaryObject.content field.&lt;/P&gt;
  &lt;P&gt;I also stried to assign binary value to BinaryObject.content. &lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;var binary = Library::Binary.ParseFromString(body);
doc.FileContent.BinaryObject.content = binary;
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;In studio : no error. In the debugger, we can see the values : &lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1850491-2020-10-08-10h45-30.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Is binary supposed to look like this ? &lt;/P&gt;
  &lt;P&gt;With this code I end up in the situation described above : inbound file created, error message if I release it but if I copy paste it into a new txt file without change, it gets proceeded. &lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 14:10:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/input-file-through-webservice-binary-content/qaq-p/12219115</guid>
      <dc:creator>solene_roques</dc:creator>
      <dc:date>2020-10-07T14:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Input file through webservice - binary content</title>
      <link>https://community.sap.com/t5/technology-q-a/input-file-through-webservice-binary-content/qaa-p/12219116#M4573402</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;In case someone else need it : carriage return AND line feed are needed (I had only one of them). This means, you need to add " \r\n " at the end of each item of the file. &lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 12:38:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/input-file-through-webservice-binary-content/qaa-p/12219116#M4573402</guid>
      <dc:creator>solene_roques</dc:creator>
      <dc:date>2020-11-13T12:38:26Z</dc:date>
    </item>
  </channel>
</rss>

