<?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 in uploading file from application server in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758527#M328433</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you don't have any separators, i assume it must be a fixed length file.&lt;/P&gt;&lt;P&gt;i.e. for example, the first 10 characters are the field1 , the next 5 chracters are field2 etc.So, you have to define an internal table with exactly the same structure.&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;           field1(10),&lt;/P&gt;&lt;P&gt;          field2(5),&lt;/P&gt;&lt;P&gt;          field3(15),&lt;/P&gt;&lt;P&gt;        end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you can simple use the following commands:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read dataset dsn for input in text mode.&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 dsn into itab.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;clear itab.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;exit.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;close dataset dsn.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Dec 2006 14:01:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-21T14:01:31Z</dc:date>
    <item>
      <title>Problem in uploading file from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758521#M328427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a file on the Applicatioin server, I want to upload it but the format of the file is not having any separator values. I am finding difficult to upload it.&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;P&gt;D0000000000825000C000000016494458120066&lt;/P&gt;&lt;P&gt;000000521174706832006110120061101CAS CHQ XFER WD          TRF TO 0052117555252      BY TR                                            000217063                                         D0000000001627800C000000016331678120066&lt;/P&gt;&lt;P&gt;000000521174706832006110120061101CAS CHQ XFER WD          TRF TO 0052117555252      BY TR                                            000217070                             &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please tell me how to upload it,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2006 13:40:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758521#M328427</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-21T13:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in uploading file from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758522#M328428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Line &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U have to know the structure of that file, for ex.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: BEGIN OF W_FILE OCCURS 0,
              FIELD1,
              FIELD2,
              FIELD3,
              ...........,
              FIELDN,
           END    OF W_FILE.

OPEN DATASET &amp;lt;FILE&amp;gt; FOR OUTPUT IN TEXT MODE.

DO.
   READ DATASET &amp;lt;FIELD&amp;gt; INTO W_FILE.
   IF SY-SUBRC &amp;lt;&amp;gt; 0. EXIT. ENDIF.
   APPEND W_FILE.
ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2006 13:47:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758522#M328428</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-21T13:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in uploading file from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758523#M328429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Have look at these links, this will have some programs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://sap.ittoolbox.com/code/archives.asp?d=3095&amp;amp;a=s&amp;amp;i=10" target="test_blank"&gt;http://sap.ittoolbox.com/code/archives.asp?d=3095&amp;amp;a=s&amp;amp;i=10&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/file/file_uptabsap.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/file/file_uptabsap.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/file/file_getdirfiles.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/file/file_getdirfiles.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2006 13:48:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758523#M328429</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-21T13:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in uploading file from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758524#M328430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now, from application server u get the data into internal table which is like a string(600).&lt;/P&gt;&lt;P&gt;loop at internal table.&lt;/P&gt;&lt;P&gt;  itab-field1 = int+0(6).&lt;/P&gt;&lt;P&gt;  itab-field2 = int+6(10).............&lt;/P&gt;&lt;P&gt;  append itab.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here each record is of fixed length. so check at what point u need to split the string into field values and do it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2006 13:48:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758524#M328430</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-21T13:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in uploading file from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758525#M328431</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;reading files on application server is not called UPLOAD because UPLOAD usually implies transfer from one system (i.e. presentation server) to another system (application server) via network.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can define a string and read the whole file at once and later split it into records of an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your example looks like records (separated by &amp;lt;NEWLINE&amp;gt;) with records of different length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;OPEN DATASET ... IN CHARACTER MODE ENCODING DEFAULT.
DO.
READ DATASET ... INTO lv_string.
  IF SY-SUBRC &amp;lt;&amp;gt; 0.
    EXIT.
  ENDIF.
  CASE lv_string(02).
    WHEN 'D0'.
* process...D0 way
    WHEN '00'.
* process...00 way
  ENDCASE.
ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this wokrs for you although kind of symbolic code.&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;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2006 13:50:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758525#M328431</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2006-12-21T13:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in uploading file from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758526#M328432</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 am getting the record as a string I want to split that record and save it in excel file again. How to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2006 13:54:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758526#M328432</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-21T13:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in uploading file from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758527#M328433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you don't have any separators, i assume it must be a fixed length file.&lt;/P&gt;&lt;P&gt;i.e. for example, the first 10 characters are the field1 , the next 5 chracters are field2 etc.So, you have to define an internal table with exactly the same structure.&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;           field1(10),&lt;/P&gt;&lt;P&gt;          field2(5),&lt;/P&gt;&lt;P&gt;          field3(15),&lt;/P&gt;&lt;P&gt;        end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you can simple use the following commands:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read dataset dsn for input in text mode.&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 dsn into itab.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;clear itab.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;exit.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;close dataset dsn.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2006 14:01:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758527#M328433</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-21T14:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in uploading file from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758528#M328434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting the file in the proper format but I need to keep '~' between the fields and store it in another file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parvez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Dec 2006 05:19:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758528#M328434</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-22T05:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in uploading file from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758529#M328435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;field1(11),   "inc field length by 1 fior all fields&lt;/P&gt;&lt;P&gt;field2(6),&lt;/P&gt;&lt;P&gt;field3(16),&lt;/P&gt;&lt;P&gt;end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addtiion  to RAvi's reply,once u have data in Itab.&lt;/P&gt;&lt;P&gt; loop at itab.&lt;/P&gt;&lt;P&gt;itab-filed1+9(1) = '~'&lt;/P&gt;&lt;P&gt;...........&lt;/P&gt;&lt;P&gt;........&lt;/P&gt;&lt;P&gt;modify itab.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then to writ this table to another file use - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; OPEN DATASET P_DSNI FOR OUTPUT IN LEGACY TEXT MODE.&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;TRANSFER ITAB TO P_DSNI.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;close datset p_dsni..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps..&lt;/P&gt;&lt;P&gt;reward points if helpfull&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Dec 2006 05:33:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758529#M328435</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-22T05:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in uploading file from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758530#M328436</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;You can read the single line and then replace the space by ~ and store it in another file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On seeing the output you specified,it seems space is used in between two fields.&lt;/P&gt;&lt;P&gt;    REPLACE ALL OCCURRENCES OF ' ' IN v_line WITH ' ~'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here v_line should contain the each line before this statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Dec 2006 05:43:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758530#M328436</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2006-12-22T05:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in uploading file from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758531#M328437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Line,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you just want to read and write the file without really changing the content then  ask your basis people to do that on file system level using unix GREP command for the '~' insertion. What could possibly be the reason for processing in SAP/ABAP?&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;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Dec 2006 09:55:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758531#M328437</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2006-12-22T09:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in uploading file from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758532#M328438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  if you want to have a ~ in between the fields of the internal table, you can do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab_new occurs 0,&lt;/P&gt;&lt;P&gt;          data(400),&lt;/P&gt;&lt;P&gt;      end of itab.&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;concatenate itab-field1 itab-field2 itab-field3 into itab_new-data separated by '~'.&lt;/P&gt;&lt;P&gt;append itab_new.&lt;/P&gt;&lt;P&gt;clear itab_new.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Dec 2006 09:59:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-uploading-file-from-application-server/m-p/1758532#M328438</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-22T09:59:12Z</dc:date>
    </item>
  </channel>
</rss>

