‎2009 Apr 15 10:26 AM
Hi Friends
Can anyone help me in this problem.
1.I have to select the particular path
Ex: c:\new folder\prog
2.Then i want to display the list (file names) in that particular folder in ABAP .
Ex: in prog i have 5 excel files.i want to display the list(file names).
Regards
Kiran
‎2009 Apr 15 10:29 AM
please search for the same in the forum.
this is the result from the search..
report ztests.
data : file_table like table of SDOKPATH with header line .
data : dir_table like table of SDOKPATH with header line .
data : file_count type i ,
dircount type i .
parameters:p_dir(50) type c.
CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'
EXPORTING
DIRECTORY = p_dir
FILTER = '*.TXT'
IMPORTING
FILE_COUNT = file_count
DIR_COUNT = dircount
TABLES
FILE_TABLE = file_table
DIR_TABLE = dir_table
EXCEPTIONS
CNTL_ERROR = 1
OTHERS = 2.
write:/ 'no of files in the floder is : ', file_count .
skip 2.
loop at file_table .
write:/ file_table-PATHNAME.
endloop
Edited by: Venkat Appikonda on Apr 15, 2009 11:31 AM
‎2009 Apr 15 10:29 AM
please search for the same in the forum.
this is the result from the search..
report ztests.
data : file_table like table of SDOKPATH with header line .
data : dir_table like table of SDOKPATH with header line .
data : file_count type i ,
dircount type i .
parameters:p_dir(50) type c.
CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'
EXPORTING
DIRECTORY = p_dir
FILTER = '*.TXT'
IMPORTING
FILE_COUNT = file_count
DIR_COUNT = dircount
TABLES
FILE_TABLE = file_table
DIR_TABLE = dir_table
EXCEPTIONS
CNTL_ERROR = 1
OTHERS = 2.
write:/ 'no of files in the floder is : ', file_count .
skip 2.
loop at file_table .
write:/ file_table-PATHNAME.
endloop
Edited by: Venkat Appikonda on Apr 15, 2009 11:31 AM
‎2009 Apr 15 10:29 AM
Use the Class=>method:
call method CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES
exporting
DIRECTORY = <your directory name>.....
Regards,
Ravi