Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

reg: file validation

Former Member
0 Likes
809

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
763

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

7 REPLIES 7
Read only

Former Member
0 Likes
763

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'.

Read only

Former Member
0 Likes
763

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.

Read only

0 Likes
763

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

Read only

0 Likes
763

Hi Pavan,

Check FM CH_SPLIT_FILENAME.

Regards,

John.

Read only

0 Likes
763

hi,

the given function module not exists.

regards,

pavan

Read only

0 Likes
763

In our system it does exist. FM PC_SPLIT_COMPLETE_FILENAME is another one doing the same.

Regards,

John.

Read only

Former Member
0 Likes
764

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