<?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: read dataset has sy-subrc code  4 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043932#M1501089</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please make it more clear.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Jul 2010 15:57:52 GMT</pubDate>
    <dc:creator>kesavadas_thekkillath</dc:creator>
    <dc:date>2010-07-07T15:57:52Z</dc:date>
    <item>
      <title>read dataset has sy-subrc code  4</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043925#M1501082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello colleagues,&lt;/P&gt;&lt;P&gt;hier ist my Problem: &lt;/P&gt;&lt;P&gt;open dataset has sy-subrc code  0&lt;/P&gt;&lt;P&gt;read dataset has sy-subrc code  4&lt;/P&gt;&lt;P&gt;Exceptions are not caught&lt;/P&gt;&lt;P&gt;what is the error? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    OPEN DATASET file_server FOR INPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 8.&lt;/P&gt;&lt;P&gt;      MESSAGE mess TYPE 'I'.&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;    DATA: oerror TYPE REF TO cx_root,&lt;/P&gt;&lt;P&gt;    txt_error TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DO.&lt;/P&gt;&lt;P&gt;      TRY. &lt;/P&gt;&lt;P&gt;          READ DATASET file_server INTO platzhalter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CATCH CX_SY_CODEPAGE_CONVERTER_INIT   INTO oerror.&lt;/P&gt;&lt;P&gt;          txt_error = oerror-&amp;gt;get_longtext( ).&lt;/P&gt;&lt;P&gt;          MESSAGE txt_error TYPE 'I' DISPLAY LIKE 'E'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CATCH CX_SY_CONVERSION_CODEPAGE   INTO oerror.&lt;/P&gt;&lt;P&gt;          txt_error = oerror-&amp;gt;get_longtext( ).&lt;/P&gt;&lt;P&gt;          MESSAGE txt_error TYPE 'I' DISPLAY LIKE 'E'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CATCH cx_sy_file_authority  INTO oerror.&lt;/P&gt;&lt;P&gt;          txt_error = oerror-&amp;gt;get_longtext( ).&lt;/P&gt;&lt;P&gt;          MESSAGE txt_error TYPE 'I' DISPLAY LIKE 'E'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CATCH cx_sy_file_open INTO oerror.&lt;/P&gt;&lt;P&gt;          txt_error = oerror-&amp;gt;get_longtext( ).&lt;/P&gt;&lt;P&gt;          MESSAGE txt_error TYPE 'I' DISPLAY LIKE 'E'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CATCH cx_sy_pipe_reopen  INTO oerror.&lt;/P&gt;&lt;P&gt;          txt_error = oerror-&amp;gt;get_longtext( ).&lt;/P&gt;&lt;P&gt;          MESSAGE txt_error TYPE 'I' DISPLAY LIKE 'E'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;        MESSAGE i006(zerror).&lt;/P&gt;&lt;P&gt;        EXIT.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SPLIT platzhalter AT c_trennzeichen INTO&lt;/P&gt;&lt;P&gt;                     wa_inputdata-t_kunde&lt;/P&gt;&lt;P&gt;                     wa_inputdata-firma&lt;/P&gt;&lt;P&gt;                     wa_inputdata-city&lt;/P&gt;&lt;P&gt;                     wa_inputdata-street&lt;/P&gt;&lt;P&gt;                     wa_inputdata-zaehlpunkt&lt;/P&gt;&lt;P&gt;                     wa_inputdata-zaehlernr&lt;/P&gt;&lt;P&gt;                     wa_inputdata-bkreis&lt;/P&gt;&lt;P&gt;                     wa_inputdata-bkreis_n&lt;/P&gt;&lt;P&gt;                     wa_inputdata-kundengruppe&lt;/P&gt;&lt;P&gt;                     wa_inputdata-zaehlverfahren&lt;/P&gt;&lt;P&gt;                     wa_inputdata-slp_zuordnung&lt;/P&gt;&lt;P&gt;                     wa_inputdata-j_verbrauch&lt;/P&gt;&lt;P&gt;                     wa_inputdata-lif_beginn&lt;/P&gt;&lt;P&gt;                     wa_inputdata-bil_beginn&lt;/P&gt;&lt;P&gt;                     wa_inputdata-st_id.&lt;/P&gt;&lt;P&gt;      APPEND wa_inputdata TO it_container.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;        MESSAGE i007(zerror).&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 file_server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Aytac Kale on Jul 7, 2010 3:08 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jul 2010 13:07:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043925#M1501082</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-07T13:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: read dataset has sy-subrc code  4</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043926#M1501083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For open dataset &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sy-subrc Description &lt;/P&gt;&lt;P&gt;0    File was opened. &lt;/P&gt;&lt;P&gt;8    Operating system could not open file. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;For read dataset&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sy-subrc Meaning &lt;/P&gt;&lt;P&gt;0    Data was read without reaching end of file. &lt;/P&gt;&lt;P&gt;4    Data was read and the end of the file was reached or there was an attempt to read after the end of the file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jul 2010 13:14:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043926#M1501083</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-07T13:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: read dataset has sy-subrc code  4</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043927#M1501084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you vinraaj,  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how can i solve it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Aytac Kale on Jul 7, 2010 3:36 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jul 2010 13:35:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043927#M1501084</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-07T13:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: read dataset has sy-subrc code  4</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043928#M1501085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data: platzhalter(50000) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Aytac Kale on Jul 7, 2010 3:50 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jul 2010 13:50:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043928#M1501085</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-07T13:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: read dataset has sy-subrc code  4</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043929#M1501086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
data:wf_string type string.
data:  lf_ref TYPE REF TO cx_root.
DO.
TRY. 
READ DATASET file_server INTO platzhalter.
*Catch system exceptions
    CATCH cx_root INTO lf_ref.                           "#EC CATCH_ALL
      wf_string = lf_ref-&amp;gt;get_text( ).
      IF wf_string IS NOT INITIAL.
        MESSAGE s904(zf) WITH wf_string DISPLAY LIKE 'E'.
      ENDIF.
ENDTRY.

if sy-subrc ne 0.
      IF sy-index EQ 1. "No data in the file
      EXIT.
 ELSE. "End of File
        CLOSE DATASET file_server.
        EXIT.
      ENDIF.
endif.

SPLIT platzhalter AT c_trennzeichen INTO
wa_inputdata-t_kunde
wa_inputdata-firma
wa_inputdata-city
wa_inputdata-street
wa_inputdata-zaehlpunkt
wa_inputdata-zaehlernr
wa_inputdata-bkreis
wa_inputdata-bkreis_n
wa_inputdata-kundengruppe
wa_inputdata-zaehlverfahren
wa_inputdata-slp_zuordnung
wa_inputdata-j_verbrauch
wa_inputdata-lif_beginn
wa_inputdata-bil_beginn
wa_inputdata-st_id.
APPEND wa_inputdata TO it_container.
ENDDO.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jul 2010 14:25:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043929#M1501086</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-07-07T14:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: read dataset has sy-subrc code  4</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043930#M1501087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aytec, please format your code as IF sy-subrc &amp;amp;lt;&amp;amp;gt; 0 doesn't display &amp;amp;lt;&amp;amp;gt;!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now sy-subrc = 4 is not an error when you use READ DATASET, it just indicates the end of file, so just don't display the message:&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="Courier" __jive_macro_name="font"&gt;
IF sy-subrc &amp;amp;lt;&amp;amp;gt; 0.
&lt;DEL&gt;MESSAGE i007(zerror).&lt;/DEL&gt;
EXIT.
ENDIF.
&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that your code is buggy as sy-subrc may be changed by GET_LONGTEXT method. So you should place the code above right after the READ DATASET.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jul 2010 14:26:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043930#M1501087</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2010-07-07T14:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: read dataset has sy-subrc code  4</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043931#M1501088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;read dataset reads nothing, if sy-tabix = 1 and 2 ...&lt;/P&gt;&lt;P&gt;nothing..there are in the csv.table  5 data records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Aytac Kale on Jul 7, 2010 5:55 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jul 2010 15:37:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043931#M1501088</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-07T15:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: read dataset has sy-subrc code  4</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043932#M1501089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please make it more clear.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jul 2010 15:57:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043932#M1501089</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-07-07T15:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: read dataset has sy-subrc code  4</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043933#M1501090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the problem is that no data is read. Like if sy-index 1 or 2 or 3 .... is a nothing is accepted, because nothing is read. inothing. In no time through the loop will read anything.&lt;/P&gt;&lt;P&gt;OPEN DATASET FOR INPUT IN TEXT MODE file_server ENCODING DEFAULT sy-subrc = 0 , the file is open, why is not a single record read?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Aytac Kale on Jul 7, 2010 6:20 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Aytac Kale on Jul 7, 2010 6:21 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jul 2010 16:06:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043933#M1501090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-07T16:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: read dataset has sy-subrc code  4</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043934#M1501091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;though sy-subrc is set to 4, something may have been read (sy-subrc = 4 just indicates the end of file has been reached). Check in debug whether the variable contains something or not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jul 2010 16:43:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-dataset-has-sy-subrc-code-4/m-p/7043934#M1501091</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2010-07-07T16:43:20Z</dc:date>
    </item>
  </channel>
</rss>

