08-20-2007 7:37 AM
Hi Friends,
I have an urgent requirement like i have to read and write all the file names which starts with <b>SFA.POS</b>. from the application server which is in the<b> /usr/sap/trans/db1data/pos/HEP</b>platform directory and store those file names in a ZTABLE.....
Pls anyone put light on this and suggest me how to do this..
Regards...
Balaji
08-20-2007 7:39 AM
Use this FM to read all the files in the directory in an Internal Table - RZL_READ_DIR
Now search the table for your required file name.
Regards,
Amit
Reward all helpful replies.
08-20-2007 9:16 AM
Hi Balaji,
CG3Z - to upload file from presentation server to application server.
Upload a empty .txt file any path in the application server using CG3Z tcode and use this path in the program.
Thanks
Naveen khan
08-20-2007 10:27 AM
Hi Balaji,
Use this code to get the file name
p_file = '/usr/sap/trans/db1data/pos/HEP'
lc_command(3) = 'ls '.
lc_command+3(45) = p_file.
CALL 'SYSTEM' ID 'COMMAND' FIELD lc_command
ID 'TAB' FIELD t_tabl-sys.
Check any files exits in the directory.......................
IF t_tabl[] IS INITIAL.
MESSAGE e006 WITH p_file.
ENDIF.
SORT t_tabl BY line DESCENDING.
LOOP AT t_tabl.
<b>* HERE YOU GET THE FILE NAMES.</b>
ENDLOOP.
Regards
Arun