‎2008 Oct 29 8:34 AM
Hi,
i have this string and i always want the last charter in it,
after the last ' \ ' what is the best way to do that
C:\Documents and Settings\P508635\Desktop\*Book1.xls*
e.g.
here i want to get in tmp = Book1.xls
Regards
‎2008 Oct 29 8:42 AM
Hi
There are many Function Modules,
One on that is SO_SPLIT_FILE_AND_PATH
regards
Kumar M
‎2008 Oct 29 8:37 AM
DATA : gv_lies TYPE i.
SPLIT file INTO TABLE itab AT '/'. "split the file name into internal table
gv_lines = lines( itab ). "determine the number of lines
READ TABLE itab INDEX gv_lines. "last line is what we need
‎2008 Oct 29 8:53 AM
‎2008 Oct 29 8:55 AM
HI Eric,
I try your soltion and in the line :
SPLIT file INTO TABLE itab AT '/'. "split the file name into internal table
i change it to : SPLIT gv_filename AT '/' INTO TABLE itab. for avoid error .
but it don't split it u have idea?
Regards
‎2008 Oct 29 8:42 AM
Hi
There are many Function Modules,
One on that is SO_SPLIT_FILE_AND_PATH
regards
Kumar M
‎2008 Oct 29 9:00 AM
‎2008 Oct 29 8:58 AM
hi,
i think in place of forward slash '/' u have to use backward slash '\' i suppose....
Rgds.,
subash
‎2008 Oct 29 9:10 AM
Hi ,
The below code works...
p_str =
C:\Documents and Settings\P508635 \Desktop\*Book1.xls*
data:str2(100) type c,
str3(100) type c,
str4(100) type c.
call function 'STRING_REVERSE'
exporting
string = p_str
lang = 'E'
importing
rstring = str2
exceptions
too_small = 1
others = 2.
if sy-subrc <> 0.
clear str2.
endif.
split str2 at '\' into str3 str4.
clear str4.
call function 'STRING_REVERSE'
exporting
string = str3
lang = 'E'
importing
rstring = str4
exceptions
too_small = 1
others = 2.
if sy-subrc <> 0.
clear str4.
endif.
p_str = str4.
Regards,
Kiran Bovindala.