<?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: Directory in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/directory/m-p/5508405#M1259723</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;Use FM KD_GET_FILENAME_ON_F4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-RJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Apr 2009 06:28:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-16T06:28:55Z</dc:date>
    <item>
      <title>Directory</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/directory/m-p/5508404#M1259722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me in this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.I have to select the particular path&lt;/P&gt;&lt;P&gt;Ex: c:\new folder\prog&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.Then i want to display the list (file names) in that particular folder in ABAP .&lt;/P&gt;&lt;P&gt;Ex: in prog i have 5 excel files.i want to display the list(file names).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.when i click on the particular file it has to open .&lt;/P&gt;&lt;P&gt;Ex: in prog folder a.doc file is there when i click that file a.doc file has to open using ABAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 06:27:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/directory/m-p/5508404#M1259722</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-16T06:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: Directory</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/directory/m-p/5508405#M1259723</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;Use FM KD_GET_FILENAME_ON_F4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-RJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 06:28:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/directory/m-p/5508405#M1259723</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-16T06:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: Directory</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/directory/m-p/5508406#M1259724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use this method cl_gui_frontend_services=&amp;gt;directory_list_files&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 06:56:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/directory/m-p/5508406#M1259724</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-16T06:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Directory</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/directory/m-p/5508407#M1259725</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;Check these two FM's&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C13G0_GET_FILENAME_F4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KD_GET_FILENAME_ON_F4          Filemanager support to locate file in a directory (on value request)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jyothi CH.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 06:59:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/directory/m-p/5508407#M1259725</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-16T06:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Directory</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/directory/m-p/5508408#M1259726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this FM, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL  FUNCTION KD_GET_FILENAME_ON_F4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Joan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 07:17:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/directory/m-p/5508408#M1259726</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-16T07:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Directory</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/directory/m-p/5508409#M1259727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have developed a demo program now for this. Please check:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  z_test_open_file NO STANDARD PAGE HEADING.

PARAMETERS:
p_folder TYPE localfile.

DATA:
      v_folder TYPE string,
      it_file_tab TYPE STANDARD TABLE OF file_info,
      wa_file_tab TYPE file_info.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_folder.

* Browse the directory you want to
  CALL METHOD cl_gui_frontend_services=&amp;gt;directory_browse
    EXPORTING
      window_title         = 'Directory Browse'
      initial_folder       = 'C:\Documents and Settings\ssaha\Desktop'
    CHANGING
      selected_folder      = v_folder
    EXCEPTIONS
      cntl_error           = 1
      error_no_gui         = 2
      not_supported_by_gui = 3
      OTHERS               = 4.
  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.

  p_folder = v_folder.

START-OF-SELECTION.

  DATA: l_v_count TYPE i.

  CALL METHOD cl_gui_frontend_services=&amp;gt;directory_list_files
    EXPORTING
      directory                   = v_folder
*    filter                      = '*.*'
*    files_only                  =
*    directories_only            =
    CHANGING
      file_table                  = it_file_tab
      count                       = l_v_count
  EXCEPTIONS
    cntl_error                  = 1
    directory_list_files_failed = 2
    wrong_parameter             = 3
    error_no_gui                = 4
    not_supported_by_gui        = 5
    OTHERS                      = 6
          .
  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.

END-OF-SELECTION.

  LOOP AT it_file_tab INTO wa_file_tab.
    WRITE: / wa_file_tab-filename HOTSPOT.
  ENDLOOP.

AT LINE-SELECTION.
  DATA:
        l_v_line TYPE i,
        l_v_doc TYPE string.

  GET CURSOR LINE l_v_line.

  IF l_v_line IS NOT INITIAL.

    READ TABLE it_file_tab INTO wa_file_tab INDEX l_v_line.

    IF sy-subrc = 0.

      CONCATENATE v_folder '\' wa_file_tab-filename INTO l_v_doc.

      CALL METHOD cl_gui_frontend_services=&amp;gt;execute
        EXPORTING
          document               = l_v_doc
*          application            =
*          parameter              =
          default_directory      = v_folder
*          maximized              =
*          minimized              =
*          synchronous            =
*          operation              = 'OPEN'
        EXCEPTIONS
          cntl_error             = 1
          error_no_gui           = 2
          bad_parameter          = 3
          file_not_found         = 4
          path_not_found         = 5
          file_extension_unknown = 6
          error_execute_failed   = 7
          synchronous_failed     = 8
          not_supported_by_gui   = 9
          OTHERS                 = 10
              .
      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.

    ENDIF.

  ENDIF.&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;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 08:50:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/directory/m-p/5508409#M1259727</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-04-16T08:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: Directory</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/directory/m-p/5508410#M1259728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;use  F4_IF_FIELD_VALUE_REQUEST or F4IF_INT_TABLE_VALUE_REQUEST to have F4 help for file path,&lt;/P&gt;&lt;P&gt;EPS_GET_DIRECTORY_LISTING to get the list of files. &lt;/P&gt;&lt;P&gt;To open the file when clicked, use interactive reports. Use AT line selection event. IN that get the clicked file name and open it using GUI_UPLOAD.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 09:00:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/directory/m-p/5508410#M1259728</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-16T09:00:25Z</dc:date>
    </item>
  </channel>
</rss>

