<?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: how i can get the sap (application server side) root dir (function module)? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-i-can-get-the-sap-application-server-side-root-dir-function-module/m-p/3733356#M898531</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@ Lakshman Tandra    &lt;/P&gt;&lt;P&gt;@ moazam hai&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the quick answers ( i known the RZL_* class..)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anyway&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why i must use function modules that list files and let consider the sap root folder as implicit &lt;/P&gt;&lt;P&gt;(i need to extract it!!...)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why waste resources building a table extracting paths cutting filenames , etc... (because i list files..&lt;/P&gt;&lt;P&gt;instead simply get the physical SAP root path!) ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there isn't a function module as:&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;&lt;/P&gt;&lt;P&gt;that simply return into a string (as GET_SAPGUI_DIRECTORY do..) the correct installation path of SAP?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Michele&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 May 2008 14:35:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-07T14:35:16Z</dc:date>
    <item>
      <title>how i can get the sap (application server side) root dir (function module)?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-i-can-get-the-sap-application-server-side-root-dir-function-module/m-p/3733353#M898528</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 need to get the sap root installation folder (for ex: "C:\MiniWAS")&lt;/P&gt;&lt;P&gt;is there any function modules ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for sap gui directory i use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;DATA PS_WORKDIR TYPE STRING.&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 = PS_WORKDIR.&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but i need also the root path of the SAP application server too!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Michele Berardi&lt;/P&gt;&lt;P&gt;System Developer&lt;/P&gt;&lt;P&gt;&lt;A href="http://berardi.too.it" target="test_blank"&gt;http://berardi.too.it&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2008 13:20:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-i-can-get-the-sap-application-server-side-root-dir-function-module/m-p/3733353#M898528</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-07T13:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: how i can get the sap (application server side) root dir (function module)?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-i-can-get-the-sap-application-server-side-root-dir-function-module/m-p/3733354#M898529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michele,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer url &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5345888"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check FM SUBST_GET_FILE_LIST By passing DIRNAME and FILENM as *, you can see the list of files in that directory.&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;Thanks&lt;/P&gt;&lt;P&gt;Lakshman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2008 13:26:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-i-can-get-the-sap-application-server-side-root-dir-function-module/m-p/3733354#M898529</guid>
      <dc:creator>Lakshmant1</dc:creator>
      <dc:date>2008-05-07T13:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: how i can get the sap (application server side) root dir (function module)?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-i-can-get-the-sap-application-server-side-root-dir-function-module/m-p/3733355#M898530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TRY THIS FMS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RZL_READ_DIR_GLOBAL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RZL_READ_DIR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2008 13:29:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-i-can-get-the-sap-application-server-side-root-dir-function-module/m-p/3733355#M898530</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-07T13:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: how i can get the sap (application server side) root dir (function module)?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-i-can-get-the-sap-application-server-side-root-dir-function-module/m-p/3733356#M898531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@ Lakshman Tandra    &lt;/P&gt;&lt;P&gt;@ moazam hai&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the quick answers ( i known the RZL_* class..)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anyway&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why i must use function modules that list files and let consider the sap root folder as implicit &lt;/P&gt;&lt;P&gt;(i need to extract it!!...)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why waste resources building a table extracting paths cutting filenames , etc... (because i list files..&lt;/P&gt;&lt;P&gt;instead simply get the physical SAP root path!) ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there isn't a function module as:&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;&lt;/P&gt;&lt;P&gt;that simply return into a string (as GET_SAPGUI_DIRECTORY do..) the correct installation path of SAP?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Michele&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2008 14:35:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-i-can-get-the-sap-application-server-side-root-dir-function-module/m-p/3733356#M898531</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-07T14:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: how i can get the sap (application server side) root dir (function module)?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-i-can-get-the-sap-application-server-side-root-dir-function-module/m-p/3733357#M898532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;forget to paste (could be usefull ..)&lt;/P&gt;&lt;P&gt;my solution to this lack of sap function modules..:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

* assume sap home for ex. "C:\MiniWAS\" as implicit

DATA AS_FSYSTEM_SEPARATOR type C
VALUE '\'.



DATA AS_GET_TRIDEDSK_CMD_file type string
VALUE 'gethome.cmd'.

DATA AS_GET_TRIDEDSK_TMP_file type string
VALUE 'TRIDEDSK.tAS'.

DATA: BEGIN OF AS_TRIDEDSKREC,
        PATH(256) type C,
      END OF AS_TRIDEDSKREC.

DATA AS_TRIDEDSK_path type string.

* TOOL AS GET AS_TRIDEDSK_path ---------BEGIN


CONCATENATE AS_GET_TRIDEDSK_CMD_file INTO
AS_GET_TRIDEDSK_CMD_file SEPARATED BY AS_FSYSTEM_SEPARATOR.

CONCATENATE AS_GET_TRIDEDSK_CMD_file AS_GET_TRIDEDSK_TMP_file INTO
AS_GET_TRIDEDSK_CMD_file SEPARATED BY ' '.


OPEN DATASET AS_GET_TRIDEDSK_TMP_file FOR OUTPUT
IN TEXT MODE ENCODING DEFAULT.
CLOSE DATASET AS_GET_TRIDEDSK_TMP_file.


* FILTER[1]: this file must exist (needed by the filter option)
Open Dataset AS_GET_TRIDEDSK_TMP_file for input
     in text mode
     encoding default
filter AS_GET_TRIDEDSK_CMD_file.

CLOSE DATASET AS_GET_TRIDEDSK_TMP_file.


* FILTER[2]: read the result of the system command "echo"
Open Dataset AS_GET_TRIDEDSK_TMP_file for input
     in text mode
     encoding default.

DO.
  READ DATASET AS_GET_TRIDEDSK_TMP_file INTO AS_TRIDEDSKREC.
  IF SY-SUBRC NE 0.
    EXIT.
  ELSE.
    AS_TRIDEDSK_path = AS_TRIDEDSKREC-PATH.
  ENDIF.
ENDDO.

CLOSE DATASET AS_GET_TRIDEDSK_TMP_file.


* TOOL AS GET AS_TRIDEDSK_path -----------END

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is an example of the "gethomecmd.cmd"&lt;/P&gt;&lt;P&gt;called by sap (retreive the full path of sap root),&lt;/P&gt;&lt;P&gt;save it under the SAP ROOT (for ex. "C:\MiniWAS")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gethomecmd.cmd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
rem echo %~dp0&amp;gt; TRIDEDSK.tAS
echo %~dp0&amp;gt; %1
rem echo %~dp0&amp;gt; TRIDEDSK.tAS
rem echo %~dp0&amp;gt; c:\TRIDEDSK.tAS
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this help the comunity ;.-D !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------" /&gt;&lt;P&gt;Michele Berardi&lt;/P&gt;&lt;P&gt;System Developer&lt;/P&gt;&lt;P&gt;&lt;A href="http://berardimichele.interfree.it" target="test_blank"&gt;http://berardimichele.interfree.it&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 22:50:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-i-can-get-the-sap-application-server-side-root-dir-function-module/m-p/3733357#M898532</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T22:50:42Z</dc:date>
    </item>
  </channel>
</rss>

