Saturday, March 15, 2014
CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES method retrieves a list of the directories and/or files on the client PC in the specified directory.
REPORT ZTEST_FRONT_END_SERVICES. *&----------------------------------------------------* * Declaration *&----------------------------------------------------* DATA: lt_file_table TYPE TABLE OF file_info, ls_file_table LIKE LINE OF lt_file_table. DATA: lv_count TYPE i. data: lv_last_char TYPE c. data lv_filename TYPE string. *&----------------------------------------------------* * Selection-screen *&----------------------------------------------------* PARAMETERS: p_dir type string. *&----------------------------------------------------* * Start-of-selection *&----------------------------------------------------* START-OF-SELECTION. CALL METHOD cl_gui_frontend_services=>directory_list_files EXPORTING directory = p_dir * filter = '*.*' files_only = 'X' CHANGING file_table = lt_file_table count = lv_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 <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ELSE. LOOP AT lt_file_table INTO ls_file_table. IF lv_last_char = '\'. CONCATENATE p_dir ls_file_table-filename INTO lv_filename. ELSE. CONCATENATE p_dir '\' ls_file_table-filename INTO lv_filename. ENDIF. WRITE lv_filename. ENDLOOP. ENDIF.
Followers
Popular Posts
- ABAP - ALV Report example with steps
- ABAP - Step by step tutorial on Smart Forms - Template Node
- ABAP - Sending email with pdf attachment
- SAP Adobe Form - Steps to create simple ADOBE Form and calling it from ABAP Program
- SAP ABAP - CL_ABAP_CHAR_UTILITIES class usage
- ABAP - Multiple value selection from F4 help for SELECT-OPTIONS
- Execute ABAP Report using SUBMIT statement
- ABAP - Select all or Deselect all in ALV or Check box handling in ALV
- Web Dynpro ABAP ALV - ON_CLICK event
- ABAP - Dynamic WHERE clause
Nice Blog..
ReplyDeleteI just want to know the class and method to get AL11 dictionary files.