<?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: Get files from applicationserver in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-files-from-applicationserver/m-p/1504525#M233261</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;to read file from application server,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USE&lt;/P&gt;&lt;P&gt;OPEN DATASET &amp;lt;FILENAME&amp;gt; FOR INPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to read the contents of the file,&lt;/P&gt;&lt;P&gt; USE &lt;/P&gt;&lt;P&gt;READ DATASET &amp;lt;FILENAME&amp;gt; INTO V_STRING.&lt;/P&gt;&lt;P&gt;v_string will have the contents (1 line only)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and finally to close the file,&lt;/P&gt;&lt;P&gt; USE&lt;/P&gt;&lt;P&gt; CLOSE DATASET &amp;lt;FILENAME&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;srikanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Aug 2006 07:09:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-04T07:09:30Z</dc:date>
    <item>
      <title>Get files from applicationserver</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-files-from-applicationserver/m-p/1504524#M233260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           I have a requirement to get the files from shared folder(may be application server), is there any specific function module to get the list of files. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dilip&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Aug 2006 07:04:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-files-from-applicationserver/m-p/1504524#M233260</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-04T07:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Get files from applicationserver</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-files-from-applicationserver/m-p/1504525#M233261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;to read file from application server,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USE&lt;/P&gt;&lt;P&gt;OPEN DATASET &amp;lt;FILENAME&amp;gt; FOR INPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to read the contents of the file,&lt;/P&gt;&lt;P&gt; USE &lt;/P&gt;&lt;P&gt;READ DATASET &amp;lt;FILENAME&amp;gt; INTO V_STRING.&lt;/P&gt;&lt;P&gt;v_string will have the contents (1 line only)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and finally to close the file,&lt;/P&gt;&lt;P&gt; USE&lt;/P&gt;&lt;P&gt; CLOSE DATASET &amp;lt;FILENAME&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;srikanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Aug 2006 07:09:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-files-from-applicationserver/m-p/1504525#M233261</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-04T07:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get files from applicationserver</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-files-from-applicationserver/m-p/1504526#M233262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;total logic to get total contents of the file into the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;         LINE TYPE STRING,&lt;/P&gt;&lt;P&gt;       end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET &amp;lt;FILENAME&amp;gt; FOR INPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO.&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;  READ DATASET &amp;lt;FILENAME&amp;gt; INTO V_STRING.&lt;/P&gt;&lt;P&gt;  IF V_STRING IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;    ITAB-LINE = V_STRING.&lt;/P&gt;&lt;P&gt;    APPEND ITAB.&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 &amp;lt;FILENAME&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you use this logic, the contents of the file will be comes into the internal table ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but &amp;lt;FILENAME&amp;gt; should be given total path. not the just filename.you should give the absolute path name along with file name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;srikanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Aug 2006 07:13:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-files-from-applicationserver/m-p/1504526#M233262</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-04T07:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: Get files from applicationserver</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-files-from-applicationserver/m-p/1504527#M233263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srikanth,&lt;/P&gt;&lt;P&gt;               The filename can be any so first I have to get it the list of files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dilip&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Aug 2006 07:13:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-files-from-applicationserver/m-p/1504527#M233263</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-04T07:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Get files from applicationserver</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-files-from-applicationserver/m-p/1504528#M233264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Copy paste this code. you'll get all the files from your dir.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of tabl occurs 500,&lt;/P&gt;&lt;P&gt;        line(400),&lt;/P&gt;&lt;P&gt;      end of tabl.&lt;/P&gt;&lt;P&gt;data: unixcom like   rlgrap-filename.&lt;/P&gt;&lt;P&gt;data: lines type i.&lt;/P&gt;&lt;P&gt;unixcom = 'ls -al'.&lt;/P&gt;&lt;P&gt;refresh tabl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call 'SYSTEM' id 'COMMAND' field unixcom&lt;/P&gt;&lt;P&gt;                id 'TAB'     field tabl[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  describe table tabl lines lines.&lt;/P&gt;&lt;P&gt;  loop at tabl.&lt;/P&gt;&lt;P&gt;    write:/01 tabl-line.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;  skip 2.&lt;/P&gt;&lt;P&gt;  if lines = 0.&lt;/P&gt;&lt;P&gt;    write:/ 'NO Occurances were found'.&lt;/P&gt;&lt;P&gt;  endif.&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;Sumit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Aug 2006 07:15:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-files-from-applicationserver/m-p/1504528#M233264</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-04T07:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: Get files from applicationserver</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-files-from-applicationserver/m-p/1504529#M233265</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;This program allows the user to choose a file on application server and downloads the same to an Internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

REPORT zes_sample.


DATA : filename LIKE dxfields-longpath.
DATA : BEGIN OF it_test OCCURS 0,
       a(200) TYPE c,
       END OF it_test.

*------------------------------------------

CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
  i_location_flag = 'A'
* I_SERVER = '?'
* I_PATH =
* FILEMASK = '*.*'
* FILEOPERATION = 'R'
IMPORTING
* O_LOCATION_FLAG =
* O_SERVER =
  o_path         = filename
* ABEND_FLAG =
EXCEPTIONS
  rfc_error       = 1
  error_with_gui  = 2
  OTHERS          = 3.


BREAK-POINT.

OPEN DATASET filename FOR INPUT IN BINARY MODE.
WHILE sy-subrc = 0.
  CLEAR it_test .
  READ DATASET filename INTO it_test.
  APPEND it_test.
ENDWHILE.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;AS&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Aug 2006 07:31:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-files-from-applicationserver/m-p/1504529#M233265</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-04T07:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Get files from applicationserver</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-files-from-applicationserver/m-p/1504530#M233266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai,&lt;/P&gt;&lt;P&gt;You can try the Tx &amp;lt;b&amp;gt;CG3Y/CG3Z&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Aug 2006 12:25:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-files-from-applicationserver/m-p/1504530#M233266</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-04T12:25:59Z</dc:date>
    </item>
  </channel>
</rss>

