‎2007 Oct 24 3:14 PM
Thanks.
fullpath = /tmp/C24102007.0904, I hope enough.
perform parsefilename using fullpath '/' filepath filename.
form parsefilename using file type string
separator type c
changing filepath type string
filename type string.
data : s type string,
p type string,
f type string,
i type i.
file = /usr/sap/trans/file, separator = '/'
s = file.
filepath = ''.
do.
split s at separator into p f.
if f = ''. exit. endif.
concatenate filepath p separator into filepath.
s = f.
enddo.
filename = p.
i = strlen( filepath ) - 1.
if i > 0.
if filepath+i(1) = separator.
filepath = filepath+0(i).
endif.
elseif i = 0.
filepath = separator.
else.
filepath = ''.
endif.
endform.
‎2007 Oct 24 3:16 PM