<?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: howto 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/howto-get-the-sap-application-server-side-root-dir-function-module/m-p/4089323#M977800</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Rama&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as i explained in my old post:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="853124"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the &lt;/P&gt;&lt;P&gt;RZL_READ_DIR_GLOBAL function module&lt;/P&gt;&lt;P&gt;consider the SAP root path as implicit...&lt;/P&gt;&lt;P&gt;and you don't have a way to retreive it..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need the "Absolute Path" instead of a simple list&lt;/P&gt;&lt;P&gt;of "relative paths" (in case of you must pass the path&lt;/P&gt;&lt;P&gt;to external programs...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is the reason behind my workaround ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Michele&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Jul 2008 11:19:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-03T11:19:33Z</dc:date>
    <item>
      <title>howto get the sap (application server side) root dir (function module)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/howto-get-the-sap-application-server-side-root-dir-function-module/m-p/4089321#M977798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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;it's easy to adapt the code to any os with the&lt;/P&gt;&lt;P&gt;right modifications (use this as a sort of exercise)..&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>Thu, 03 Jul 2008 10:35:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/howto-get-the-sap-application-server-side-root-dir-function-module/m-p/4089321#M977798</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-03T10:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: howto get the sap (application server side) root dir (function module)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/howto-get-the-sap-application-server-side-root-dir-function-module/m-p/4089322#M977799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michele Berardi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use the Function Module &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RZL_READ_DIR_GLOBAL&lt;/STRONG&gt; ,You willl get all the directories on the aplliction server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Among those The common prex in all the paths gives you the root directory of your application server.&lt;/P&gt;&lt;P&gt;Hope this logic solves your probelm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rama.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2008 10:52:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/howto-get-the-sap-application-server-side-root-dir-function-module/m-p/4089322#M977799</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-03T10:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: howto get the sap (application server side) root dir (function module)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/howto-get-the-sap-application-server-side-root-dir-function-module/m-p/4089323#M977800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Rama&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as i explained in my old post:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="853124"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the &lt;/P&gt;&lt;P&gt;RZL_READ_DIR_GLOBAL function module&lt;/P&gt;&lt;P&gt;consider the SAP root path as implicit...&lt;/P&gt;&lt;P&gt;and you don't have a way to retreive it..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need the "Absolute Path" instead of a simple list&lt;/P&gt;&lt;P&gt;of "relative paths" (in case of you must pass the path&lt;/P&gt;&lt;P&gt;to external programs...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is the reason behind my workaround ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Michele&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2008 11:19:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/howto-get-the-sap-application-server-side-root-dir-function-module/m-p/4089323#M977800</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-03T11:19:33Z</dc:date>
    </item>
  </channel>
</rss>

