<?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: OUTPUT PROBLEM FOR OPEN DATASET in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/output-problem-for-open-dataset/m-p/986584#M73124</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;try that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA mess(100).
OPEN DATASET fname FOR OUTPUT IN TEXT MODE MESSAGE mess.
IF sy-subrc &amp;lt;&amp;gt; 0.
  WRITE / mess.
  EXIT.
ENDIF.
DATA: BEGIN OF wa , col1(15), col2(15), END OF wa.
LOOP AT tab INTO lin.
   move-corresponding lin to wa.
  TRANSFER wa TO fname.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Jul 2005 06:37:37 GMT</pubDate>
    <dc:creator>andreas_mann3</dc:creator>
    <dc:date>2005-07-01T06:37:37Z</dc:date>
    <item>
      <title>OUTPUT PROBLEM FOR OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/output-problem-for-open-dataset/m-p/986578#M73118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the program with the sample in SAP library, the file is created with the content displayed on the screen, but when I open the myfile.txt, the content is blank. I want to write content in the text file, but it seems failed.&lt;/P&gt;&lt;P&gt;What is the problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/EN/fc/eb3db7358411d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/EN/fc/eb3db7358411d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------------------------------" /&gt;&lt;P&gt;DATA FNAME(60) VALUE 'myfile.txt'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF LINE,&lt;/P&gt;&lt;P&gt;         COL1 TYPE I,&lt;/P&gt;&lt;P&gt;         COL2 TYPE I,&lt;/P&gt;&lt;P&gt;       END OF LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES  ITAB TYPE LINE OCCURS 10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: LIN TYPE LINE,&lt;/P&gt;&lt;P&gt;      TAB TYPE ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO 5 TIMES.&lt;/P&gt;&lt;P&gt;  LIN-COL1 = SY-INDEX.&lt;/P&gt;&lt;P&gt;  LIN-COL2 = SY-INDEX ** 2.&lt;/P&gt;&lt;P&gt;  APPEND LIN TO TAB.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET FNAME FOR OUTPUT.&lt;/P&gt;&lt;P&gt;LOOP AT TAB INTO LIN.&lt;/P&gt;&lt;P&gt;  TRANSFER LIN TO FNAME.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;CLOSE DATASET FNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET FNAME FOR INPUT.&lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt;  READ DATASET FNAME INTO LIN.&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;  WRITE: / LIN-COL1, LIN-COL2.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOSE DATASET FNAME.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2005 10:23:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/output-problem-for-open-dataset/m-p/986578#M73118</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-30T10:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: OUTPUT PROBLEM FOR OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/output-problem-for-open-dataset/m-p/986579#M73119</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;Here is the problem...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET FNAME FOR OUTPUT.&lt;/P&gt;&lt;P&gt;LOOP AT TAB INTO LIN.&lt;/P&gt;&lt;P&gt;TRANSFER LIN TO FNAME.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;CLOSE DATASET FNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;before doing a transfer you have to check sy-subrc for open dataset to find out whether dataset 'myfile.txt' was successfully opened or not. I think open dataset is failing because the file path that is specified.&lt;/P&gt;&lt;P&gt;Please do a check after open dataset then verify.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sharath.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2005 10:29:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/output-problem-for-open-dataset/m-p/986579#M73119</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-30T10:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: OUTPUT PROBLEM FOR OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/output-problem-for-open-dataset/m-p/986580#M73120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Macy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe it's just a stupid authority problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's a small program, just debug (after OPEN DATASET) and check, if somewhere SY-SUBRC &amp;lt;&amp;gt; 0 appears.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In help of corresponding command you will find a hint for your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Quite often users don't have write rights on application server's file system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2005 10:29:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/output-problem-for-open-dataset/m-p/986580#M73120</guid>
      <dc:creator>christian_wohlfahrt</dc:creator>
      <dc:date>2005-06-30T10:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: OUTPUT PROBLEM FOR OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/output-problem-for-open-dataset/m-p/986581#M73121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sharath,Christian&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;The file path is correct because I could find that myfile.txt is created in the path after executing the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try to add some text to the myfile.txt directly in notepad, and see if the program could read the text in it.&lt;/P&gt;&lt;P&gt;The program could read the text. But just can't write text to it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I've checked that SY-SUBRC is = 0, and I have authorization to write in the directory that I specified (I don't put the path as that of application server, I just put the path on my server, e.g. &lt;BR /&gt;xxx\temp\).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you tell what other possibilities are there?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2005 17:07:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/output-problem-for-open-dataset/m-p/986581#M73121</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-30T17:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: OUTPUT PROBLEM FOR OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/output-problem-for-open-dataset/m-p/986582#M73122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Macy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;looks like nothing is wrong. This program defines an internal table, fill this table with two numbers (line number and square of line number), &amp;lt;b&amp;gt;writes this internal table into a file&amp;lt;/b&amp;gt;, re-reads this file into internal table, printout of internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you manually change myfile.txt, it's getting overwritten in the first part of the program - that's all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just deactivate the coding from 'do 5 times' up to the first 'close dataset' - then you can show own changes of myfile.txt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2005 05:09:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/output-problem-for-open-dataset/m-p/986582#M73122</guid>
      <dc:creator>christian_wohlfahrt</dc:creator>
      <dc:date>2005-07-01T05:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: OUTPUT PROBLEM FOR OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/output-problem-for-open-dataset/m-p/986583#M73123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Macy,&lt;/P&gt;&lt;P&gt;I tried to execute your program .It is working perfectly for me . I added 'IN BINARY MODE ' along with the OPEN DATASET.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA fname(60) VALUE 'myfile.txt'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF line,&lt;/P&gt;&lt;P&gt;col1 TYPE i,&lt;/P&gt;&lt;P&gt;col2 TYPE i,&lt;/P&gt;&lt;P&gt;END OF line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES itab TYPE line OCCURS 10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: lin TYPE line,&lt;/P&gt;&lt;P&gt;      tab TYPE itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO 5 TIMES.&lt;/P&gt;&lt;P&gt;  lin-col1 = sy-index.&lt;/P&gt;&lt;P&gt;  lin-col2 = sy-index ** 2.&lt;/P&gt;&lt;P&gt;  APPEND lin TO tab.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET fname FOR OUTPUT IN  BINARY MODE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT tab INTO lin.&lt;/P&gt;&lt;P&gt;  TRANSFER lin TO fname.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOSE DATASET fname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET fname FOR INPUT IN BINARY MODE.&lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt;  READ DATASET fname INTO lin.&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;  WRITE: / lin-col1, lin-col2.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOSE DATASET fname.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2005 05:22:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/output-problem-for-open-dataset/m-p/986583#M73123</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-01T05:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: OUTPUT PROBLEM FOR OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/output-problem-for-open-dataset/m-p/986584#M73124</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;try that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA mess(100).
OPEN DATASET fname FOR OUTPUT IN TEXT MODE MESSAGE mess.
IF sy-subrc &amp;lt;&amp;gt; 0.
  WRITE / mess.
  EXIT.
ENDIF.
DATA: BEGIN OF wa , col1(15), col2(15), END OF wa.
LOOP AT tab INTO lin.
   move-corresponding lin to wa.
  TRANSFER wa TO fname.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2005 06:37:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/output-problem-for-open-dataset/m-p/986584#M73124</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2005-07-01T06:37:37Z</dc:date>
    </item>
  </channel>
</rss>

