Hi,
If your files are in a directory in application server. You can use the FM EPS2_GET_DIRECTORY_LISTING to get the list of files in that directory. Then loop pn the return table gt_filelist and do a OPEN DATASET, READ DATASET and CLOSE DATASET to read the various file entries in a single internal table or multiple ones as suitable to you.
CALL FUNCTION 'EPS2_GET_DIRECTORY_LISTING'
EXPORTING
iv_dir_name = p_fapp "Directory path
TABLES
dir_list = gt_filelist "Table with list of files in folder
EXCEPTIONS
invalid_eps_subdir = 1
sapgparam_failed = 2
build_directory_failed = 3
no_authorization = 4
read_directory_failed = 5
too_many_read_errors = 6
empty_directory_list = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT gt_filelist INTO w_filelist.
*Check keyword documentation to find how these statements work
OPEN DATASET...
READ DATASET...
CLOSE DATASET...
ENDLOOP.
There is a similar FM for Presentation server also. FM TMP_GUI_DIRECTORY_LIST_FILES same logical construct would help you in that case too.
Cheers,
Arindam