<?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: Query Windows XP environmental variable from ABAP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-windows-xp-environmental-variable-from-abap/m-p/1758605#M328481</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You dont need to create an object for the class since it is a static method. You can use the class name directly to call the method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL METHOD CL_GUI_FRONTEND_SERVICES=&amp;gt;GET_SAPGUI_WORKDIR&lt;/P&gt;&lt;P&gt;      CHANGING sapworkdir = lv_sapworkdir.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Manoj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Dec 2006 10:43:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-19T10:43:26Z</dc:date>
    <item>
      <title>Query Windows XP environmental variable from ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-windows-xp-environmental-variable-from-abap/m-p/1758602#M328478</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 would like to know, is there a way to query the logged user's documents and settings directory in Windows XP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example if Bill Gates is using his Windows XP home (and not his Linux &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;), his documents directory will be on the following path: "C:Documents and settingsBill GatesDocuments".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to get this path from ABAP (with a FM or with a class maybe).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;Tamá&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Dec 2006 09:48:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-windows-xp-environmental-variable-from-abap/m-p/1758602#M328478</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-19T09:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Query Windows XP environmental variable from ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-windows-xp-environmental-variable-from-abap/m-p/1758603#M328479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; use the method GET_SAPGUI_WORKDIR of class CL_GUI_FRONTEND_SERVICES. This method will return the SAP Working directory which will be C:\Documents and Settings\User\SAPWorkdir&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; GET_DESKTOP_DIRECTORY will return the desktop directory. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; ENVIRONMENT_GET_VARIABLE will get the value of an environment variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Manoj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Dec 2006 09:51:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-windows-xp-environmental-variable-from-abap/m-p/1758603#M328479</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-19T09:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Query Windows XP environmental variable from ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-windows-xp-environmental-variable-from-abap/m-p/1758604#M328480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanx for the answer... Sadly I receive only a blank field, I'll attach my coding, did I forget sg?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

DATA: go_gui_frontend type ref to CL_GUI_FRONTEND_SERVICES.
DATA: lv_sapworkdir TYPE string.
...

    CREATE OBJECT go_gui_frontend.

    CLEAR lv_sapworkdir.
    CALL METHOD go_gui_frontend-&amp;gt;GET_SAPGUI_WORKDIR
      CHANGING sapworkdir = lv_sapworkdir.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you &lt;/P&gt;&lt;P&gt;Tamá&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Dec 2006 10:28:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-windows-xp-environmental-variable-from-abap/m-p/1758604#M328480</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-19T10:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Query Windows XP environmental variable from ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-windows-xp-environmental-variable-from-abap/m-p/1758605#M328481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You dont need to create an object for the class since it is a static method. You can use the class name directly to call the method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL METHOD CL_GUI_FRONTEND_SERVICES=&amp;gt;GET_SAPGUI_WORKDIR&lt;/P&gt;&lt;P&gt;      CHANGING sapworkdir = lv_sapworkdir.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Manoj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Dec 2006 10:43:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-windows-xp-environmental-variable-from-abap/m-p/1758605#M328481</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-19T10:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Query Windows XP environmental variable from ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-windows-xp-environmental-variable-from-abap/m-p/1758606#M328482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems this method is not working... It gives only a blank field for me...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Dec 2006 12:09:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-windows-xp-environmental-variable-from-abap/m-p/1758606#M328482</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-19T12:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: Query Windows XP environmental variable from ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-windows-xp-environmental-variable-from-abap/m-p/1758607#M328483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does anyone know why this is not working?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or another solution?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jan 2007 13:19:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-windows-xp-environmental-variable-from-abap/m-p/1758607#M328483</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-11T13:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Query Windows XP environmental variable from ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-windows-xp-environmental-variable-from-abap/m-p/1758608#M328484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Probably need to add a flush.  I was trying to figure this out myself, here is the example I got to work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ztest_enviromentalvariable .&lt;/P&gt;&lt;P&gt;DATA: go_gui_frontend TYPE REF TO cl_gui_frontend_services.&lt;/P&gt;&lt;P&gt;DATA: lv_tmp TYPE string.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CREATE OBJECT go_gui_frontend.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CLEAR lv_tmp.&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;environment_get_variable&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    variable   = 'TMP'&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    value      = lv_tmp&lt;/P&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    cntl_error = 1&lt;/P&gt;&lt;P&gt;    OTHERS     = 2&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;CALL METHOD CL_GUI_CFW=&amp;gt;FLUSH&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CNTL_SYSTEM_ERROR = 1&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CNTL_ERROR = 2&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;OTHERS = 3.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Error handling&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;WRITE: / lv_tmp.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 12:40:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-windows-xp-environmental-variable-from-abap/m-p/1758608#M328484</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T12:40:06Z</dc:date>
    </item>
  </channel>
</rss>

