‎2010 Jun 18 3:56 PM
Good morning to all my problem is I have to read a file to upload information, the problem was I have no file name and I have to upload everything I files that are inside the folder, the file has a naming txt XXX #######. the first three values do not vary over the other are numerous and vary depending on the date and time, adding the program should work in a job and would like to know if I can to help see I get the name of the file that is inside the folder which is in a thanks and best served
‎2010 Jun 18 4:00 PM
‎2010 Jun 18 4:04 PM
Try to put that in selection screen whatever file name to be read from folder.
If that is not possible then you will need to move the uploaded file to some other folder'XXX' and keep always the one which is unread in ZZZ folder.
Thanks!
‎2010 Jun 18 4:08 PM
the porblem is like knowing that the files are directotio server Redeemer
‎2010 Jun 18 4:16 PM
‎2010 Jun 18 4:29 PM
To get the files from a directory in the server use FM RZL_READ_DIR_LOCAL. Then it's quite simple to loop at the results and get the file you're looking for.
‎2010 Jun 18 4:40 PM
when you test this function by the SE37 at the address of the folder I get error NOT_FOUND
the steering is \ \ aero-ccs-file00 \ SAPDEV \ FUSO \ Entry
‎2010 Sep 01 6:46 PM
If you are running this from your PC, and not in background, you can use TMP_GUI_DIRECTORY_LIST_FILES. It will give you file names up to 255 characters long. If you need to run this in background you could try TMP_GUI_DIRECTORY_LIST_FILES but it only returns files up to 40 characters. Good luck.
‎2010 Sep 01 6:54 PM
Hi
You can use EPS_GET_DIRECTORY_LISTING.
Refer the code snippet as below :-
DATA: l_check_msg(50) TYPE c,
l_filemask LIKE epsf-epsfilnam.
CONCATENATE p_sysid '*' INTO l_filemask.
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
EXPORTING
dir_name = wa_ztsifregi-pathname
file_mask = l_filemask
TABLES
dir_list = i_files
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 NE 0.
CASE sy-subrc.
WHEN 1.
l_check_msg = 'Invalid subdirectory'(005).
WHEN 2.
l_check_msg = 'EPS_GET_DIRECTORY_LISTING failed'(006).
WHEN 3.
l_check_msg = 'Build directory failed'(007).
WHEN 4.
l_check_msg = 'No authorization'(008).
WHEN 5.
l_check_msg = 'Read directory failed'(009).
WHEN 6.
l_check_msg = 'Too many read error'(010).
* WHEN 7.
* l_check_msg = 'Empty directory'(011).
WHEN OTHERS.
l_check_msg = 'Unexpected error from function module'(012).
ENDCASE.
Regards
Abhii