<?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: File upload from application server in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload-from-application-server/m-p/2116873#M443180</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;&amp;lt;i&amp;gt;Nothing will happen when u dont have any operation on that file after wards..&lt;/P&gt;&lt;P&gt;If u have not closed the file which is opened for READ purpose , but afterwards u have opened the same file for WRITE purpose.. then it OVERWRITES the file or From the line at which the reading has been stopped..!!!&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;check the below program !!&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following program shows how the system sets the position when you open a file for writing. However, it is better programming style to close files that are already open before you reopen them for a different operation (for further information about closing files, refer to Closing a File).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA FNAME(60) VALUE 'myfile'.&lt;/P&gt;&lt;P&gt;DATA NUM TYPE I.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET FNAME FOR OUTPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO 10 TIMES.&lt;/P&gt;&lt;P&gt;  NUM = NUM + 1.&lt;/P&gt;&lt;P&gt;  TRANSFER NUM TO FNAME.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM INPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET FNAME FOR OUTPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NUM = 0.&lt;/P&gt;&lt;P&gt;DO 5 TIMES.&lt;/P&gt;&lt;P&gt;  NUM = NUM + 10.&lt;/P&gt;&lt;P&gt;  TRANSFER NUM TO FNAME.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM INPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOSE DATASET FNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET FNAME FOR OUTPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NUM = 0.&lt;/P&gt;&lt;P&gt;DO 5 TIMES.&lt;/P&gt;&lt;P&gt;  NUM = NUM + 20.&lt;/P&gt;&lt;P&gt;  TRANSFER NUM TO FNAME.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM INPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM INPUT.&lt;/P&gt;&lt;P&gt;  SKIP.&lt;/P&gt;&lt;P&gt;  OPEN DATASET FNAME FOR INPUT.&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;    READ DATASET FNAME INTO NUM.&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    WRITE / NUM.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output appears as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;6&lt;/P&gt;&lt;P&gt;7&lt;/P&gt;&lt;P&gt;8&lt;/P&gt;&lt;P&gt;9&lt;/P&gt;&lt;P&gt;10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10&lt;/P&gt;&lt;P&gt;20&lt;/P&gt;&lt;P&gt;30&lt;/P&gt;&lt;P&gt;40&lt;/P&gt;&lt;P&gt;50&lt;/P&gt;&lt;P&gt;6&lt;/P&gt;&lt;P&gt;7&lt;/P&gt;&lt;P&gt;8&lt;/P&gt;&lt;P&gt;9&lt;/P&gt;&lt;P&gt;10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;20&lt;/P&gt;&lt;P&gt;40&lt;/P&gt;&lt;P&gt;60&lt;/P&gt;&lt;P&gt;80&lt;/P&gt;&lt;P&gt;100&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This example performs the following steps using the file "myfile":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;==&amp;gt;It is opened for writing &lt;/P&gt;&lt;P&gt;==&amp;gt;It is filled with 10 integers (for information about the TRANSFER statement, refer to Writing Data to Files) &lt;/P&gt;&lt;P&gt;==&amp;gt;It is then opened for reading. The position is reset accordingly to the beginning of the file. &lt;/P&gt;&lt;P&gt;==&amp;gt;It is read into the field NUM. For information about the READ DATASET statement, refer to Reading Data from Files. The values of NUM are displayed on the screen. &lt;/P&gt;&lt;P&gt;==&amp;gt;It is reopened for writing The position is reset to the beginning of the file. &lt;/P&gt;&lt;P&gt;==&amp;gt;It is filled with five integers, which overwrite the previous contents of the file. &lt;/P&gt;&lt;P&gt;==&amp;gt;It is then reopened for reading. The position is reset to the beginning of the file. &lt;/P&gt;&lt;P&gt;==&amp;gt;The file is read into the field NUM. The values of NUM are displayed on the screen. &lt;/P&gt;&lt;P&gt;==&amp;gt;It is closed (for information about the CLOSE DATASET statement, refer to Closing a File). &lt;/P&gt;&lt;P&gt;==&amp;gt;It is then reopened for writing. The system deletes the existing contents of the file. &lt;/P&gt;&lt;P&gt;==&amp;gt;It is filled with 5 integers. &lt;/P&gt;&lt;P&gt;==&amp;gt;It is then opened for reading. The position is reset to the beginning of the file. &lt;/P&gt;&lt;P&gt;==&amp;gt;The file is read into the field NUM. The values of NUM are displayed on the screen. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;sai ramesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Apr 2007 05:35:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-18T05:35:48Z</dc:date>
    <item>
      <title>File upload from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload-from-application-server/m-p/2116872#M443179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;  I am uploading the file from application server,i am using Open dataset...&lt;/P&gt;&lt;P&gt;  Read dataset... and close dataset.My question is ,if we donot use the close dataset after reading the file then what will be the effect?Beacuse code is successfully activated and executed without using it in code .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 05:32:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload-from-application-server/m-p/2116872#M443179</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T05:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: File upload from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload-from-application-server/m-p/2116873#M443180</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;&amp;lt;i&amp;gt;Nothing will happen when u dont have any operation on that file after wards..&lt;/P&gt;&lt;P&gt;If u have not closed the file which is opened for READ purpose , but afterwards u have opened the same file for WRITE purpose.. then it OVERWRITES the file or From the line at which the reading has been stopped..!!!&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;check the below program !!&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following program shows how the system sets the position when you open a file for writing. However, it is better programming style to close files that are already open before you reopen them for a different operation (for further information about closing files, refer to Closing a File).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA FNAME(60) VALUE 'myfile'.&lt;/P&gt;&lt;P&gt;DATA NUM TYPE I.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET FNAME FOR OUTPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO 10 TIMES.&lt;/P&gt;&lt;P&gt;  NUM = NUM + 1.&lt;/P&gt;&lt;P&gt;  TRANSFER NUM TO FNAME.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM INPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET FNAME FOR OUTPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NUM = 0.&lt;/P&gt;&lt;P&gt;DO 5 TIMES.&lt;/P&gt;&lt;P&gt;  NUM = NUM + 10.&lt;/P&gt;&lt;P&gt;  TRANSFER NUM TO FNAME.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM INPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOSE DATASET FNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET FNAME FOR OUTPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NUM = 0.&lt;/P&gt;&lt;P&gt;DO 5 TIMES.&lt;/P&gt;&lt;P&gt;  NUM = NUM + 20.&lt;/P&gt;&lt;P&gt;  TRANSFER NUM TO FNAME.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM INPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM INPUT.&lt;/P&gt;&lt;P&gt;  SKIP.&lt;/P&gt;&lt;P&gt;  OPEN DATASET FNAME FOR INPUT.&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;    READ DATASET FNAME INTO NUM.&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    WRITE / NUM.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output appears as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;6&lt;/P&gt;&lt;P&gt;7&lt;/P&gt;&lt;P&gt;8&lt;/P&gt;&lt;P&gt;9&lt;/P&gt;&lt;P&gt;10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10&lt;/P&gt;&lt;P&gt;20&lt;/P&gt;&lt;P&gt;30&lt;/P&gt;&lt;P&gt;40&lt;/P&gt;&lt;P&gt;50&lt;/P&gt;&lt;P&gt;6&lt;/P&gt;&lt;P&gt;7&lt;/P&gt;&lt;P&gt;8&lt;/P&gt;&lt;P&gt;9&lt;/P&gt;&lt;P&gt;10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;20&lt;/P&gt;&lt;P&gt;40&lt;/P&gt;&lt;P&gt;60&lt;/P&gt;&lt;P&gt;80&lt;/P&gt;&lt;P&gt;100&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This example performs the following steps using the file "myfile":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;==&amp;gt;It is opened for writing &lt;/P&gt;&lt;P&gt;==&amp;gt;It is filled with 10 integers (for information about the TRANSFER statement, refer to Writing Data to Files) &lt;/P&gt;&lt;P&gt;==&amp;gt;It is then opened for reading. The position is reset accordingly to the beginning of the file. &lt;/P&gt;&lt;P&gt;==&amp;gt;It is read into the field NUM. For information about the READ DATASET statement, refer to Reading Data from Files. The values of NUM are displayed on the screen. &lt;/P&gt;&lt;P&gt;==&amp;gt;It is reopened for writing The position is reset to the beginning of the file. &lt;/P&gt;&lt;P&gt;==&amp;gt;It is filled with five integers, which overwrite the previous contents of the file. &lt;/P&gt;&lt;P&gt;==&amp;gt;It is then reopened for reading. The position is reset to the beginning of the file. &lt;/P&gt;&lt;P&gt;==&amp;gt;The file is read into the field NUM. The values of NUM are displayed on the screen. &lt;/P&gt;&lt;P&gt;==&amp;gt;It is closed (for information about the CLOSE DATASET statement, refer to Closing a File). &lt;/P&gt;&lt;P&gt;==&amp;gt;It is then reopened for writing. The system deletes the existing contents of the file. &lt;/P&gt;&lt;P&gt;==&amp;gt;It is filled with 5 integers. &lt;/P&gt;&lt;P&gt;==&amp;gt;It is then opened for reading. The position is reset to the beginning of the file. &lt;/P&gt;&lt;P&gt;==&amp;gt;The file is read into the field NUM. The values of NUM are displayed on the screen. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;sai ramesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 05:35:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload-from-application-server/m-p/2116873#M443180</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T05:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: File upload from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload-from-application-server/m-p/2116874#M443181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An opened file that was not explicitly closed using CLOSE DATASET is automatically closed when the program is exited. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when there are multiple files then there may be confusion as to which file is opened , so it is better to close the datasets&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 05:36:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload-from-application-server/m-p/2116874#M443181</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T05:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: File upload from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload-from-application-server/m-p/2116875#M443182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Even though the code is working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you do not use close dataset statement, anyone can manipulate the file contents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So to avoid the file manipuation, use close statement for each open dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sandeep&lt;/P&gt;&lt;P&gt;Reward if helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 05:38:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload-from-application-server/m-p/2116875#M443182</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T05:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: File upload from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload-from-application-server/m-p/2116876#M443183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you dont close file using CLOSE DATASET then an opened file that was not explicitly closed using CLOSE DATASET is automatically closed when the program is exited. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;close dataset clause is used just to avoid unwanted situations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Swati.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 05:40:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-upload-from-application-server/m-p/2116876#M443183</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T05:40:06Z</dc:date>
    </item>
  </channel>
</rss>

