Application Development 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: 

'TRINT_SPLIT_FILE_AND_PATH'

Former Member
0 Kudos

<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

Former Member
0 Kudos

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.

Former Member
0 Kudos

hi ,

use this fm SO_SPLIT_FILE_AND_PATH

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

Chandra

0 Kudos

Hi Chandra ,

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

0 Kudos

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

0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

HI,

use SO_SPLIT_FILE_AND_PATH

rgds,

bharat.

hymavathi_oruganti
Active Contributor
0 Kudos

use SO_SPLIT_FILE_AND_PATH

Former Member
0 Kudos

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.

hymavathi_oruganti
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

Hi

You can use this function module

SO_SPLIT_FILE_AND_PATH

Reward if useful.

Regards

Shibin