10-25-2007 7:00 AM
<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> ?
10-25-2007 7:07 AM
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.
10-25-2007 7:09 AM
hi ,
use this fm SO_SPLIT_FILE_AND_PATH
<i><b>Reward points if useful</b></i>
Chandra
10-25-2007 7:29 AM
Hi Chandra ,
But till not working , any way thanks for your gd support .
10-25-2007 7:33 AM
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
10-25-2007 8:46 AM
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
10-25-2007 8:52 AM
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
10-25-2007 7:10 AM
10-25-2007 7:25 AM
10-25-2007 7:31 AM
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.
10-25-2007 7:46 AM
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.
10-25-2007 8:10 AM
Hi
You can use this function module
SO_SPLIT_FILE_AND_PATH
Reward if useful.
Regards
Shibin