<?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: Upload word document into internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-word-document-into-internal-table/m-p/2708764#M627728</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;I tried but doesnot work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am basically using this to upload document and then convert to a binary data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Narayani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Aug 2007 10:28:39 GMT</pubDate>
    <dc:creator>Nkrish</dc:creator>
    <dc:date>2007-08-13T10:28:39Z</dc:date>
    <item>
      <title>Upload word document into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-word-document-into-internal-table/m-p/2708761#M627725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using GUI_UPLOAD function module to upload a word document.&lt;/P&gt;&lt;P&gt;I am setting the file type as ASC ( is this correct) ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I test the function module with the word file that I upload it shows junk characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Narayani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 09:26:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-word-document-into-internal-table/m-p/2708761#M627725</guid>
      <dc:creator>Nkrish</dc:creator>
      <dc:date>2007-08-13T09:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Upload word document into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-word-document-into-internal-table/m-p/2708762#M627726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There shouldn't be any problem in that case..... Please check the file type...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a sample code........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Textual upload&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;           begin of itab, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                 text(255) type c, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           end of itab occurs 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           CALL FUNCTION 'GUI_UPLOAD' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           exporting &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;              filetype = 'ASC' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;              filename = 'C:\DOWNLOAD.TXT' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           tables &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;             data_tab = itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 09:32:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-word-document-into-internal-table/m-p/2708762#M627726</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-13T09:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Upload word document into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-word-document-into-internal-table/m-p/2708763#M627727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are uploading a ".doc" file, then it is quite likely to look like jibberish as M/S Word saves documents in its own special way (open one on your desktop using Notepad to see  this!).  Perhaps try saving the document as an RTF and doing the upload - that should look a lot more reasonable (i.e. it should have no special low-hex characters etc).  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But (a) why are you uploading a word document and (b) if you have to attach it to something and extract it again later, I think "BIN" would be a better options so you don't introduce unwanted characters when you download it again later.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 09:51:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-word-document-into-internal-table/m-p/2708763#M627727</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-13T09:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: Upload word document into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-word-document-into-internal-table/m-p/2708764#M627728</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;I tried but doesnot work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am basically using this to upload document and then convert to a binary data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Narayani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 10:28:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-word-document-into-internal-table/m-p/2708764#M627728</guid>
      <dc:creator>Nkrish</dc:creator>
      <dc:date>2007-08-13T10:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: Upload word document into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-word-document-into-internal-table/m-p/2708765#M627729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Narayani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to upload a word-document in the native word format it is the best to do this directly in binary format (BIN). Important here is to take the binary_filesize back from the gui_upload (either function module or cl_gui_frontend_services). Uploading it directly in binary format avoids later conversion.&lt;/P&gt;&lt;P&gt;For conversion to xstring and back from xstring to binary table you can use function modules SCMS_BINARY_TO_XSTRING and SCMS_XSTRING_TO_BINARY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 10:41:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-word-document-into-internal-table/m-p/2708765#M627729</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-13T10:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: Upload word document into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-word-document-into-internal-table/m-p/2708766#M627730</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;I did the same thing. But when I download this binary file back to word I see junk characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did a gui_upload,&lt;/P&gt;&lt;P&gt;took the binary file size,&lt;/P&gt;&lt;P&gt;used SCMS_BINARY_TO_XSTRING &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Narayani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 11:01:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-word-document-into-internal-table/m-p/2708766#M627730</guid>
      <dc:creator>Nkrish</dc:creator>
      <dc:date>2007-08-13T11:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Upload word document into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-word-document-into-internal-table/m-p/2708767#M627731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Narayani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in case you are working with up- and download in binary mode you always need to read/supply the filesize, otherwise the trailing zeros in the last table line may damage the original file. This file length you also need to supply for the conversion from binary table to xstring (so that the conversion eliminates the trailing zeros of the last line). Before converting back the xstring back to a binary table for download you can use xstrlen to determine the length of the xstring and supply this length for the download.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course you can keep the file in the binary table and remember the file length you've got from the upload. The conversion might just be of interest in case you store it in the database and maybe want to put the file into a http-response or you need the file in an xstring for some other reason.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 12:42:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-word-document-into-internal-table/m-p/2708767#M627731</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-13T12:42:10Z</dc:date>
    </item>
  </channel>
</rss>

