<?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: problem with open dataset in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-open-dataset/m-p/1473230#M222201</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One thing is the file name that u give doesn't make any sense to me. Becuse the files in the SAP application server are stored in unix OS. SO the file naming convention u have followed is incorrect. One more thing r u trying to download file to Presentation server???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Aug 2006 11:16:08 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-30T11:16:08Z</dc:date>
    <item>
      <title>problem with open dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-open-dataset/m-p/1473229#M222200</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 am trying to generate file in the system,it is working fine when we execute through front end ,but when we are trying to execute through backend it is not working,can any body help me on this.following is the code i have used.&lt;/P&gt;&lt;P&gt;&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  ZPFA_HIER_LOAD&lt;/P&gt;&lt;P&gt;*&amp;amp;&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; This program is directly fetch the data from Comshare Unit_tree table&lt;/P&gt;&lt;P&gt;*&amp;amp; Will create a text file logical directory&lt;/P&gt;&lt;P&gt;*&amp;amp;&lt;/P&gt;&lt;P&gt;*&amp;amp; Author :Shirisha Bandi.&lt;/P&gt;&lt;P&gt;*&amp;amp; Date   :20.08.2006&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;&lt;/P&gt;&lt;P&gt;REPORT  ZFPA_HIER_LOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*---- Declaration of Oracle connectioN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA con_name LIKE dbcon-con_name VALUE 'COMSHARE'.&lt;/P&gt;&lt;P&gt;DATA: MFL1(9),MFL2(5),MFL3(9),MFL4(2),MFL5(8) TYPE c.&lt;/P&gt;&lt;P&gt;DATA : mfilename type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of matab1 occurs 0,&lt;/P&gt;&lt;P&gt;      MFL1(9) TYPE C,&lt;/P&gt;&lt;P&gt;      MFL2(5) TYPE C,&lt;/P&gt;&lt;P&gt;      MFL3(9) TYPE C,&lt;/P&gt;&lt;P&gt;      MFL4(2) TYPE C,&lt;/P&gt;&lt;P&gt;      MFL5(8) TYPE C  ,&lt;/P&gt;&lt;P&gt;     end of matab1 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: setid(8) type c.&lt;/P&gt;&lt;P&gt;data: begin of source occurs 0,&lt;/P&gt;&lt;P&gt;      setid(8) type c,&lt;/P&gt;&lt;P&gt;      end of source.&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;*PARAMETERS : p_pfile LIKE filename-FILEEXTERN.&lt;/P&gt;&lt;P&gt;*PARAMETERS : m_bsenty(8). " type c obligatory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*mfilename = P_PFILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXEC SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SET CONNECTION :con_name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDEXEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXEC SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CONNECT TO :con_name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDEXEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXEC SQL PERFORMING get_source.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT set_id FROM UNIT_SET INTO&lt;/P&gt;&lt;P&gt;  :setid&lt;/P&gt;&lt;P&gt;  ORDER BY SET_ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDEXEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT SOURCE.&lt;/P&gt;&lt;P&gt;  REFRESH matab1. CLEAR matab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  EXEC SQL PERFORMING evaluate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT TO_CHAR(MEM_ID),TRIM(TO_CHAR(MEM_PID)) FROM UNIT_TREE INTO :MFL1,&lt;/P&gt;&lt;P&gt;:MFL5&lt;/P&gt;&lt;P&gt;where set_id = :SOURCE-SETID ORDER BY MEM_ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDEXEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if SOURCE-SETID = '80000000'.&lt;/P&gt;&lt;P&gt;   mfilename = 'C:\aesorg.csv'.&lt;/P&gt;&lt;P&gt;  elseif SOURCE-SETID = '80000006'.&lt;/P&gt;&lt;P&gt;   mfilename = 'C:\Consolidation_Manager.csv'.&lt;/P&gt;&lt;P&gt;  elseif SOURCE-SETID = '80000010'.&lt;/P&gt;&lt;P&gt;   mfilename = 'C:\10org.csv'.&lt;/P&gt;&lt;P&gt;  elseif SOURCE-SETID = '80000012'.&lt;/P&gt;&lt;P&gt;   mfilename = 'C:\20org.csv'.&lt;/P&gt;&lt;P&gt;  elseif SOURCE-SETID = '80000018'.&lt;/P&gt;&lt;P&gt;   mfilename = 'C:\30org.csv'.&lt;/P&gt;&lt;P&gt;  elseif SOURCE-SETID = '80000025'.&lt;/P&gt;&lt;P&gt;   mfilename = 'C:\40org.csv'.&lt;/P&gt;&lt;P&gt;  Endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  open dataset mfilename for INPUT IN TEXT MODE ENCODING DEFAULT.&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;  close dataset mfilename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   EXPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     FILENAME         = MFILENAME&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     FILETYPE         = 'ASC'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   TABLES&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     data_tab         = matab1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     file_write_error = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     invalid_type     = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     no_authority     = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     unknown_error    = 4&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     OTHERS           = 10.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; clear matab1.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;     MFL5 = '0'.&lt;/P&gt;&lt;P&gt;   CLEAR MFL5.&lt;/P&gt;&lt;P&gt;FORM evaluate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if MFL5 = -1.&lt;/P&gt;&lt;P&gt;    MFL5 = ''.&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;  concatenate MFL1 ','   into MFL1.&lt;/P&gt;&lt;P&gt;  concatenate MFL1 ','   into MFL3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  matab1-MFL1 = MFL1.&lt;/P&gt;&lt;P&gt;  matab1-MFL2 = 'ZBUE,'.&lt;/P&gt;&lt;P&gt;  matab1-MFL3 = MFL3.&lt;/P&gt;&lt;P&gt;  matab1-MFL4 = ' ,'.&lt;/P&gt;&lt;P&gt;  matab1-MFL5 = MFL5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  append matab1 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR MFL1.&lt;/P&gt;&lt;P&gt;  CLEAR MFL2.&lt;/P&gt;&lt;P&gt;  CLEAR MFL3.&lt;/P&gt;&lt;P&gt;  CLEAR MFL4.&lt;/P&gt;&lt;P&gt;  CLEAR MFL5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                 "evaluate&lt;/P&gt;&lt;P&gt;&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;      Form  GET_SOURCE&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM GET_SOURCE.&lt;/P&gt;&lt;P&gt;  source-setid = setid.&lt;/P&gt;&lt;P&gt;  append source.&lt;/P&gt;&lt;P&gt;  clear source.&lt;/P&gt;&lt;P&gt;ENDFORM.                    "GET_SOURCE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 11:03:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-open-dataset/m-p/1473229#M222200</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T11:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: problem with open dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-open-dataset/m-p/1473230#M222201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One thing is the file name that u give doesn't make any sense to me. Becuse the files in the SAP application server are stored in unix OS. SO the file naming convention u have followed is incorrect. One more thing r u trying to download file to Presentation server???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 11:16:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-open-dataset/m-p/1473230#M222201</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T11:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: problem with open dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-open-dataset/m-p/1473231#M222202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;no where you given TRANSFER &amp;lt;DATA&amp;gt; TO FILENAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then how you can store data in the file..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;b&amp;gt;open dataset mfilename for INPUT IN TEXT MODE ENCODING DEFAULT.
if sy-subrc &amp;lt;&amp;gt; 0.
exit.
endif.
close dataset mfilename.&amp;lt;/b&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;here you are opening the file and then closing it.in between you should use TRANSFER to transfer itab data to the file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 11:19:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-open-dataset/m-p/1473231#M222202</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T11:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: problem with open dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-open-dataset/m-p/1473232#M222203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for fast response.&lt;/P&gt;&lt;P&gt;I am trying to genarate file in presentation server ,but when it is foreground it is working fine,but in background it is not generating file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 11:20:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-open-dataset/m-p/1473232#M222203</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T11:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: problem with open dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-open-dataset/m-p/1473233#M222204</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 must transfer matab1 to file mfilename &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at matab1.
 transfer matab1 to mfilename.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Message was edited by: Andreas Mann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 11:21:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-open-dataset/m-p/1473233#M222204</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2006-08-30T11:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: problem with open dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-open-dataset/m-p/1473234#M222205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can NOT directly download data to the presentation server in BACKGROUND mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the link how to do this,with this way you can download it to the presentation server.&lt;/P&gt;&lt;P&gt;&amp;lt;a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9831750a-0801-0010-1d9e-f8c64efb2bd2"&amp;gt;Download data to Presentation server in Background Mode&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;srikanth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Srikanth Kidambi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 11:39:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-open-dataset/m-p/1473234#M222205</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T11:39:14Z</dc:date>
    </item>
  </channel>
</rss>

