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

File separator for Application server

Former Member
0 Likes
1,004

Hi All,

Can anyone suggest me any Function module to get file/folder path Separator on application server?

Also I want a Function module which returns the Carriage return(CR)/ Line Feed(LF) in case of application server.

regards

Shilpa.

2 REPLIES 2
Read only

Former Member
0 Likes
701

Hi,

Try FM : SO_SPLIT_FILE_AND_PATH

SO_SPLIT_FILE_AND_PATH

Import parameters Value

FULL_NAME C:\DOCUMENTS AND SETTINGS\SHYAMP\DESKTOP\EQUI.TXT

Export parameters Value

STRIPPED_NAME EQUI.TXT

FILE_PATH C:\DOCUMENTS AND SETTINGS\SHYAMP\DESKTOP\

Regds,

Anil

Read only

Former Member
0 Likes
701

Hi, a small help to your second question. To get the correct Cr and Lf codes you can use the following code:

DATA lc_lf(1) TYPE c.

DATA lc_cr(1) TYPE c.

DATA lc_crlf(2) TYPE c.

DATA l_h_lf(1) TYPE x VALUE '0A'.

DATA l_h_cr(1) TYPE x VALUE '0D'.

DATA l_h_crlf(2) TYPE x VALUE '0D0A'.

DATA l_r_conv TYPE REF TO cl_abap_conv_in_ce.

  • Get the line feed and carriage return for unicode

l_r_conv = cl_abap_conv_in_ce=>create( input = l_h_crlf ).

l_r_conv->read( IMPORTING data = lc_crlf ).

  • Get the line feed for unicode

l_r_conv = cl_abap_conv_in_ce=>create( input = l_h_lf ).

l_r_conv->read( IMPORTING data = lc_lf ).

  • Get the carriage return for unicode

l_r_conv = cl_abap_conv_in_ce=>create( input = l_h_cr ).

l_r_conv->read( IMPORTING data = lc_cr ).

And you have the Cr and Lf code in workfields.