<?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: Opendata SET error information req? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/opendata-set-error-information-req/m-p/5602816#M1276850</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had a req to use the data,from bdc.txt file to perform a bdc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so i am just displaying is for test &amp;amp; if sucessful,will load in table to execute as required.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 May 2009 14:07:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-15T14:07:23Z</dc:date>
    <item>
      <title>Opendata SET error information req?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/opendata-set-error-information-req/m-p/5602814#M1276848</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;I had an requirement to read the data file in .txt format form sap application server.I am using the opendata set comanda,but its giving me dump saying,the file is not open.&lt;/P&gt;&lt;P&gt;please tell me how to resolve it,my file save as bdc.txt on application server which is on unix server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;code:&lt;/P&gt;&lt;P&gt;DATA:BEGIN OF itab OCCURS 0,&lt;/P&gt;&lt;P&gt;     matl_type(4)  TYPE c,&lt;/P&gt;&lt;P&gt;     matl_group(9) TYPE c,&lt;/P&gt;&lt;P&gt;     matl_desc(40) TYPE c,&lt;/P&gt;&lt;P&gt;     char_prof(18) TYPE c,&lt;/P&gt;&lt;P&gt;     END OF itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:wa LIKE itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA file TYPE string VALUE `/sap/inbound/bdc.txt`.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET file FOR OUTPUT IN BINARY MODE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE:'ok'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS &amp;lt;hex_container&amp;gt; TYPE x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN wa TO &amp;lt;hex_container&amp;gt; CASTING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt;  READ DATASET file INTO &amp;lt;hex_container&amp;gt;.&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    WRITE: / wa-matl_type,&lt;/P&gt;&lt;P&gt;             wa-matl_group,&lt;/P&gt;&lt;P&gt;             wa-matl_desc,&lt;/P&gt;&lt;P&gt;             wa-char_prof.&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;&lt;/P&gt;&lt;P&gt;CLOSE DATASET file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2009 13:54:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/opendata-set-error-information-req/m-p/5602814#M1276848</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-15T13:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Opendata SET error information req?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/opendata-set-error-information-req/m-p/5602815#M1276849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are trying to read a file, why are you opening it for output?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2009 13:56:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/opendata-set-error-information-req/m-p/5602815#M1276849</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-15T13:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Opendata SET error information req?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/opendata-set-error-information-req/m-p/5602816#M1276850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had a req to use the data,from bdc.txt file to perform a bdc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so i am just displaying is for test &amp;amp; if sucessful,will load in table to execute as required.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2009 14:07:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/opendata-set-error-information-req/m-p/5602816#M1276850</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-15T14:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Opendata SET error information req?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/opendata-set-error-information-req/m-p/5602817#M1276851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have made some changes on your code ,.&lt;/P&gt;&lt;P&gt;Now it is working fine.&lt;/P&gt;&lt;P&gt;Please check the following --&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA:BEGIN OF ITAB OCCURS 0,
MATL_TYPE(4) TYPE C,
MATL_GROUP(9) TYPE C,
MATL_DESC(40) TYPE C,
CHAR_PROF(18) TYPE C,
END OF ITAB.

DATA:WA LIKE ITAB.
*DATA file TYPE string VALUE `/sap/inbound/bdc.txt`. " Commented

DATA FILE TYPE STRING VALUE 'BDC'. " Added

OPEN DATASET FILE FOR INPUT IN  BINARY MODE. " Not output, specify INPUT
IF SY-SUBRC EQ 0. " Added

  WRITE:'ok'.

  FIELD-SYMBOLS &amp;lt;HEX_CONTAINER&amp;gt; TYPE X.

  ASSIGN WA TO &amp;lt;HEX_CONTAINER&amp;gt; CASTING.

  DO.
    READ DATASET FILE INTO &amp;lt;HEX_CONTAINER&amp;gt;.
    IF SY-SUBRC = 0.
      WRITE: / WA-MATL_TYPE,
      WA-MATL_GROUP,
      WA-MATL_DESC,
      WA-CHAR_PROF.
    ELSE.
      EXIT.
    ENDIF.
  ENDDO.
ENDIF. " Added
CLOSE DATASET FILE.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pinaki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2009 14:21:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/opendata-set-error-information-req/m-p/5602817#M1276851</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-15T14:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Opendata SET error information req?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/opendata-set-error-information-req/m-p/5602818#M1276852</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 should open in input mode for reading.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Local variable Declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DATA l_msg(60) TYPE c.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Opening the file for output in text mode&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  OPEN DATASET ....&lt;/P&gt;&lt;P&gt;                                                  MESSAGE l_msg.&lt;/P&gt;&lt;P&gt;In debugging mode, you can get the message in l_msg.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2009 14:41:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/opendata-set-error-information-req/m-p/5602818#M1276852</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2009-05-15T14:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: Opendata SET error information req?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/opendata-set-error-information-req/m-p/5602819#M1276853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vipin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actullly Your &lt;STRONG&gt;OPEN DATASET ....&lt;/STRONG&gt;  statement was unsuccessful to open the &lt;/P&gt;&lt;P&gt;file  `/sap/inbound/bdc.txt`.&lt;/P&gt;&lt;P&gt;And without checking SY-SUBRC &lt;STRONG&gt;the code was trying to read data from a file&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;which is not opened at all.&lt;/STRONG&gt;That was causing the &lt;STRONG&gt;runtime error&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So after your OPEN DATASET ... statement you need to cheeck SY-SUBRC and&lt;/P&gt;&lt;P&gt;if it success then only you need to proceed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another thing is that if you want to read from a file to your report in that case &lt;/P&gt;&lt;P&gt;you need to open the file &lt;STRONG&gt;FOR INPUT&lt;/STRONG&gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specify the file value properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pinaki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2009 14:42:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/opendata-set-error-information-req/m-p/5602819#M1276853</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-15T14:42:30Z</dc:date>
    </item>
  </channel>
</rss>

