‎2008 Jan 16 8:37 AM
hi expert,
could any one give me FM , which takes input file path
and output extention of the file name.
eg:-
p_fname = 'c:\documents and settings\desktop\xxx.txt'
the function module should return 'txt'
regards,
pavan
‎2008 Jan 16 9:54 AM
hi pavan,
better see the below FMs
CH_SPLIT_FILENAME
This FM is used to Splits PC File Name into Drive,Path,File and Extension
And below FM also used for same purpose.
CRM_EMAIL_SERVICE_BASE
CRM_EMAIL_SPLIT_FILENAME
SPLIT_FILENAME
UBC_BAS_GEN
UBC_SPLIT_FILENAME
Reward me if it is useful
‎2008 Jan 16 8:39 AM
Hi,
Use SPLIT statement.
p_fname = 'c:\documents and settings\desktop\xxx.txt'.
SPLIT p_fname AT '.' INTO l_f_ext.
WRITE : / l_f_ext.
output: '.txt'.
‎2008 Jan 16 8:40 AM
Hi Pawan
That is simple split your file name at '.' and put the second part in your output parameters.
data: lz_str type char255,
lz_str1 type char 255,
lz_str2 type char255 .
lz_str = 'c:\documents and settings\desktop\xxx.txt'
split lz_str at '.' into lz_str1 lz_str2.
write: lz_str2.
Ouptut will be.txt.
‎2008 Jan 16 8:47 AM
hi,
thanks for your quick reply, i used split and it is working fine. but i want to use a standard FM for that.
regards,
pavan
‎2008 Jan 16 9:24 AM
‎2008 Jan 16 9:34 AM
‎2008 Jan 16 9:39 AM
In our system it does exist. FM PC_SPLIT_COMPLETE_FILENAME is another one doing the same.
Regards,
John.
‎2008 Jan 16 9:54 AM
hi pavan,
better see the below FMs
CH_SPLIT_FILENAME
This FM is used to Splits PC File Name into Drive,Path,File and Extension
And below FM also used for same purpose.
CRM_EMAIL_SERVICE_BASE
CRM_EMAIL_SPLIT_FILENAME
SPLIT_FILENAME
UBC_BAS_GEN
UBC_SPLIT_FILENAME
Reward me if it is useful