11-25-2011 9:54 AM
Hi experts,
Does any know a FM or class, which is released and I can use to get the file name and extension?
Normally I used the FM SPLIT_FILE.
But this FM does only exports CHAR3.
So I get a problem with new office-files (XLSX, DOCX)...
thx for any help
11-25-2011 10:13 AM
Why dont u use just a split statement e.g.
Split file_name into f1 f2.
where f1 contains file name and f2 extension
and both f1 f2 are type string
11-25-2011 10:00 AM
11-25-2011 10:12 AM
Thx for fast help.
I've already found this one.
But it is not release...
Isn't there a FM which is released?
thx
11-25-2011 10:13 AM
Why dont u use just a split statement e.g.
Split file_name into f1 f2.
where f1 contains file name and f2 extension
and both f1 f2 are type string
11-25-2011 10:17 AM
Because it would be easier...
If the filmename for example is test.data.xlsx I would have to use a loop or do.
And so I would prefer a FM.
11-25-2011 10:22 AM
11-25-2011 10:25 AM
Not necessarily, after splitting with '.' as separator, you can DESCRIBE table LINES and get the index of last row and use READ TABLE table INDEX index to get the extension.
That said, if you are on ECC you can do this elegantly with regular expressions. I will update my post later when I have time.
11-25-2011 10:26 AM
What about a class method then?
CALL METHOD CL_BCS_UTILITIES=>SPLIT_NAME
EXPORTING
iv_name = file_name
iv_Delimiter = '.'
importing
ev_extension = lv_extension.
or CL_OLR3_DMS_WORK=>SPLIT_NAME_TO_EXTENSION
11-25-2011 10:29 AM
Hi ,
Check CH_SPLIT_FILENAME FM as well. It is a released FM and should server your purpose .
Regards,
Arun
11-25-2011 10:51 AM
hi ,
Data : f1(20) type c ,
f2(5) type c,
c_tab type c value '.' .
data: f_name(30) type c value 'TEST.EXE' .
split F_NAME AT C_TAB INTO F1 F2 .
Regards
Deepak.
11-25-2011 11:28 AM
thx for fast help to everyone
btw: CH_SPLIT_FILENAME is NOT released (at least in our system ECC 605)