12-25-2007 1:34 AM
Hi All,
I have a parameter.This calls the function
"CALL FUNCTION 'F4_FILENAME' to get the file from C drive.
After selecting the file the path is displayed in the Parameter field.
My problem is I need to extract only file name from the path.Please advice.
Example : Prameter id C:\folder\file.xls
I shd extract only file.xls from the path.Please advice.
12-25-2007 1:41 AM
Hi,
Use the below logic:
data: begin of itab,
val type char20,
end of itab.
SPLIT l_f_path AT '\' INTO TABLE itab.
The last record of the internal table holds the file name.
describe table itab lines l_f_lines.
read itab index l_f_lines.
l_f_filaname = itab-val.
Hope this helps u.
12-25-2007 1:43 AM
Hi,
Please find this following article is helpful or not.
http://sap.ittoolbox.com/groups/technical-functional/sap-dev/f4-function-for-directory-902891
Thanks
Koffer
Edited by: Koffer Shen on Dec 25, 2007 9:43 AM