<?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 error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-error/m-p/2699631#M625142</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Srinivas.&lt;/P&gt;&lt;P&gt;I just used '|' in this thread to distinguish the records. I found the bug in my program. It works now finely.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks all for your support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;null&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Aug 2007 16:19:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-10T16:19:52Z</dc:date>
    <item>
      <title>Open Dataset error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-error/m-p/2699624#M625135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am seeing a strange error while loading a .txt file into SAP via a program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The flat file format is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;rec_type|operation1|relation1|timeunit1|operation2|relation2|timeunit2&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;00001|100001|FS|DAY|100002|FS|HR&lt;/P&gt;&lt;P&gt;00002|100003|SS|DAY|100004|SS|HR&lt;/P&gt;&lt;P&gt;00003|100005|FS|DAY|100006|SS|HR&lt;/P&gt;&lt;P&gt;......................................................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the code like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;data: c_delimit(1) type c value '|'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_input occurs 0,&lt;/P&gt;&lt;P&gt;         data(1000) type c,&lt;/P&gt;&lt;P&gt;        end of i_input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_data occurs 0,&lt;/P&gt;&lt;P&gt;         rec_type(1) type c,&lt;/P&gt;&lt;P&gt;         operation1(16) type c,&lt;/P&gt;&lt;P&gt;         relation1(16) type c,&lt;/P&gt;&lt;P&gt;         timeunit1(3) type c,&lt;/P&gt;&lt;P&gt;         operation2(16) type c,&lt;/P&gt;&lt;P&gt;         relation2(16) type c,&lt;/P&gt;&lt;P&gt;         timeunit2(3) type c,&lt;/P&gt;&lt;P&gt;        end of i_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ....................................&lt;/P&gt;&lt;P&gt;    ....................................&lt;/P&gt;&lt;P&gt;    ....................................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;open dataset p_file for input in text mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do.&lt;/P&gt;&lt;P&gt;read dataset p_file into i_input.&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;     append i_input.&lt;/P&gt;&lt;P&gt;     clear i_input.&lt;/P&gt;&lt;P&gt; enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;close dataset p_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       ................................&lt;/P&gt;&lt;P&gt;       ................................&lt;/P&gt;&lt;P&gt;       ................................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  split i_input-data at c_delimit into i_data-rec_type&lt;/P&gt;&lt;P&gt;                                                   i_data-operation1&lt;/P&gt;&lt;P&gt;                                                   i_data-relation1&lt;/P&gt;&lt;P&gt;                                                   i_data-timeunit1&lt;/P&gt;&lt;P&gt;                                                   i_data-operation2&lt;/P&gt;&lt;P&gt;                                                   i_data-relation2&lt;/P&gt;&lt;P&gt;                                                   i_data-timeunit2.&lt;/P&gt;&lt;P&gt;                 append i_data.&lt;/P&gt;&lt;P&gt;                 clear i_data.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I am seeing the records in internal table "i_input" as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;00001|100001||DAY|100002|FS|HR&lt;/P&gt;&lt;P&gt;00002|100003||DAY|100004|SS|HR&lt;/P&gt;&lt;P&gt;00003|100005||DAY|100006|SS|HR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e, i am not seeing only the "relation1' values in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate your help.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2007 21:53:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-error/m-p/2699624#M625135</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-09T21:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: Open Dataset error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-error/m-p/2699625#M625136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't see anything wrong here. Check in debugging, what you are getting in the "loop at i_input" after the split statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2007 22:39:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-error/m-p/2699625#M625136</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-09T22:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Open Dataset error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-error/m-p/2699626#M625137</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;&lt;/P&gt;&lt;P&gt;  Can you see it in i_input table after the read statement... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  I think that field does not have value.. but ur program is reading and i think the current file that you are reading does not have relation1 value.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2007 23:06:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-error/m-p/2699626#M625137</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-09T23:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Open Dataset error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-error/m-p/2699627#M625138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure the logic you have provided matches the problem program - e.g. you show rec_type as 1 byte but 4 in the file...  I've cut-and-pasted your code and tested it in isolation, and it seems to be OK - try the sample below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;report zlocal_jc_dataset_split.

start-of-selection.
  perform logic.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  logic
*&amp;amp;---------------------------------------------------------------------*
form logic.

  constants:
    lc_delimit(1)       type c value '|'.

  data:
   begin of ls_input,
     data(1000)         type c,
   end of ls_input,
   lt_input             like ls_input occurs 10.

  data:
    begin of ls_data,
      rec_type(4)       type c,  "was (1) in example provided
      operation1(16)    type c,
      relation1(16)     type c,
      timeunit1(3)      type c,
      operation2(16)    type c,
      relation2(16)     type c,
      timeunit2(3)      type c,
   end of ls_data,
   lt_data              like ls_data occurs 10.

*" Dummy up the data load
  append '00001|100001|FS|DAY|100002|FS|HR' to lt_input.
  append '00002|100003|SS|DAY|100004|SS|HR' to lt_input.
  append '00003|100005|FS|DAY|100006|SS|HR' to lt_input.

*" Do the split
  loop at lt_input into ls_input.

    split ls_input-data at lc_delimit
      into
        ls_data-rec_type
        ls_data-operation1
        ls_data-relation1
        ls_data-timeunit1
        ls_data-operation2
        ls_data-relation2
        ls_data-timeunit2.
    append ls_data to lt_data.
    clear: ls_data.

  endloop.
break-point.
  loop at lt_data into ls_data.
    write: / ls_data.
  endloop.

endform.                    "logic&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 00:13:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-error/m-p/2699627#M625138</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-10T00:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Open Dataset error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-error/m-p/2699628#M625139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks all for your replies. Sorry for getting back to you late.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas, I have checked it in debugging. I am seeing the same afer split statement though it still shows up the 'i_input-data' as:&lt;/P&gt;&lt;P&gt;00001|100001|FS|DAY|100002|FS|HR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I am seeing in 'i_data':  &lt;/P&gt;&lt;P&gt;00001|100001||DAY|100002|FS|HR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 14:41:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-error/m-p/2699628#M625139</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-10T14:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: Open Dataset error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-error/m-p/2699629#M625140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using the '|' when showing the i_data record here in this thread just to tell us how it is split or is the '|' appearing in i_data in reality? Because, i_data should have individual field values after the split and i_data-relation1 value in debugging should be correctly filled.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 15:17:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-error/m-p/2699629#M625140</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-10T15:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Open Dataset error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-error/m-p/2699630#M625141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also make sure that you have '|' not '!' which may appear to be same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 15:18:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-error/m-p/2699630#M625141</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-10T15:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Open Dataset error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-error/m-p/2699631#M625142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Srinivas.&lt;/P&gt;&lt;P&gt;I just used '|' in this thread to distinguish the records. I found the bug in my program. It works now finely.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks all for your support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;null&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 16:19:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-error/m-p/2699631#M625142</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-10T16:19:52Z</dc:date>
    </item>
  </channel>
</rss>

