<?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: Problem reading in  binary file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-reading-in-binary-file/m-p/902224#M55406</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using OPEN DATASET dsn IN BINARY MODE?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Apr 2005 19:55:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-04-11T19:55:01Z</dc:date>
    <item>
      <title>Problem reading in  binary file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-reading-in-binary-file/m-p/902222#M55404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm sending a zip file that I receive from ISA to a 3rd party archiving system (IXOS).  When I test this on my local pc using WS_UPLOAD to upload the file it works.  The arcived zip file is fine and I am able to view it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I read in the zip file from the network using the "OPEN Dataset" statement the resulting archived document cannot be opened.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I read in the data to the table pass it to the function module and also specify a length ( received from ISA as  an input parameter to my function module).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The archiving function module takes a parameter table where the data is in char format.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case when I try to look at the archived document it tells me the file is not a valid zip file and I can't view it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried reading the file into an internal table where the data is in "RAW" format - that didn't work.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am also geting different numbers for the length of the file.  The java passes in a number that is different than I get when count the bytes in the reading in of the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody guide me in the right direction on how to handle binary files?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2005 16:45:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-reading-in-binary-file/m-p/902222#M55404</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-11T16:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem reading in  binary file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-reading-in-binary-file/m-p/902223#M55405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Brent,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normally the reason for not able to open the file after uploading from a network using 'Open dataset' is to do with the file size not correctly being derived.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For files uploaded as binary I use the following code;&lt;/P&gt;&lt;P&gt;  open dataset file for input.&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;   do.&lt;/P&gt;&lt;P&gt;    read dataset file into att_cont length len.&lt;/P&gt;&lt;P&gt;    append att_cont. clear att_cont.&lt;/P&gt;&lt;P&gt;    if sy-subrc &amp;lt;&amp;gt; 0. exit. endif. "--&amp;gt; SAPnote# 564796&lt;/P&gt;&lt;P&gt;   enddo.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  close dataset file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the above mentioned way of upload will give you the right size of the file in the len field. The reason why the check is moved after append is in the note.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2005 19:33:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-reading-in-binary-file/m-p/902223#M55405</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-11T19:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem reading in  binary file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-reading-in-binary-file/m-p/902224#M55406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using OPEN DATASET dsn IN BINARY MODE?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2005 19:55:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-reading-in-binary-file/m-p/902224#M55406</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-11T19:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem reading in  binary file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-reading-in-binary-file/m-p/902225#M55407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the help.  In looking at your code sample, I found that my problem was that I had my append statement AFTER the check of the return code in the read statement.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apparently, this was leaving my file table without that last partial row of data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2005 19:56:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-reading-in-binary-file/m-p/902225#M55407</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-11T19:56:04Z</dc:date>
    </item>
  </channel>
</rss>

