<?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: Using open dataset for network file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-open-dataset-for-network-file/m-p/4782154#M1120270</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Gary, you can only use DATASET statements when you are dealing with a file that resides on the application server in which the program is running.  You can not read a file on another network share using these statements.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can however use the following to read a network file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  zrich_0001.

TYPES: BEGIN OF t_data,
        line TYPE string,
       END OF t_data.

DATA: lt_data TYPE TABLE OF t_data.
DATA: ls_data LIKE LINE OF lt_data.

DATA: lv_file TYPE string.

PARAMETERS: p_file TYPE localfile DEFAULT '\\theServer.sap.corp\someFolder\theFile.txt''.


START-OF-SELECTION.

  lv_file = p_file.

  CALL METHOD cl_gui_frontend_services=&amp;gt;gui_upload
    EXPORTING
      filename = lv_file
    CHANGING
      data_tab = lt_data
    EXCEPTIONS
      OTHERS   = 19.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Dec 2008 15:16:04 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2008-12-04T15:16:04Z</dc:date>
    <item>
      <title>Using open dataset for network file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-open-dataset-for-network-file/m-p/4782149#M1120265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Those smarter than me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code returns sy-subrc=8 on the open dataset statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: dpfile(128) type c value '&lt;BR /&gt;server.domain.com\dp\ test.txt',&lt;/P&gt;&lt;P&gt;        dp100 type string.&lt;/P&gt;&lt;P&gt;open dataset dpfile for input in text mode encoding default.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;  do.&lt;/P&gt;&lt;P&gt;    read dataset dpfile into dp100&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      write: / dp100.&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;  close dataset dpfile.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    write:  / sy-subrc.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to read a text file on the network from SAP/ECC on AIX.  I've done this many times with ECC on NT reading a non-SAP NT server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Gary Rose on Dec 4, 2008 3:07 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2008 14:06:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-open-dataset-for-network-file/m-p/4782149#M1120265</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-04T14:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using open dataset for network file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-open-dataset-for-network-file/m-p/4782150#M1120266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the file name,and make sure it is exist or not and should not be in Open(Change) mode in network anywhere.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2008 14:10:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-open-dataset-for-network-file/m-p/4782150#M1120266</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-04T14:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using open dataset for network file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-open-dataset-for-network-file/m-p/4782151#M1120267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; data: dpfile(128) type c value '&lt;BR /&gt;server.domain.com\dp\ test.txt',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is that a deliberate space before "test.txt"?&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2008 14:13:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-open-dataset-for-network-file/m-p/4782151#M1120267</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-12-04T14:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using open dataset for network file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-open-dataset-for-network-file/m-p/4782152#M1120268</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;Use open dataset dpfile for input IGNORING CONVERSION ERRORS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jayant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2008 14:17:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-open-dataset-for-network-file/m-p/4782152#M1120268</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-04T14:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using open dataset for network file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-open-dataset-for-network-file/m-p/4782153#M1120269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The file is not locked by any other user as I'm still in development.  The space in the filename is a typo.  I had the IGNORING in my code at one point, but I will try that again.  Thanks for the responses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this doesn't work, I'll have to use FTP, but I certainly would prefer using the share for obvious reasons.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2008 15:10:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-open-dataset-for-network-file/m-p/4782153#M1120269</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-04T15:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using open dataset for network file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-open-dataset-for-network-file/m-p/4782154#M1120270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Gary, you can only use DATASET statements when you are dealing with a file that resides on the application server in which the program is running.  You can not read a file on another network share using these statements.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can however use the following to read a network file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  zrich_0001.

TYPES: BEGIN OF t_data,
        line TYPE string,
       END OF t_data.

DATA: lt_data TYPE TABLE OF t_data.
DATA: ls_data LIKE LINE OF lt_data.

DATA: lv_file TYPE string.

PARAMETERS: p_file TYPE localfile DEFAULT '\\theServer.sap.corp\someFolder\theFile.txt''.


START-OF-SELECTION.

  lv_file = p_file.

  CALL METHOD cl_gui_frontend_services=&amp;gt;gui_upload
    EXPORTING
      filename = lv_file
    CHANGING
      data_tab = lt_data
    EXCEPTIONS
      OTHERS   = 19.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2008 15:16:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-open-dataset-for-network-file/m-p/4782154#M1120270</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2008-12-04T15:16:04Z</dc:date>
    </item>
  </channel>
</rss>

