Wednesday, December 29, 2010
REPORT ztest_program.
DATA: wa_pfile  TYPE file_table.
DATA: it_pfiles TYPE STANDARD TABLE OF file_table.
DATA: count     TYPE i,
dir       TYPE string VALUE 'C:\Venkat1\',
source    TYPE string,
dest      TYPE string.

START-OF-SELECTION.
CALL METHOD cl_gui_frontend_services=>directory_list_files
EXPORTING
directory                   = dir
*       files_only                  = 'X'
CHANGING
file_table                  = it_pfiles
count                       = count
EXCEPTIONS
cntl_error                  = 1
directory_list_files_failed = 2
wrong_parameter             = 3
error_no_gui                = 4
not_supported_by_gui        = 5
OTHERS                      = 6.
LOOP AT it_pfiles INTO wa_pfile.
CONCATENATE 'C:\Venkat1\' wa_pfile-filename INTO source.
CONCATENATE 'C:Venkat2\' wa_pfile-filename INTO dest.

CALL METHOD cl_gui_frontend_services=>file_copy
EXPORTING
SOURCE      = SOURCE
destination = dest
overwrite   = 'X'.

ENDLOOP.

0 comments:

Post a Comment

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.