<?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: Find SapWorkDir path in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-sapworkdir-path/m-p/1263068#M148200</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi flora,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. The neat way is to DETECT&lt;/P&gt;&lt;P&gt;   which is the SAP Directory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report abc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : ret(100) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CALL FUNCTION 'GUI_GET_DESKTOP_INFO'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    type          = 11 " &amp;lt;----&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt; Important&lt;/P&gt;&lt;P&gt;  changing&lt;/P&gt;&lt;P&gt;    return        = RET&lt;/P&gt;&lt;P&gt;          .&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BREAK-POINT.&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RET will contain the FULL PATH.&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;P&gt;1:  Host name (host name of current system)                                                                                &lt;/P&gt;&lt;P&gt;2:  Windows directory                                                                                &lt;/P&gt;&lt;P&gt;3:  System directory                                                                                &lt;/P&gt;&lt;P&gt;4:  Temp. directory                                                                                &lt;/P&gt;&lt;P&gt;5:  Domain user name                                                                                &lt;/P&gt;&lt;P&gt;6:  Platform                                                                                &lt;/P&gt;&lt;P&gt;7:  Windows build number                                                                                &lt;/P&gt;&lt;P&gt;8:  Windows version                                                                                &lt;/P&gt;&lt;P&gt;9:  Program name                                                                                &lt;/P&gt;&lt;P&gt;10: Program path                                                                                &lt;/P&gt;&lt;P&gt;11: Current directory (Directory for current process)                                                                                &lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Mar 2006 11:38:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-03-16T11:38:20Z</dc:date>
    <item>
      <title>Find SapWorkDir path</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-sapworkdir-path/m-p/1263065#M148197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the following fn module:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'DOWNLOAD'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        filename                = 'C:\LOG.TXT'&lt;/P&gt;&lt;P&gt;        filetype                = 'ASC'&lt;/P&gt;&lt;P&gt;      TABLES&lt;/P&gt;&lt;P&gt;        data_tab                = it_log&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the paramater &amp;lt;b&amp;gt;filename&amp;lt;/b&amp;gt; I want to give default as the path to the SapWorkDir of the user logged in currently. (Usually it is c:\Documents and Settings\&amp;lt;username&amp;gt;\SapWorkDir\). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But do we have a neat way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2006 11:30:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-sapworkdir-path/m-p/1263065#M148197</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-16T11:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Find SapWorkDir path</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-sapworkdir-path/m-p/1263066#M148198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi flora ,&lt;/P&gt;&lt;P&gt;declare&lt;/P&gt;&lt;P&gt;data :filename LIKE rlgrap-filename default value 'C:\path..... ' modif id d1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            mask      = '&lt;STRONG&gt;.xls' (/ '&lt;/STRONG&gt;.txt')&lt;/P&gt;&lt;P&gt;            static    = 'X'&lt;/P&gt;&lt;P&gt;       CHANGING&lt;/P&gt;&lt;P&gt;            file_name = filename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps ,&lt;/P&gt;&lt;P&gt;vikky.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Vikky&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2006 11:35:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-sapworkdir-path/m-p/1263066#M148198</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-16T11:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: Find SapWorkDir path</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-sapworkdir-path/m-p/1263067#M148199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The system variable sy-uname has the name of the user logged on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can get this value into a variable and substitute into the &amp;lt;username&amp;gt; part of the URL.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: v_filename(100).

concatenate 'c:Documents and Settings' sy-uname separated by '' into v_filename.

concatenate v_filename 'SapWorkDir' into v_filename.
*Now call the FM

CALL FUNCTION 'DOWNLOAD'
EXPORTING
filename = v_filename
filetype = 'ASC'
TABLES
data_tab = it_log

&lt;/CODE&gt;&lt;/PRE&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;Sudha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Sudha Mohan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2006 11:35:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-sapworkdir-path/m-p/1263067#M148199</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-16T11:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Find SapWorkDir path</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-sapworkdir-path/m-p/1263068#M148200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi flora,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. The neat way is to DETECT&lt;/P&gt;&lt;P&gt;   which is the SAP Directory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report abc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : ret(100) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CALL FUNCTION 'GUI_GET_DESKTOP_INFO'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    type          = 11 " &amp;lt;----&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt; Important&lt;/P&gt;&lt;P&gt;  changing&lt;/P&gt;&lt;P&gt;    return        = RET&lt;/P&gt;&lt;P&gt;          .&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BREAK-POINT.&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RET will contain the FULL PATH.&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;P&gt;1:  Host name (host name of current system)                                                                                &lt;/P&gt;&lt;P&gt;2:  Windows directory                                                                                &lt;/P&gt;&lt;P&gt;3:  System directory                                                                                &lt;/P&gt;&lt;P&gt;4:  Temp. directory                                                                                &lt;/P&gt;&lt;P&gt;5:  Domain user name                                                                                &lt;/P&gt;&lt;P&gt;6:  Platform                                                                                &lt;/P&gt;&lt;P&gt;7:  Windows build number                                                                                &lt;/P&gt;&lt;P&gt;8:  Windows version                                                                                &lt;/P&gt;&lt;P&gt;9:  Program name                                                                                &lt;/P&gt;&lt;P&gt;10: Program path                                                                                &lt;/P&gt;&lt;P&gt;11: Current directory (Directory for current process)                                                                                &lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2006 11:38:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-sapworkdir-path/m-p/1263068#M148200</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-16T11:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Find SapWorkDir path</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-sapworkdir-path/m-p/1263069#M148201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sudha, it may be possibel that the windows is installed in some other drive than C:\ or the user has set her SapWorkDir to some other folder&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2006 11:42:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-sapworkdir-path/m-p/1263069#M148201</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-16T11:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Find SapWorkDir path</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-sapworkdir-path/m-p/1263070#M148202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Flora lab... You may also use the class CL_GUI_FRONTEND_SERVICES, Method GET_SAPGUI_WORKDIR:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: 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_workdir&lt;/P&gt;&lt;P&gt;     IMPORTING &lt;/P&gt;&lt;P&gt;          SAPWORKDIR = workdir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2006 11:43:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-sapworkdir-path/m-p/1263070#M148202</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-16T11:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Find SapWorkDir path</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-sapworkdir-path/m-p/1263071#M148203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Flora,&lt;/P&gt;&lt;P&gt; The best way is to let the user choose the path like this..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA itab LIKE TABLE OF FILE_TABLE WITH HEADER LINE.
data : filename type string.
PARAMETERS : DATASET(128).

AT SELECTION-SCREEN ON VALUE-REQUEST FOR DATASET.
CALL FUNCTION 'TMP_GUI_FILE_OPEN_DIALOG'
  TABLES
    FILE_TABLE              = itab
.

 READ TABLE ITAB index 1.
  DATASET = itab-FILENAME.
  fielname = DATASET.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and then call..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'DOWNLOAD'
EXPORTING
filename = fielname
filetype = 'ASC'
TABLES
data_tab = it_log&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;satesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2006 12:03:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-sapworkdir-path/m-p/1263071#M148203</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-16T12:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Find SapWorkDir path</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-sapworkdir-path/m-p/1263072#M148204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;this works good

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  YCHATEST                                                    *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;                                                                     *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*

REPORT  ychatest                                .


DATA : sapworkdir TYPE string.
PARAMETERS : workdir TYPE rlgrap-filename.



INITIALIZATION.

  CALL METHOD cl_gui_frontend_services=&amp;gt;registry_get_value
      EXPORTING
        root         = cl_gui_frontend_services=&amp;gt;hkey_current_user
        key          =
        'SoftwareSAPSAPGUI FrontSAP Frontend ServerFiletransfer'
        value        = 'PathDownload'
       IMPORTING
         reg_value   = sapworkdir
         EXCEPTIONS
         get_regvalue_failed  = 1
         cntl_error           = 2
         error_no_gui         = 3
         not_supported_by_gui = 4
         OTHERS               = 5.

  IF sy-subrc &amp;lt;&amp;gt; 0 OR sapworkdir = ''.
    CALL METHOD cl_gui_frontend_services=&amp;gt;directory_get_current
      CHANGING
        current_directory            = sapworkdir
      EXCEPTIONS
        directory_get_current_failed = 1
        cntl_error                   = 2
        error_no_gui                 = 3
        not_supported_by_gui         = 4
        OTHERS                       = 5.
    CALL METHOD cl_gui_cfw=&amp;gt;flush.
  ENDIF.

  workdir = sapworkdir.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2006 12:10:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-sapworkdir-path/m-p/1263072#M148204</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-16T12:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Find SapWorkDir path</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-sapworkdir-path/m-p/1263073#M148205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the user needs to select the directory in which to put the file, its better you get it as input from the selection screen and then assign it to the FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sudha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2006 12:24:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-sapworkdir-path/m-p/1263073#M148205</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-16T12:24:14Z</dc:date>
    </item>
  </channel>
</rss>

