2008 May 23 7:17 AM
Hi,
can anybody let me know the method to get the filename from the complete filepath( this path includes both directory as well as filename)
regards.
venkat.
2008 May 23 7:20 AM
Hi venkat,
1. Use the FM
PC_SPLIT_COMPLETE_FILENAME
2. This will give u the following things:
DRIVE
EXTENSION
NAME
NAME_WITH_EXT
PATH
regards,
amit m.
2008 May 23 7:20 AM
Hi venkat,
1. Use the FM
PC_SPLIT_COMPLETE_FILENAME
2. This will give u the following things:
DRIVE
EXTENSION
NAME
NAME_WITH_EXT
PATH
regards,
amit m.
2008 May 23 7:22 AM
hi thr
use the FM
PC_SPLIT_COMPLETE_FILENAME
pls reward if helpful
regards
niharika
2008 May 23 7:25 AM
Hi,
Check the below code:
data : ig_path type standard table of tp_path,
wg_path type tp_path.
data : g_lines type i ,
g_filename type string .
parameter : p_input type rlgrap-filename.
split p_input at '\' into table ig_path.
describe table ig_path lines g_lines.
read table ig_path index g_lines into wg_path.
g_filename = wg_path-val.
write : g_filename.Regards,
Raghu
2008 May 23 7:26 AM
hi,
general file path will be
/home_STAR/GD2/zfile.txt
and file name will be zfile.txt
so split the directory into variables
data: lc_colon typec char1 value '/'.
split lw_dir at at lc_colon into w_var1, w_var2, w_var3.
w_var3 will be the file name.
Regards,
Sriram
2008 May 23 7:37 AM
path = 'c:/test/xyz.txt'.
REPLACE ALL OCCURRENCES OF '/' in path with '\'.
find all OCCURRENCES OF '\' in path MATCH OFFSET off.
if sy-subrc > 0.
fname = path.
else.
off = off + 1.
fname = path+off.
endif.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |