<?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: get_*_directory problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-directory-problem/m-p/956666#M66495</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mauro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the class CL_GUI_FRONTEND_SERVICES is based on the control framework, so certain methods need to be called together the method CL_GUI_CFW=&amp;gt;FLUSH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After calling your method you have to call the FLUSH:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: dir_temp TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD cl_gui_frontend_services-&amp;gt;get_temp_directory&lt;/P&gt;&lt;P&gt;   CHANGING&lt;/P&gt;&lt;P&gt;     dir_temp = dir temp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL METHOD CL_GUI_CFW=&amp;gt;FLUSH  &lt;/P&gt;&lt;P&gt;   EXCEPTIONS                     &lt;/P&gt;&lt;P&gt;     CNTL_SYSTEM_ERROR = 1  &lt;/P&gt;&lt;P&gt;     CNTL_ERROR = 2         &lt;/P&gt;&lt;P&gt;     OTHERS = 3.            &lt;/P&gt;&lt;P&gt; IF SY-SUBRC &amp;lt;&amp;gt; 0.              &lt;/P&gt;&lt;P&gt;   ......... &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;CALL METHOD cl_gui_frontend_services-&amp;gt;get_sap_workdir&lt;/P&gt;&lt;P&gt;   CHANGING&lt;/P&gt;&lt;P&gt;     sapworkdir = dir temp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL METHOD CL_GUI_CFW=&amp;gt;FLUSH  &lt;/P&gt;&lt;P&gt;   EXCEPTIONS                     &lt;/P&gt;&lt;P&gt;     CNTL_SYSTEM_ERROR = 1  &lt;/P&gt;&lt;P&gt;     CNTL_ERROR = 2         &lt;/P&gt;&lt;P&gt;     OTHERS = 3.            &lt;/P&gt;&lt;P&gt; IF SY-SUBRC &amp;lt;&amp;gt; 0.              &lt;/P&gt;&lt;P&gt;   ......... &lt;/P&gt;&lt;P&gt; ENDIF. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CALL METHOD cl_gui_frontend_services-&amp;gt;get_sapgui_directory&lt;/P&gt;&lt;P&gt;   CHANGING&lt;/P&gt;&lt;P&gt;     sapgui_directory = dir temp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL METHOD CL_GUI_CFW=&amp;gt;FLUSH  &lt;/P&gt;&lt;P&gt;   EXCEPTIONS                     &lt;/P&gt;&lt;P&gt;     CNTL_SYSTEM_ERROR = 1  &lt;/P&gt;&lt;P&gt;     CNTL_ERROR = 2         &lt;/P&gt;&lt;P&gt;     OTHERS = 3.            &lt;/P&gt;&lt;P&gt; IF SY-SUBRC &amp;lt;&amp;gt; 0.              &lt;/P&gt;&lt;P&gt;   ......... &lt;/P&gt;&lt;P&gt; ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Sep 2005 22:36:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-09-30T22:36:35Z</dc:date>
    <item>
      <title>get_*_directory problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-directory-problem/m-p/956665#M66494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using clase cl_gui_frontend_services, and every time that I try to get a directory using any of its methods I always get an empty string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have already tried:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: dir_temp TYPE string.
CALL METHOD cl_gui_frontend_services-&amp;gt;get_temp_directory
   CHANGING
     dir_temp = dir temp.

CALL METHOD cl_gui_frontend_services-&amp;gt;get_sap_workdir
   CHANGING
     sapworkdir = dir temp.

CALL METHOD cl_gui_frontend_services-&amp;gt;get_sapgui_directory
   CHANGING
     sapgui_directory = dir temp.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and all the methods bring an empty string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas of what might happen here??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Mauro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2005 21:53:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-directory-problem/m-p/956665#M66494</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-30T21:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: get_*_directory problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-directory-problem/m-p/956666#M66495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mauro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the class CL_GUI_FRONTEND_SERVICES is based on the control framework, so certain methods need to be called together the method CL_GUI_CFW=&amp;gt;FLUSH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After calling your method you have to call the FLUSH:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: dir_temp TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD cl_gui_frontend_services-&amp;gt;get_temp_directory&lt;/P&gt;&lt;P&gt;   CHANGING&lt;/P&gt;&lt;P&gt;     dir_temp = dir temp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL METHOD CL_GUI_CFW=&amp;gt;FLUSH  &lt;/P&gt;&lt;P&gt;   EXCEPTIONS                     &lt;/P&gt;&lt;P&gt;     CNTL_SYSTEM_ERROR = 1  &lt;/P&gt;&lt;P&gt;     CNTL_ERROR = 2         &lt;/P&gt;&lt;P&gt;     OTHERS = 3.            &lt;/P&gt;&lt;P&gt; IF SY-SUBRC &amp;lt;&amp;gt; 0.              &lt;/P&gt;&lt;P&gt;   ......... &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;CALL METHOD cl_gui_frontend_services-&amp;gt;get_sap_workdir&lt;/P&gt;&lt;P&gt;   CHANGING&lt;/P&gt;&lt;P&gt;     sapworkdir = dir temp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL METHOD CL_GUI_CFW=&amp;gt;FLUSH  &lt;/P&gt;&lt;P&gt;   EXCEPTIONS                     &lt;/P&gt;&lt;P&gt;     CNTL_SYSTEM_ERROR = 1  &lt;/P&gt;&lt;P&gt;     CNTL_ERROR = 2         &lt;/P&gt;&lt;P&gt;     OTHERS = 3.            &lt;/P&gt;&lt;P&gt; IF SY-SUBRC &amp;lt;&amp;gt; 0.              &lt;/P&gt;&lt;P&gt;   ......... &lt;/P&gt;&lt;P&gt; ENDIF. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CALL METHOD cl_gui_frontend_services-&amp;gt;get_sapgui_directory&lt;/P&gt;&lt;P&gt;   CHANGING&lt;/P&gt;&lt;P&gt;     sapgui_directory = dir temp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL METHOD CL_GUI_CFW=&amp;gt;FLUSH  &lt;/P&gt;&lt;P&gt;   EXCEPTIONS                     &lt;/P&gt;&lt;P&gt;     CNTL_SYSTEM_ERROR = 1  &lt;/P&gt;&lt;P&gt;     CNTL_ERROR = 2         &lt;/P&gt;&lt;P&gt;     OTHERS = 3.            &lt;/P&gt;&lt;P&gt; IF SY-SUBRC &amp;lt;&amp;gt; 0.              &lt;/P&gt;&lt;P&gt;   ......... &lt;/P&gt;&lt;P&gt; ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2005 22:36:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-directory-problem/m-p/956666#M66495</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-30T22:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: get_*_directory problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-directory-problem/m-p/956667#M66496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kindly check this demo program&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;TEST_FRONTEND_SERVICES&amp;lt;/b&amp;gt;&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;Test GET_TEMP_DIRECTORY&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*************************************************&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF NOT P26 IS INITIAL.

  data: tempdir type string.

  CALL METHOD CL_GUI_FRONTEND_SERVICES=&amp;gt;GET_TEMP_DIRECTORY
                            CHANGING
                              TEMP_DIR     = tempdir
                            EXCEPTIONS
                              CNTL_ERROR   = 1
                              ERROR_NO_GUI = 2
                              others       = 3
                                  .
  IF SY-SUBRC &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  CALL METHOD CL_GUI_CFW=&amp;gt;UPDATE_VIEW
*  EXPORTING
*    CALLED_BY_SYSTEM  =
                            EXCEPTIONS
                              CNTL_SYSTEM_ERROR = 1
                              CNTL_ERROR        = 2
                              others            = 3.

  IF SY-SUBRC &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  if not tempdir is initial.
    write: / 'Temp directory is: ', tempdir.
    write: / 'GET_TEMP_DIRECTORY test ok.'.
  else.
    write: / 'GET_TEMP_DIRECTORY test failed.'.
  endif.
  write: / '---------------------------------------------------'.

ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can check this similar type of code sample in the demo program.&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;Kindly reward points for the answers which helped ot get back with queries.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2005 04:22:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-directory-problem/m-p/956667#M66496</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-03T04:22:02Z</dc:date>
    </item>
  </channel>
</rss>

