03-12-2009 3:44 AM
Hi to all experts ,
my requirement is to move a file across folder in application server how can we achieve this
03-12-2009 3:47 AM
03-12-2009 3:47 AM
03-12-2009 3:54 AM
03-12-2009 4:04 AM
03-12-2009 4:11 AM
Hi tarun,
how to get this file name from this string *
sapbo1\Share\MM_SCUBCode_PDAtxt_Upload\OUT-1090000001-200903062203.txt* i want to get OUT-1090000001-200903062203.txt in a variable
03-12-2009 4:16 AM
Hi,
Create an internal table with one field.
DATA : BEGIN OF itab OCCURS 0,
file_name TYPE string,
END OF itab.
Now use code:
SPLIT <file_path> AT '/' INTO TABLE itab.
"this will spilt text at '/' into different lines
DATA : line_count TYPE i.
DESCRIBE TABLE itab
LINES line_count.
READ TABLE itab INDEX line_count.
"now you will have the file name in the header line
Hope this helps you.
Regards,
Tarun
03-12-2009 4:17 AM
Hi,
Use this FM to split file name from file path,
CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'
EXPORTING
full_name = p_fpath
IMPORTING
stripped_name = v_filename
FILE_PATH =
EXCEPTIONS
X_ERROR = 1
OTHERS = 2
.
IF sy-subrc <> 0.
Endif.
Here p_fpath is ur entire path,
v_filename is ur filename.
03-12-2009 5:03 AM
Use this FM, to get the stripped file name from the path
TRINT_SPLIT_FILE_AND_PATH
03-12-2009 3:47 AM
03-12-2009 3:47 AM
03-12-2009 4:13 AM
Use:
Function Modules:
CL_GUI_FRONTEND_SERVICES=>Copy_file
ITS_FILE_COPY
Or,
Follow:
1) Read File to inter table using.
Open dataset <Filename> for Output
Read Dataset
Close Dataset.
2) Move it to another Directory using.
Open Dataset <New Filename> for input
Translate
Close Dataset
Regards,
Gurpreet