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

'TRINT_SPLIT_FILE_AND_PATH'

Former Member
0 Likes
2,087

<b>FM : TRINT_SPLIT_FILE_AND_PATH</b>

is working fine for <b>application server file</b> .

But is there any similar FM for<b> presentation server file</b> ?

11 REPLIES 11
Read only

Former Member
0 Likes
1,444

parameters: p_file like rlgrap-filename.

at selection-screen on value-request for p_file.

call function 'F4_FILENAME'

exporting

program_name = syst-cprog

dynpro_number = syst-dynnr

field_name = ' '

importing

file_name = p_file.

Read only

Former Member
0 Likes
1,444

hi ,

use this fm SO_SPLIT_FILE_AND_PATH

<i><b>Reward points if useful</b></i>

Chandra

Read only

0 Likes
1,444

Hi Chandra ,

But till not working , any way thanks for your gd support .

Read only

0 Likes
1,444

Hi deepankar,

it will work only for \ slash.

unfortunately it will not work if u give '/' slash.

report ztest_hy.

data: file(255), path(100), name(100) .

file = 'c:\desktop\ file.doc'.

CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'

EXPORTING

FULL_NAME = file

IMPORTING

STRIPPED_NAME = name

FILE_PATH = path

  • EXCEPTIONS

  • X_ERROR = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

write:/ name.

This is the test program i have just written. i tested, it is working fine. probably u have give '/' instead of '\'.

<b>trint_split_file_and_path</b> , this works for both the slashes.

Message was edited by:

Hymavathi Oruganti

Read only

0 Likes
1,444

I used followin coding :

all the files present in v_dirname should get populated in i_dir_list is not it ? but its not workin .

i_dir_list is not working .

CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'

EXPORTING

full_name = lv_file

  • full_name = p_lifnr

IMPORTING

STRIPPED_NAME = lv_name

FILE_PATH = v_dirname1

EXCEPTIONS

X_ERROR = 1

OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'

EXPORTING

dir_name = v_dirname1

  • FILE_MASK = ' '

  • IMPORTING

  • DIR_NAME = v_dirname2

  • FILE_COUNTER = v_filecounter

  • ERROR_COUNTER = v_errorcounter

tables

dir_list = i_dir_list

EXCEPTIONS

INVALID_EPS_SUBDIR = 1

SAPGPARAM_FAILED = 2

BUILD_DIRECTORY_FAILED = 3

NO_AUTHORIZATION = 4

READ_DIRECTORY_FAILED = 5

TOO_MANY_READ_ERRORS = 6

EMPTY_DIRECTORY_LIST = 7

OTHERS = 8

Read only

0 Likes
1,444

what is the error?

no data in i_dir_list? may be no files in the directory.

have u checked?

also u shd declare i_dir_list type table of epsfili.

and v_dirname1 type EPSF-EPSDIRNAM

Read only

Former Member
0 Likes
1,444

HI,

use SO_SPLIT_FILE_AND_PATH

rgds,

bharat.

Read only

hymavathi_oruganti
Active Contributor
0 Likes
1,444

use SO_SPLIT_FILE_AND_PATH

Read only

Former Member
0 Likes
1,444

CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'

EXPORTING

full_name = p_file " hold full file name

IMPORTING

stripped_name = w_fname " fname

file_path = w_fpath "path

EXCEPTIONS

x_error = 1

OTHERS = 2.

Read only

hymavathi_oruganti
Active Contributor
0 Likes
1,444

Hi just try this report,

TRINT_SPLIT_FILE_AND_PATH' itself will work for presentation sever too.

report ztest_hy.

PARAMETERS: p_file LIKE rlgrap-filename OBLIGATORY.

data: name(50), path(200).

at selection-screen on value-request for p_file.

CALL FUNCTION 'KD_GET_FILENAME_ON_F4'

CHANGING

FILE_NAME = p_file.

start-of-selection.

CALL FUNCTION 'TRINT_SPLIT_FILE_AND_PATH'

EXPORTING

FULL_NAME = p_file

IMPORTING

STRIPPED_NAME = path

FILE_PATH = name.

write: / path, name.

try executing the above.

Read only

Former Member
0 Likes
1,444

Hi

You can use this function module

SO_SPLIT_FILE_AND_PATH

Reward if useful.

Regards

Shibin