<?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 Re: Problems with CONTENT_HEX in SO_DOCUMENT_READ_API1 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-content-hex-in-so-document-read-api1/m-p/9462761#M1742762</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alejandro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need the text that is retrieved in&amp;nbsp; &lt;STRONG&gt;it_content&lt;/STRONG&gt; internal table inorder to display the same in a smartform. While reading a docx document attached to Purchase Requistion, ME53N tcode, the internal table contains garbage values. Although it is reading contents of attached notepad file correctly into the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;CALL &lt;SPAN class="L0S52"&gt;FUNCTION &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'SO_DOCUMENT_READ_API1'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;EXPORTING&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; document_id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'FOL39000000000004EXT40000000000110'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; filter&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;zlc_x&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;IMPORTING&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; document_data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;wa_data&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;tables&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; object_content&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;it_content&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; contents_hex&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;it_solix&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;Can you help regarding this issue?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;Rohan D Kannikar&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Mar 2015 06:12:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2015-03-20T06:12:57Z</dc:date>
    <item>
      <title>Problems with CONTENT_HEX in SO_DOCUMENT_READ_API1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-content-hex-in-so-document-read-api1/m-p/9462757#M1742758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I developed a program which uses GOS attachments list to allow attachment of files. In a subsequent step, those attachments must be read and processed. So, I read the file contents using (according to note 927407) class CL_BINARY_RELATION and afterwards function module SO_DOCUMENT_READ_API1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that when processing those contents, files end up damaged. It happens particularily with DOCX / PPTX / XLSX files (newer office formats).&lt;/P&gt;&lt;P&gt;If I download (using GUI_DOWNLOAD) or email (using CL_DOCUMENT_BCS-&amp;gt;ADD_ATTACHMENT) those files, upon opening the corresponding office applications warn that the file is damaged, and repair it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Comparing CONTENT_HEX with the DATA_TAB from GUI_UPLOAD of the same file (DIFF tool in debugger), I've narrowed the difference to the last bytes of the table. On GUI_UPLOAD one (undamaged file), the end is "0000000000...", while the one returned by SO_DOCUMENT_READ_API1 is "0202020202..."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've seen that inside SO_DOCUMENT_READ_API1, the hex content is filled up using the text content, by function module SO_SOLITAB_TO_SOLIXTAB.&lt;/P&gt;&lt;P&gt;I've tried to work around this by converting myself instead using CL_BCS_CONVERT=&amp;gt;SOLI_TO_SOLIX, but the same happens.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've run out of ideas and found no SMP note on this so if anyone else had the same problem, please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 20:19:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-content-hex-in-so-document-read-api1/m-p/9462757#M1742758</guid>
      <dc:creator>alejandro_bindi</dc:creator>
      <dc:date>2013-05-30T20:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with CONTENT_HEX in SO_DOCUMENT_READ_API1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-content-hex-in-so-document-read-api1/m-p/9462758#M1742759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SOLVED: The problem actually was the size calculation.&lt;/P&gt;&lt;P&gt;On GUI_DOWNLOAD, I was calculating wrongly myself.&lt;/P&gt;&lt;P&gt;On CL_DOCUMENT_BCS-&amp;gt;ADD_ATTACHMENT, the standard method called COUNT_DOC_SIZE is wrong!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution is to always use DOCUMENT_DATA-DOC_SIZE returned by SO_DOCUMENT_READ_API1, instead of calculating. Of course, COUNT_DOC_SIZE should be corrected, but I found no note.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 21:20:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-content-hex-in-so-document-read-api1/m-p/9462758#M1742759</guid>
      <dc:creator>alejandro_bindi</dc:creator>
      <dc:date>2013-05-30T21:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with CONTENT_HEX in SO_DOCUMENT_READ_API1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-content-hex-in-so-document-read-api1/m-p/9462759#M1742760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alejandro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With refrence to your post regarding conversion error issues while reading docx/pptx/xlsx files using SO_DOCUMENT_READ_API1 , could you elaborate on the solution you found for the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I too am facing the same issue, while reading the content in docx file attached to Purchase requisition (ME53N) attachment list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The DOCUMENT_DATA-DOC_SIZE parameter is just being retunrned by the FM, so how did it solve the issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rohan D Kannikar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2015 12:34:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-content-hex-in-so-document-read-api1/m-p/9462759#M1742760</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-03-19T12:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with CONTENT_HEX in SO_DOCUMENT_READ_API1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-content-hex-in-so-document-read-api1/m-p/9462760#M1742761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rohan, as I said in my latest post, as long as you use DOCUMENT_DATA-DOC_SIZE for either task (downloading or emailing), you should be fine since it is calculated correctly. Pass that variable along with your binary (typed x) internal table which holds the contents to the output method / f.m.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2015 15:13:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-content-hex-in-so-document-read-api1/m-p/9462760#M1742761</guid>
      <dc:creator>alejandro_bindi</dc:creator>
      <dc:date>2015-03-19T15:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with CONTENT_HEX in SO_DOCUMENT_READ_API1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-content-hex-in-so-document-read-api1/m-p/9462761#M1742762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alejandro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need the text that is retrieved in&amp;nbsp; &lt;STRONG&gt;it_content&lt;/STRONG&gt; internal table inorder to display the same in a smartform. While reading a docx document attached to Purchase Requistion, ME53N tcode, the internal table contains garbage values. Although it is reading contents of attached notepad file correctly into the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;CALL &lt;SPAN class="L0S52"&gt;FUNCTION &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'SO_DOCUMENT_READ_API1'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;EXPORTING&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; document_id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'FOL39000000000004EXT40000000000110'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; filter&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;zlc_x&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;IMPORTING&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; document_data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;wa_data&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;tables&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; object_content&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;it_content&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; contents_hex&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;it_solix&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;Can you help regarding this issue?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;Rohan D Kannikar&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 06:12:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-content-hex-in-so-document-read-api1/m-p/9462761#M1742762</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-03-20T06:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with CONTENT_HEX in SO_DOCUMENT_READ_API1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-content-hex-in-so-document-read-api1/m-p/9462762#M1742763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rohan, yours is a different kind of problem then. You are basically trying to read a file as plain text which is NOT plain text. You would have the same exact issue if you uploaded that word file from your PC using GUI_UPLOAD instead of reading it from the system by SO_DOCUMENT_READ_API1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Most probably you could try using OLE/DOI to interpret the file (research about interface I_OI_WORD_PROCESSOR_DOCUMENT), or since it's a DOCX file, maybe there are some XSLT transformations available to extract the text. I haven't used those methods though so I can't provide more info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2015 22:01:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-content-hex-in-so-document-read-api1/m-p/9462762#M1742763</guid>
      <dc:creator>alejandro_bindi</dc:creator>
      <dc:date>2015-03-23T22:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with CONTENT_HEX in SO_DOCUMENT_READ_API1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-content-hex-in-so-document-read-api1/m-p/9462763#M1742764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rohan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have found solution for same let me know.&lt;/P&gt;&lt;P&gt;As I am also facing same problem while reading XML attachment in class CL_DOCUMENT_BCS.&lt;/P&gt;&lt;P&gt;while reading &lt;SPAN style="color: #333333; font-size: 12px;"&gt;contents_hex values &lt;/SPAN&gt;I am getting garbage values like '0000000000000' at end of string.&lt;/P&gt;&lt;P&gt;I tried to convert the xstring values to string&lt;/P&gt;&lt;P&gt;and those values became '################################' .&lt;/P&gt;&lt;P&gt;But couldn't remove same using all standard process.&lt;/P&gt;&lt;P&gt;like &lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;1) REPLACE all occurrences of '##' IN: &lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; text1 WITH '&amp;nbsp; ' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;2) TRANSLATE text1&amp;nbsp; using&amp;nbsp; '##&amp;nbsp;&amp;nbsp; '.&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;However if I copy same string to normal se38 editor and apply above mentioned approach it works.&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;If you have identified the solution for same let me know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Apr 2015 16:02:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-content-hex-in-so-document-read-api1/m-p/9462763#M1742764</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-04-10T16:02:37Z</dc:date>
    </item>
  </channel>
</rss>

