Cl_gui_frontend_services= directory_list_files issue

Hi,
Iu2019m using cl_gui_frontend_services=>directory_list_files to retrieve creation date form files in my PC. Iu2019m having 3 hours difference between the creation date in the properties visualized by the SO and the values returned by this method. Are there some time zone configurations for this class?
Regards and thank you!

I didn't notice it before that method DIRECTORY_LIST_FILES returns the date & time in the UTC timezone. To be able to get the correct time based on your timezone, you may need to do something like this.
  DATA: lwa_files LIKE LINE OF ct_files.
  FIELD-SYMBOLS: <lfs_files> LIKE LINE OF ct_files.
  DATA: lv_timec TYPE char16.
  DATA: lv_times TYPE timestamp.
  LOOP AT ct_files ASSIGNING <lfs_files>.
    CONCATENATE <lfs_files>-writedate <lfs_files>-writetime INTO lv_timec.
    lv_times = lv_timec.
    CONVERT TIME STAMP lv_times TIME ZONE sy-zonlo
      INTO DATE <lfs_files>-writedate
           TIME <lfs_files>-writetime.
  ENDLOOP.
Regards,
Naimesh Patel

Similar Messages

  • CL_GUI_FRONTEND_SERVICES= DIRECTORY_LIST_FILES

    Hi experts,
    I have a problem using CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES.
    I want to read out all directories on my local hdd ( c:\ )
    Under SAP ECC 6.0 the return value of the method is always empty.
    Under 4.6c the directories are returned correctly.
    Anyone an idea ? Maybe basic customizing failure ?

    >
    Tim Anlauf wrote:
    > Hi experts,
    >
    > I have a problem using CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES.
    > I want to read out all directories on my local hdd ( c:\ )
    >
    > Under SAP ECC 6.0 the return value of the method is always empty.
    > Under 4.6c the directories are returned correctly.
    >
    > Anyone an idea ? Maybe basic customizing failure ?
    Alright, i can get the files and directories in C drive.
    I just passed C:\ -> Directory and filter .
    Leave everything else blank.
    Just do this in SE24, you will be able to see what is happening.

  • Cl_gui_frontend_services= gui_download - issue with german special char

    Hello,
    we are using cl_gui_frontend_services=>gui_download to create from an itab an excel file.
    We face the issue that in this excel file german special characters like Ä, Ü, Ö, ß are not displayed correctly.
    I think we need to use a different codepage. But which one?
    could you please give us a short coding example how to call cl_gui_frontend_services=>gui_download.
    Thanks a lot
    Kind regards
    Manfred

    Hi,
    Check the system is unicode or non-unicode . Codepage for Unicode system is ' 4102' and non-unicode is '1100'.
    Below are the sample code for the GUI_download with Class.
    DATA:  l_filename    TYPE string,
           l_filen       TYPE string,
           l_path        TYPE string,
           l_fullpath    TYPE string,
           l_usr_act     TYPE I.
    l_filename = SPACE.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
      EXPORTING
        DEFAULT_FILE_NAME    = l_filename
      CHANGING
        FILENAME             = l_filen
        PATH                 = l_path
        FULLPATH             = l_fullpath
        USER_ACTION          = l_usr_act
      EXCEPTIONS
        CNTL_ERROR           = 1
        ERROR_NO_GUI         = 2     
        NOT_SUPPORTED_BY_GUI = 3
        others               = 4.
    IF sy-subrc = 0
          AND l_usr_act <>
          CL_GUI_FRONTEND_SERVICES=>ACTION_CANCEL.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME                        = l_fullpath
       FILETYPE                        = 'DAT'
      TABLES
        DATA_TAB                        = T_DOWNL
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22.
    IF SY-SUBRC <> 0.
       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDIF.
    Edited by: Sumodh P on May 11, 2010 5:24 PM

  • CL_GUI_FRONTEND_SERVICES= DIRECTORY_EXIST Issue

    Hi All,
    I want to check whether a directory exists or not application server we are using AIX
    I Found CL_GUI_FRONTEND_SERVICES=>DIRECTORY_EXIST to be useful but i'm not able to figure out the
    Lets say i want to check whether the below directory exists or not
    /user/sap/sbx/test
    then how should my path look
    1)  path = '\<host>\user\sap\sbx\test'.
    2)   path = '\host\user\sap\sbx\test'.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_EXIST
      EXPORTING
        DIRECTORY            = path
      RECEIVING
        RESULT               = result
      EXCEPTIONS
        CNTL_ERROR           = 1
        ERROR_NO_GUI         = 2
        WRONG_PARAMETER      = 3
        NOT_SUPPORTED_BY_GUI = 4
        others               = 5.
    if result = 'X'.
      Write:/ 'Directory Exists'.
    else.
      Write:/ 'Directory not found'.
    endif.
    Thanks

    If i just give an existing directory in se37 Test Function Module it still stays not found.
    Don't test any AppServer related FMs using SE37. This is beacuse it simply capitalizes all input parameters and AS directory names are case sensitive. That's why you will always get that this dir doesn't exist. Just test it in some program giving your dir name and it will work.
    Regards
    Marcin
    Remeber to use dir convention /user/sap/sbx/test not with backslashes. This is Unix, not Windows dir.
    Edited by: Marcin Pciak on Mar 18, 2011 4:11 PM

  • DIRECTORY_EXIST - CL_GUI_FRONTEND_SERVICES - SAP Library

    To add a comment, please log in or register on the top of this page and choose Reply. Please write your comment in English.
    You can also go back to the SAP help page.

    Hi,
    Refer Background equivelent for: cl_gui_frontend_services=>directory_list_files and http://wiki.sdn.sap.com/wiki/display/ABAP/Workingwithfiles
    Thanks,
    Chandra

  • Problems with class CL_GUI_FRONTEND_SERVICES

    Hi.
    I already searched for a solution in the forum, but haven't found anything yet.
    I use the method to check if a directory exists and the one to list the files. The user can specify the directory on the Appl.-Server via SELECTION-SCREEN. First the code:
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_EXIST
      EXPORTING
        DIRECTORY            = l_unixpath
      RECEIVING
        RESULT               = l_count_unixdir
      EXCEPTIONS
        CNTL_ERROR           = 1
        ERROR_NO_GUI         = 2
        WRONG_PARAMETER      = 3
        NOT_SUPPORTED_BY_GUI = 4
        others               = 5.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES
      EXPORTING
        DIRECTORY            = l_unixpath
      CHANGING
        file_table           = l_itab_unixdir
        count                = helpvar
      EXCEPTIONS
        CNTL_ERROR           = 1
        ERROR_NO_GUI         = 2
        WRONG_PARAMETER      = 3
        NOT_SUPPORTED_BY_GUI = 4
        others               = 5.
    IF l_count_unixdir = 'X'.
      WRITE: / 'Directory Exists'.
      READ TABLE l_itab_unixdir INDEX 1 INTO l_unixdir.
      WRITE:/ helpvar.
      WRITE:/ l_unixdir.
      WRITE
    ELSE.
      WRITE:/ 'Directory not found'.
    ENDIF.
    Now my problem:
    l_unixpath is '/', the result is: Directory exists, but helpvar is 0, l_itab_unixdir is empty;
    l_unixpath is '/usr/sap/', the result is: Directory not found <b>(but the directory exists!)</b>;
    l_unixpath is 'c:/', the result is: Directory exists, helpvar is 47, l_unixdir is "Documents and Settings".
    Why it's working with the Windows-Path but not with Unix? Thanks for your answers.

    Becose that class is for presentation server. You can't use it with application server.
    Try FM F4_DXFILENAME_TOPRECURSION, may be helps.
    Regards.

  • Function Module to create a program in SE38

    Hi,
    I have to create an ABAP program dynamically. The program name(to be created) will be provided in the selection screen and the logic of the program will be available in an internal table & also in a local PC file. Is there any Function Module available in SAP to create the program dynamically by using the code which is available in the internal table. The program should be saved in the Local Object.
    Can someone help me on this issue. Thanks in advance.
    Best Regards,
    Paddu.

    Hello Paddu.
    This code fullfills your requirement. Only has the resctriction that all the file names must be in uppercase.
    REPORT zcreate_report.
    * TYPES
    TYPES: BEGIN OF ty_code,
             line TYPE char255,
           END OF ty_code.
    * CLASSES
    CLASS cl_gui_frontend_services DEFINITION LOAD.
    * INTERNAL TABLES
    DATA: data_tab TYPE STANDARD TABLE OF file_info.
    DATA: wa TYPE file_info.
    DATA: ti_code TYPE STANDARD TABLE OF ty_code.
    * VARIABLES
    DATA: name TYPE PROGNAME.
    DATA: count TYPE i.
    DATA: bytecount TYPE i.
    DATA: filename TYPE string.
    * SELECTION-SCREEN
    PARAMETERS: p_dir TYPE string OBLIGATORY DEFAULT 'C:\test\'.
    *** START-OF-SELECTION
    START-OF-SELECTION.
      CLEAR count.
      CALL METHOD cl_gui_frontend_services=>directory_list_files
        EXPORTING
          directory        = p_dir
          files_only       = 'X'
          directories_only = space
        CHANGING
          file_table       = data_tab
          count            = count.
      IF count EQ 0.
        MESSAGE i000(zsd1) WITH 'No files found'.
        EXIT.
      ENDIF.
      LOOP AT data_tab INTO wa.
        CALL FUNCTION 'AIPC_CONVERT_TO_UPPERCASE'
          EXPORTING
            i_input  = wa-filename
          IMPORTING
            e_output = wa-filename.
        CONCATENATE p_dir wa-filename INTO filename.
        CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
            filename                = filename
            filetype                = 'ASC'
          IMPORTING
            filelength              = bytecount
          TABLES
            data_tab                = ti_code
          EXCEPTIONS
            file_open_error         = 1
            file_read_error         = 2
            no_batch                = 3
            gui_refuse_filetransfer = 4
            invalid_type            = 5
            no_authority            = 6
            unknown_error           = 7
            bad_data_format         = 8
            header_not_allowed      = 9
            separator_not_allowed   = 10
            header_too_long         = 11
            unknown_dp_error        = 12
            access_denied           = 13
            dp_out_of_memory        = 14
            disk_full               = 15
            dp_timeout              = 16
            OTHERS                  = 17.
        CHECK sy-subrc EQ 0.
        READ TABLE ti_code TRANSPORTING NO FIELDS INDEX 1.
        CHECK sy-subrc EQ 0.
        name = wa-filename.
        INSERT REPORT name FROM ti_code.
      ENDLOOP.
    Regards.
    Valter Oliveira.

  • Replacement for the fucntion moudle TMP_GUI_DIRECTORY_LIST_FILES in ECC 6.0

    Hi,
    I am using the function module TMP_GUI_DIRECTORY_LIST_FILES . This function module will takes all the files from one folder and i will do the process after taking all the files. but when we upgraded to ECC 6.0 this is not working  anybody can tell me how to fix this issue. if possible plese send me the code.
    Thanks,
    Maheedhar

    Try:
    Class                                              Method 
    CL_GUI_FRONTEND_SERVICES->DIRECTORY_LIST_FILES
    Search the forum for sample codes.

  • Read a file from folder

    i need to get a file from application server folder with date validation.
    how do i get the file from foder with fname, size and date.

    Hi,
    Please try this.
        DATA: FILETAB TYPE TABLE OF FILE_INFO,
              FILEREC TYPE FILE_INFO,
              COUNT TYPE i,
              FZISE TYPE i.
        CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES
          EXPORTING
            DIRECTORY                   = '<Yourfilename>'
            FILTER                      = ''
            FILES_ONLY                  = 'X'
          CHANGING
            FILE_TABLE                  = FILETAB
            COUNT                       = COUNT
          EXCEPTIONS
            CNTL_ERROR                  = 1
            DIRECTORY_LIST_FILES_FAILED = 2
            WRONG_PARAMETER             = 3
            ERROR_NO_GUI                = 4
            others                      = 5.
        IF SY-SUBRC <> 0.
          RAISE CNTL_ERROR.
        ENDIF.
        IF COUNT = 0.
    *     Does not exist
          RESULT = ABAP_FALSE.
          FSIZE  = 0.
        ELSE.
    *     Does exist
          RESULT = ABAP_TRUE.
          READ FILETAB INDEX 1 INTO FILEREC.
          FSIZE = FILEREC-FILELENGTH.
        ENDIF.
    Regards,
    Ferry Lianto

  • Upload a set of files from presentation server to app server.

    Hello,
    I need an urgent help.
    I know how to use GUI_UPLOAD fm for simple file uploading.
    However, my requirement is that in my report program(on selection screen) I give the source directory(presentation server) and the target directory
    (application server). The report has to get all the files from the presentation server (from this source directory) and has to upload each file to the application server in the target directory.
    Could anyone please help me in this?
    It would be very helpful if anyone can put the code / standard example if there is any mechanism in ABAP to get the set of files from the presentation server, given the directory name.
    THanks a lot for your help,
    Best Regards,
    Pramod S.

    HI Pramod,
      After you get the data into the internal table, you need to pass the internal table, record by record into the application server.
    data: wa_file type string.
    data: tab_file like table of wa_file,
    pcount type i.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES
    exporting
    DIRECTORY = 'C:\test'
    FILTER = '.'
    FILES_ONLY = 'X'
    DIRECTORIES_ONLY
    changing
    FILE_TABLE = tab_file
    count = pcount.
    loop at tab_file into wa_file.
    clear it_data.
    refresh it_data.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    exporting
    FILENAME = wa_file
    changing
    data_tab = it_data.
    open dataset <filename> for output in text mode encoding default.
    if sy-subrc = 0.
    loop at it_data.
    transfer it_data to <filename>.
    endloop.
    close dataset.
    endif.
    endloop.
    Thanks,
    Ravi Kanth

  • Dump - While downloading Excel file in Back Ground job.

    Hi Friends,
    I am running a report program in BackGround mode and Downloading an Excel file.
    Getting the following dump report. (Working in 4.6C)
    ABAP/4 processor: RAISE_EXCEPTION
    Job cancelled
    Help me to resolve this.
    000380       CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES
    000390         EXPORTING
    000400           DIRECTORY                   = FILE
    000410           FILTER                      = ''
    000420           FILES_ONLY                  = 'X'
    000430   *    DIRECTORIES_ONLY            = 'X'
    000440         CHANGING
    000450           FILE_TABLE                  = filetab
    000460           COUNT                       = count
    000470         EXCEPTIONS
    000480           CNTL_ERROR                  = 1
    000490           DIRECTORY_LIST_FILES_FAILED = 2
    000500           WRONG_PARAMETER             = 3
    000510           ERROR_NO_GUI                = 4
    000520           others                      = 5.
    000530
    000540       IF SY-SUBRC <> 0.
         >         RAISE CNTL_ERROR.
    000560       ENDIF.
    I am calling the methods as shown below.
    CALL METHOD cl_gui_frontend_services=>gui_download
        EXPORTING
          filename                = l_file
          write_field_separator   = 'X'
        CHANGING
          data_tab                = i_header
        EXCEPTIONS
          OTHERS                  = 22.
      IF SY-SUBRC NE 0.
       MESSAGE S208(05) WITH 'File download is failed'.
      else.
       MESSAGE S208(05) WITH 'File downloaded to specified path'.
      ENDIF.
      CALL METHOD cl_gui_frontend_services=>gui_download
        EXPORTING
          filename                = l_file
          append                  = 'X'
          write_field_separator   = 'X'
        CHANGING
          data_tab                = i_output
        EXCEPTIONS
          OTHERS                  = 22.
      IF SY-SUBRC NE 0.
       MESSAGE S208(05) WITH 'File download is failed'.
      else.
       MESSAGE S208(05) WITH 'File downloaded to specified path'.
      ENDIF.
    Regards,
    Viji

    HI Vijayalakshmi,
    you are using cl_gui_frontendsevices...class in background...
    Is it possible to use this class in the background??
    Plz check once...
    Regards,
    Vamshi

  • Finding the folder on the SAP server

    My requirement is about finding the physical folders and files on SAP server. If any body could give me any input for that, i would appreciate it!!
    I need to copy the files from my C: drive to SAP Office Shared Folder. Actually I have three folders on SAP Office Shared Folder (Customer, Vendor and Personnel). the documents are being scanned and sent to my PC. from here I have a program that runs nightly and copies those pdf scanned files to application server. I need to ascertain the path of those Customer, Vendor and Personnel folder on SAP Application server.
    any input is appreciated. Thanks, Abhishek

    Here's my report:
    REPORT  YTESTRM2                                .
    DATA: gd_COUNT type I.
    DATA: D_PATH(50) value '
    R3sever\ADR100\'.
    DATA: gd_Source TYPE string ,
          gd_dest type String ,
          gd_rc type I.
    DATA: gd_directory type String value '
    Bismark\Projects\ADMIN\'.
    DATA: gd_file_table type standard table of file_info.
    data: wa_file_table type file_info.
    CALL METHOD cl_gui_frontend_services=>DIRECTORY_LIST_FILES
      EXPORTING
        DIRECTORY = gd_directory
      CHANGING
        FILE_TABLE = gd_file_table
        COUNT = gd_count.
    LOOP AT gd_file_table into wa_file_table.
      CONCATENATE D_PATH wa_file_table-filename INTO gd_dest.
      concatenate gd_directory wa_file_table-filename INTO gd_Source.
      CALL METHOD cl_gui_frontend_services=>File_Copy
        EXPORTING
          Source = gd_Source
          Destination = gd_dest
        EXCEPTIONS
          OTHERS   = 1.
    ENDLOOP.
    R3Server is our production server name. the ADR100 folder is a shared folder.
    All i want to know is that whether the folders that i created in SHARED FOLDERS in SAP BUSINESS WORKPLACE........are they created physically in this R3Server or in some KPro or CMS.. if i could give the name of that instead of my
    R3sever\ADR100\........then my work is done.

  • How to print the file name in sap

    Hi All,
    I have requirment like,
    there is a folder in my local system, inside that folder there are 10 Excel file like file1.xls,file2.xls..............file10.xls
    how to print the file name of all these file in SAp like
    file1.xls
    file2.xls
    file3.xls
    file4.xls
    file10.xls
    Appropriate points will be rewarded.
    Thanks in Advance
    Arun kumar

    Hi,
    Still you are facing any problem with this code expalin the problem with details , otherwise close this thread.
    Use Method <b>cl_gui_frontend_services=>directory_list_files</b> to read file names for a given directory
    after reading the files then Use FM : <b>RSPO_SX_OUTPUT_TEXTDATA</b> to create spool from internal table data and print the data.
    <b>sample code :</b>
    data: desktop_dir type string.
    data: ifiles type table of string.
    data: xfiles type string.
    data: count type i.
    data: filepath type string.
    call method cl_gui_frontend_services=>get_desktop_directory
      changing
        desktop_directory    = desktop_dir .
    call method cl_gui_cfw=>flush.
    call method cl_gui_frontend_services=>directory_list_files
      exporting
        directory                   = desktop_dir
    *    filter                      = '*.xls'
         files_only                  = 'X'
    *        DIRECTORIES_ONLY            =
      changing
        file_table                  = ifiles
        count                       = count.
      DATA : x_name       LIKE tsp03d-name,
             x_dest       LIKE tsp03d-padest VALUE 'LOCL',
             x_rows       LIKE sxpcklsti1-body_num VALUE 0,
             x_startrow   LIKE sxpcklsti1-body_start VALUE 1,
             x_pages      LIKE rspotype-pages VALUE 1,
             x_pages_1    TYPE p DECIMALS 2,
             x_rqtitle    LIKE sxpcklsti1-obj_descr,
             x_rqcopies   TYPE i VALUE 1,
             x_rqowner    LIKE trdyse01cm-username,
             x_immediate  LIKE pri_params-primm VALUE ' ',
             x_rqid       LIKE tsp01-rqident,
             i_contents    LIKE  solisti1 OCCURS 0 WITH HEADER LINE,
          x_pages   = 1.
          x_rqowner = sy-uname.
          x_dest     = 'LOCL'.
          x_startrow = 1.
          x_rqcopies = 1.
          x_immediate = 'X' .
          CALL FUNCTION 'RSPO_SX_OUTPUT_TEXTDATA'
           EXPORTING
    *       name                 =   x_name
             dest                 =  x_dest
             rows                 =  x_rows
             startrow             =  x_startrow
             pages                =  x_pages
             rqtitle              =  x_rqtitle
             rqcopies             =  x_rqcopies
             rqowner              =  x_rqowner
             immediately          =  x_immediate
           IMPORTING
             rqid                 =  x_rqid
           TABLES
             text_data            = i_contents
           EXCEPTIONS
             name_missing         = 1
             name_twice           = 2
             not_found            = 3
             illegal_layout       = 4
             internal_error       = 5
             size_mismatch        = 6
             OTHERS               = 7.
          IF sy-subrc <> 0.
    ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    **         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    Regards
    Appana
    *Reward Points for helpful answers
    Message was edited by: L Appana

  • How to Upload Multiple Files from a folder at a single go?

    Hi friends,
    My requriment is to Upload many txt or excel files in a single shot.
    If its a single file i can upload through Ws_upload or Gui_upload.
    in the same way is there any function modules to upload many files at a time.
    Regards
    Venkatesh.S

    Hi Venkatesh,
    Try this code..
    data: l_filename type string OCCURS 0 WITH HEADER LINE.
    l_filename = 'c:\temp1.xls'.
    APPEND L_FILENAME
    l_filename = 'c:\temp2.xls'.
    APPEND L_FILENAME
    LOOP AT L_FILENAME
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    FILENAME = l_filename
    FILETYPE = 'ASC'
    HAS_FIELD_SEPARATOR = '#'
    TABLES
    DATA_TAB = itab1.
    OPEN DATASET <applicationfilename> FOR OUTPUT IN TEXT MODE.
    IF sy-subrc = 0.
    LOOP AT ITAB1
    TRANSFER ITAB1 TO pt_infil .
    ENDLOOP.
    ENDIF.
    CLOSE DATASET pt_infil.
    ENDLOOP.
    OR
    use CL_GUI_FRONTEND_SERVICES->DIRECTORY_LIST_FILES
    Regards,
    Goutham.

  • How to upload all excel files data from one folder into internal table.

    Dear All,
    I have one requirement, It is like I want to upload the frontend file data into my internal table, But here my scenario is;
    If I have one folder ( Called : Temp) in my frontend system, in this folder ( Called : Temp)  I have 100 excel files. In each excel file I have some 1000u2019s of entries. All these data of every file I want to take into my internal table.
    If I have one file I can go for, CALL METHOD cl_gui_frontend_services=>file_open_dialog and then upload method to upload. But I want to take all these excel files from that folder at a time, is there any class or any thing is there..? plz help..
    Thanks...
    Edited by: satishsuri on Jan 11, 2011 9:33 AM

    Hi satishsuri ,
    You will have to use 3 methods together :
    CALL METHOD cl_gui_frontend_services=>directory_browse "Browse the Directory
    CALL METHOD cl_gui_frontend_services=>directory_list_files "Get all the files from the directory
    CALL METHOD cl_gui_frontend_services=>gui_upload "Upload each file in a loop
    Example:
    TYPES: BEGIN OF ty_data,
             line TYPE string,
          END OF ty_data.
    DATA: str_file TYPE string,
          str_dir TYPE string,
          it_file_table TYPE STANDARD TABLE OF file_info,
          wa_file_table TYPE file_info,
          v_count TYPE i,
          it_data TYPE STANDARD TABLE OF ty_data,
          wa_data TYPE ty_data.
    CALL METHOD cl_gui_frontend_services=>directory_browse
      CHANGING
        selected_folder = str_dir.
    CALL METHOD cl_gui_frontend_services=>directory_list_files
      EXPORTING
        directory  = str_dir
      CHANGING
        file_table = it_file_table
        count      = v_count.
    LOOP AT it_file_table INTO wa_file_table.
      CONCATENATE str_dir wa_file_table-filename INTO str_file SEPARATED BY '\'.
      CALL METHOD cl_gui_frontend_services=>gui_upload
        EXPORTING
          filename = str_file
          filetype = 'ASC'
        CHANGING
          data_tab = it_data.
      LOOP AT it_data INTO wa_data.
        WRITE : / wa_data-line.
      ENDLOOP.
      ULINE.
    ENDLOOP.
    Regards,
    Jovito

Maybe you are looking for

  • Power Macintosh 7200 to Mac Mini back up and secure wipe question

    Hi all, nearly figured this on my own but hope that someone here can fill in the gaps. I have a clunky old 7200/75/16 (no upgrade card, bog standard machine) I want to sell/give/dump. Before that, I need to back up the 500 MB HDD (hard to believe tha

  • Minimum & Maximum Limit in Automatic Payment Programme

    Hello Sap Guru, Is there any way to configure the mininmum & maximum amount limit for payment through automatic payment run like minimum payment Rs. 50,000 per cheque and maximum payment Rs 10 lakh Kindly help Thanks & Regards Deepak Garg

  • IPhoto '11 deletes albums

    iPhoto '11 deletes albums, poof they're gone.

  • Sharing  my internet from my ibook g4 with my xbox 360

    i know this has been posted on before but i have done everything that the other posts have directed me and with no success.  anyone still doing this or have any ideas what could be going wrong?  i have changed the settings on my xbox and i have gotte

  • Applescript help - keystroke part does not work

    Hi guys, I'm new to Applescript and would like some assistance. I have an application called iVPN that I would like to start with some applescript code - just one problem in that it requires the admin password at startup. I tried the following, but o