Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Upload Directory

Former Member
0 Likes
536

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

1 ACCEPTED SOLUTION
Read only

former_member203501
Active Contributor
0 Likes
508

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

2 REPLIES 2
Read only

former_member203501
Active Contributor
0 Likes
509

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

Read only

Former Member
0 Likes
508

Use the Class=>method:

call method CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES

exporting

DIRECTORY = <your directory name>.....

Regards,

Ravi