Skip to Content
author's profile photo Former Member
Former Member

Regarding saving file from one location to another location in local PC

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 D: Drive)

How can I do this,

Please suggest,

Thanks and Regards,

Pavan.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    Posted on Nov 21, 2012 at 06:26 AM
    CALL METHOD cl_gui_frontend_services=>file_copy EXPORTING SOURCE = file1 DESTINATION = file2 OVERWRITE = space. Regards Jack
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2012 at 06: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 21, 2012 at 06:24 AM

    Hiii,

    Use Class CL_GUI_FRONTEND_SERVICES and use static method FILE_EXIST , FILE_COPY FILE_DELETE from old location .

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 21, 2012 at 06: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2012 at 09: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2012 at 06: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.