11-21-2012 6:11 AM
Hi SAP Gurus,
My requirement is as follows,
I am having a file in on drive of my local PC (say C: drive),
I need to save the file to another location in same PC (say 😧 Drive)
How can I do this,
Please suggest,
Thanks and Regards,
Pavan.
11-21-2012 6:26 AM
11-21-2012 6:19 AM
Hello Pavan
Why do u need SAP for this? If its on your PC then you can directly cut and paste in D drive.
May be i misinterpreted your question, request you to explain it further.
Regards,
Deepti
11-21-2012 9:08 AM
11-21-2012 6:20 AM
Hi,
Use the below function module to move the file from one location to other location:
CALL FUNCTION 'ARCHIVFILE_SERVER_TO_SERVER'
EXPORTING
sourcepath = w_file
targetpath = lv_tgt_file
EXCEPTIONS
error_file = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE c_s NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ELSE.
DELETE DATASET w_file.
ENDIF.
11-21-2012 6:24 AM
Hiii,
Use Class CL_GUI_FRONTEND_SERVICES and use static method FILE_EXIST , FILE_COPY FILE_DELETE from old location .
11-21-2012 6:26 AM
11-21-2012 6:33 AM
Dear Pavan,
You want to save files using foreground or background. if it is background mode, you must have to use open dataset else u can use above solution.
Regards,
Amol.
11-21-2012 7:30 AM
Hi,
If it is fore ground use the class CL_GUI_FRONTEND_SERVICES method to do the cut and paste.
If it is the back ground job first place the file in open server that is in AL11 to do the further steps.
11-21-2012 9:10 AM
Hi
This solution helpfull for ur problem..
whenever we want to save the file from one location to another location in same pc in this situation we can solve by using this fun. module - F4_FILENAME .
code is below ---
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAME NAME = SY-PROGRAMENAME
FIELD NAME = ' T_FILE'
IMPORTING
FILE NAME = T_FILE.
V_FILE = T_FILE. STRING CONVERSION
v_file is string type and T_FILE is RLGRAP
if you are using FM> gui_download then you have to declarae the
file name = V_FILE
IN EXPORTING PARAMETERS
after using thses fun module you can esialy download file in any location into same PC.
please if its helpfull for you then plz give me points.
Regards
suraj singh