<?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: OPEN dataset statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-statement/m-p/3331015#M798068</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;Go thru this code, it will help you,.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the use of open dataset statement here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Pls reward if help.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3ca6358411d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3ca6358411d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP code for uploading a TAB delimited file into an internal table. See code below for structures.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  ZUPLOADTAB                                                  *                     &lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Example of Uploading tab delimited file                             *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  zuploadtab                    .&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;PARAMETERS: p_infile  LIKE rlgrap-filename&lt;/P&gt;&lt;P&gt;                        OBLIGATORY DEFAULT  '/usr/sap/'..&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA: ld_file LIKE rlgrap-filename.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*Internal tabe to store upload data&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF t_record,&lt;/P&gt;&lt;P&gt;    name1 like pa0002-VORNA,&lt;/P&gt;&lt;P&gt;    name2 like pa0002-name2,&lt;/P&gt;&lt;P&gt;    age   type i,&lt;/P&gt;&lt;P&gt;    END OF t_record.&lt;/P&gt;&lt;P&gt;DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,&lt;/P&gt;&lt;P&gt;      wa_record TYPE t_record.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*Text version of data table&lt;/P&gt;&lt;P&gt;TYPES: begin of t_uploadtxt,&lt;/P&gt;&lt;P&gt;  name1(10) type c,&lt;/P&gt;&lt;P&gt;  name2(15) type c,&lt;/P&gt;&lt;P&gt;  age(5)  type c,&lt;/P&gt;&lt;P&gt; end of t_uploadtxt.&lt;/P&gt;&lt;P&gt;DATA: wa_uploadtxt TYPE t_uploadtxt.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*String value to data in initially.&lt;/P&gt;&lt;P&gt;DATA: wa_string(255) type c.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;constants: con_tab TYPE x VALUE '09'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*If you have Unicode check active in program attributes then you will&lt;/P&gt;&lt;P&gt;*need to declare constants as follows:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*class cl_abap_char_utilities definition load.&lt;/P&gt;&lt;P&gt;*constants:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   con_tab  type c value cl_abap_char_utilities=&amp;gt;HORIZONTAL_TAB. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*START-OF-SELECTION&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;ld_file = p_infile.&lt;/P&gt;&lt;P&gt;OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;    CLEAR: wa_string, wa_uploadtxt.&lt;/P&gt;&lt;P&gt;    READ DATASET ld_file INTO wa_string.&lt;/P&gt;&lt;P&gt;    IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1&lt;/P&gt;&lt;P&gt;                                      wa_uploadtxt-name2&lt;/P&gt;&lt;P&gt;                                      wa_uploadtxt-age.&lt;/P&gt;&lt;P&gt;      MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.&lt;/P&gt;&lt;P&gt;      APPEND wa_upload TO it_record.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;  CLOSE DATASET ld_file.&lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*END-OF-SELECTION&lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;*!! Text data is now contained within the internal table IT_RECORD&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display report data for illustration purposes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  loop at it_record into wa_record.&lt;/P&gt;&lt;P&gt;    write:/     sy-vline,&lt;/P&gt;&lt;P&gt;           (10) wa_record-name1, sy-vline,&lt;/P&gt;&lt;P&gt;           (10) wa_record-name2, sy-vline,&lt;/P&gt;&lt;P&gt;           (10) wa_record-age, sy-vline.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Jan 2008 05:37:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-29T05:37:23Z</dc:date>
    <item>
      <title>OPEN dataset statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-statement/m-p/3331014#M798067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a file stored on the network shared drive. Can I read the file using open dataset statement. This file is not stored on the application server.&lt;/P&gt;&lt;P&gt;I have read that the open dataset statement works for only with the files stored in the application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;sankar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2008 05:35:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-statement/m-p/3331014#M798067</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-29T05:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN dataset statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-statement/m-p/3331015#M798068</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;Go thru this code, it will help you,.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the use of open dataset statement here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Pls reward if help.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3ca6358411d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3ca6358411d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP code for uploading a TAB delimited file into an internal table. See code below for structures.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  ZUPLOADTAB                                                  *                     &lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Example of Uploading tab delimited file                             *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  zuploadtab                    .&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;PARAMETERS: p_infile  LIKE rlgrap-filename&lt;/P&gt;&lt;P&gt;                        OBLIGATORY DEFAULT  '/usr/sap/'..&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA: ld_file LIKE rlgrap-filename.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*Internal tabe to store upload data&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF t_record,&lt;/P&gt;&lt;P&gt;    name1 like pa0002-VORNA,&lt;/P&gt;&lt;P&gt;    name2 like pa0002-name2,&lt;/P&gt;&lt;P&gt;    age   type i,&lt;/P&gt;&lt;P&gt;    END OF t_record.&lt;/P&gt;&lt;P&gt;DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,&lt;/P&gt;&lt;P&gt;      wa_record TYPE t_record.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*Text version of data table&lt;/P&gt;&lt;P&gt;TYPES: begin of t_uploadtxt,&lt;/P&gt;&lt;P&gt;  name1(10) type c,&lt;/P&gt;&lt;P&gt;  name2(15) type c,&lt;/P&gt;&lt;P&gt;  age(5)  type c,&lt;/P&gt;&lt;P&gt; end of t_uploadtxt.&lt;/P&gt;&lt;P&gt;DATA: wa_uploadtxt TYPE t_uploadtxt.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*String value to data in initially.&lt;/P&gt;&lt;P&gt;DATA: wa_string(255) type c.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;constants: con_tab TYPE x VALUE '09'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*If you have Unicode check active in program attributes then you will&lt;/P&gt;&lt;P&gt;*need to declare constants as follows:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*class cl_abap_char_utilities definition load.&lt;/P&gt;&lt;P&gt;*constants:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   con_tab  type c value cl_abap_char_utilities=&amp;gt;HORIZONTAL_TAB. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*START-OF-SELECTION&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;ld_file = p_infile.&lt;/P&gt;&lt;P&gt;OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;    CLEAR: wa_string, wa_uploadtxt.&lt;/P&gt;&lt;P&gt;    READ DATASET ld_file INTO wa_string.&lt;/P&gt;&lt;P&gt;    IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1&lt;/P&gt;&lt;P&gt;                                      wa_uploadtxt-name2&lt;/P&gt;&lt;P&gt;                                      wa_uploadtxt-age.&lt;/P&gt;&lt;P&gt;      MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.&lt;/P&gt;&lt;P&gt;      APPEND wa_upload TO it_record.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;  CLOSE DATASET ld_file.&lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*END-OF-SELECTION&lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;*!! Text data is now contained within the internal table IT_RECORD&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display report data for illustration purposes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  loop at it_record into wa_record.&lt;/P&gt;&lt;P&gt;    write:/     sy-vline,&lt;/P&gt;&lt;P&gt;           (10) wa_record-name1, sy-vline,&lt;/P&gt;&lt;P&gt;           (10) wa_record-name2, sy-vline,&lt;/P&gt;&lt;P&gt;           (10) wa_record-age, sy-vline.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2008 05:37:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-statement/m-p/3331015#M798068</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-29T05:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN dataset statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-statement/m-p/3331016#M798069</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 have to use GUI_UPLOAD function module to read thet file in your program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET works only for Application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pankaj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2008 05:37:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-statement/m-p/3331016#M798069</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-29T05:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN dataset statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-statement/m-p/3331017#M798070</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;then use gui_upload fm to upload to application server then use open dataset&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2008 05:39:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-statement/m-p/3331017#M798070</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-29T05:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: OPEN dataset statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-statement/m-p/3331018#M798071</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;To open a file on the application server, use the OPEN statement as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET &amp;lt;dsn&amp;gt; [Additions].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This statement opens the file &amp;lt;dsn&amp;gt;. If you do not specify any additions for the mode, the file is opened in binary mode for reading. SY-SUBRC returns 0 if the system opens the file. Otherwise, SY-SUBRC is set to 8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You enter the filename &amp;lt;dsn&amp;gt; either as a literal or as a field containing the actual name of the file. If you do not specify a path, the system opens the file in the directory in which the R/3 System is running on the application server. To open a file, the user under which the R/3 System is running must have the requisite authorizations at operating system level. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To read from presentation server use any of the FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.ws_upload.&lt;/P&gt;&lt;P&gt;2.gui_upload.&lt;/P&gt;&lt;P&gt;3.upload.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope this is helpful, Do reward.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2008 05:41:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-statement/m-p/3331018#M798071</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-29T05:41:09Z</dc:date>
    </item>
  </channel>
</rss>

