‎2008 Feb 13 1:31 PM
Hi,
I have a string value like this. /usr/sap/temp/test.txt .
I want the text before the last slash / .
I mean, I want /usr/sap/temp into one variable.
There can be any number of slash / symbols in the main text. But, I need only the text before the last slash /. I think, we have to use SHIFT statement to do this. But, I am not able to get it. Can someone help me on the same. it is quite urgent. Please share your thoughts.
Thanks & Regards,
Paddu.
Edited by: Paddu K on Feb 13, 2008 7:45 PM
‎2008 Feb 13 1:34 PM
‎2008 Feb 13 1:39 PM
‎2008 Apr 08 4:44 PM
Hi,
Try this one,It will work
DO.
FIND '\' IN SECTION OFFSET l_offset OF p_file MATCH OFFSET l_off
MATCH LENGTH l_length .
IF sy-subrc EQ 0.
l_offset = l_off + l_length .
ELSE.
p_file = p_file(l_offset).
EXIT.
ENDIF.
ENDDO.in the above code p_file is the file path.
Thanks,
Balaji.