2009 Feb 24 5:56 AM
Assume I have 3 files in c:\abc folder:
a1.xls
a2.xls
a6.xls
Is there a fm or code sample to pass in folder name (ie c:\abc) and returns a1.xls, a2.xls and a6.xls into internal table?
2009 Feb 24 6:06 AM
Hi,
Go through these FMs:
TMP_GUI_DIRECTORY_LIST_FILES
TMP_GUI_READ_DIRECTORY
RZL_READ_DIR
Do search on them, you will get the details.
Cheers.
Hi,
Go through these FMs:
TMP_GUI_DIRECTORY_LIST_FILES
TMP_GUI_READ_DIRECTORY
RZL_READ_DIR
Do search on them, you will get the details.
Cheers.
2009 Feb 24 6:00 AM
2009 Feb 24 6:06 AM
Hi,
Go through these FMs:
TMP_GUI_DIRECTORY_LIST_FILES
TMP_GUI_READ_DIRECTORY
RZL_READ_DIR
Do search on them, you will get the details.
Cheers.
2009 Feb 24 6:14 AM
Use Class CL_GUI_FRONTEND_SERVICES Method DIRECTORY_LIST_FILES to get list of file in a folder . FILE_TABLE will give the table with list of files
data: begin of itab ,
file(26) type c,
end of itab.
data: tab type table of itab.
data : cnt type i.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES
EXPORTING
DIRECTORY = 'C:\temp'
* FILTER = '*.*'
* FILES_ONLY =
* DIRECTORIES_ONLY =
CHANGING
FILE_TABLE = tab
COUNT = cnt
* 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.
ENDIF.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |