File at a location

Hi all,
Can I copy a file from one folder to other folder and delete this file from the first folder using abap?
For example there is a folder at
C:\Etc\Test and I want to copy this file to folder xyz as:
C:\XYZ\Test
How can I do that and delete the C:\Etc\Test?
Thanks.
deniz.

Hi,
Check this code...
DATA: w_file_name TYPE string,
      w_file_path TYPE string,
      full_path TYPE string,
      action TYPE i,
      name TYPE string VALUE 'SAVE',
      filetable TYPE filetable,
      file TYPE string,
      rc TYPE i.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
*  EXPORTING
*    window_title            =
*    default_extension       =
*    default_filename        =
*    file_filter             =
*    with_encoding           =
*    initial_directory       =
*    multiselection          =
  CHANGING
    file_table              = filetable
    rc                      = rc
READ TABLE filetable INTO file index 1.
CALL METHOD cl_gui_frontend_services=>file_save_dialog
  EXPORTING
*    window_title         = name
*    initial_directory    = 'c:\Documents and Settings\2q\Desktop'
*    prompt_on_overwrite  = 'X'
    default_file_name    = name
  CHANGING
    filename             = w_file_name
    path                 = w_file_path
    fullpath             = full_path
    user_action          = action
  EXCEPTIONS
    cntl_error           = 1
    error_no_gui         = 2
    not_supported_by_gui = 3
    OTHERS               = 4.
CALL METHOD cl_gui_frontend_services=>file_copy
  EXPORTING
    SOURCE               = file
    DESTINATION          = full_path
CALL METHOD cl_gui_frontend_services=>file_delete
  EXPORTING
    filename = file
  CHANGING
    rc       = rc.
Edited by: Sukriti Saha on Nov 5, 2008 1:09 PM

Similar Messages

  • Delete File from URL located on HTTP Server.

    Hello All, could you anybody help me with my Problem. I need to delete some File in URL located on HTTP Server. The File was created via using of the Function 'DP_CONTROL_SEND_STREAM_TO_URL'. Any Times I need to delete this File from the url Location, but I cann't find any Functions or Method of any Class (GUI 6.20) to realise that. I read lot of very good Blogs from Thomas Jung about HTTP classes, but I cann't find somthing relevant for me...
    Sincerely Yours,
    Lubomir

    Hi,
    You can try with GUI_DELETE_FILE and give http location in FILE_NAME
    or WS_FILE_DELETE.
    I am not getting any CNDP function module for your purpose.
    Hope you will get sucess..
    Thanks,
    Chetan Shah

  • How can i stop an error message that comes up when i am using word? the error message is "word is unable to save the Autorecover file in the location specified. Make sure that you have specified a valid location for Autoreover files in Preferences,-

    how can i stop an error message that comes up when i am using word? the error message is "word is unable to save the Autorecover file in the location specified. Make sure that you have specified a valid location for Autoreover files in Preferences,…"

    It sounds like if you open Preferences in Word there will be a place where you can specify where to store autorecover files. Right now it sounds like it's pointing to somewhere that doesn't exist.

  • Saving file to network location

    Hello all of you,
    I encounter an issue with InDesign CS5 when it comes to opening and saving files to a network location. I added my company's ftp server to Windows 7 and it appears correctly in the My computer overview (there's an additional line besides the hard discs, DVD player, et cetera). The connection to the server functions fine, no issues here. No problem exists when opening files from this server from within InDesign; I can do whatever I want. Only when I try to save a file the network location isn't displayed anymore within the My computer overview in the InDesign "Save as" dialog box. The network location however appears in the pull-down menu at the top of the dialog box (and nested as part of My computer ...), but when I pick it there, it won't show the context of the server. Additionally logging onto the server (it's IP-based and anonymous logon) doesn't change a thing. Trying to save in the empty server space InDesign returns a "Can't save here" error message.
    Does anyone know how to solve this issue? Building the document locally and then copying back to the server isn't a solution, because all external content that is linked in the document resides on the server.
    Best regards,
    Luc Peulen

    Does anyone know how to solve this issue? Building the document locally and then copying back to the server isn't a solution, because all external content that is linked in the document resides on the server.
    Scott is basically right. Lots of ID users work over network connections without issue, but if something is going wrong, it's the first place to look. I wouldn't have thought it possible to work in InDesign over a FTP connection!
    If you can get Windows to access that server as if it were just another drive (using "Map network drive" in Explorer) then it should work normally. However, a generic Adobe phone tech wouldn't help you figure out why it wouldn't work - there are simply too many variables in a network environment for a generic first-level tech to figure out.
    In the short term, the only solution I can suggest is:
    Retrieve all of that external content that is linked in the document, and the InDesign document, at the same time, & store it on your local hard drive.
    Do your work.
    Save & package.
    Upload the entire package back to the server.
    Long-term, you'd need to talk to your own IT staff to troubleshoot the connection between your workstation and the FTP server. If you can get information about your network from them to post here, I bet that someone will make suggestions to pass on to your IT staff that will actually work.

  • Printing pdf files from commandline located on intranet ?

    Hi,
    i'm able to print files from the commandline which are located on the file server using :
    acroRd32.exe /h /p file.pdf
    Now i want to print a pdf file which is located on the intranet , f.i. http://localhost/b.pdf .
    How can i do this ??
    Regards
    Erwin

    1. copy the file to a local disc with wget ( http://www.gnu.org/software/wget/ )
    2. print the file

  • I want to write in a XML file which is located on the TOMCAT server

    hello all,
    can anybody tell me or give me code snippet for writing some data through my application i.e from client side on te file which is located on the TOMCAT server(especially XML file).
    tell me how can i do that?
    it is urgent
    cya
    sush

    Hello sush,,,,
    I am sending you some API / classes that will definetely help you for writing XML file through java.
    1) TransformerFactory.newInstance();
    2)Transformer serializer
    3)StreamResult
    4)serializer.transform(source,result);
    5)DOMSource
    From Vikas_khengare
    [ [email protected] ]

  • How to retrieve data from an Excel file which is located on server

    hi everybody,
                    I am using SAP NWDS 2004s .     
                I have done an application on how to export the table data into an Excel .
    Now i want to get the data from an Excel file which is located in server and display that data which is in excel in a View for example a Sample view in Webdynpro  .
    In Sample view i took a uielement textview to display the data ....   
    can any one help how to procced further
    Thanks in advance
    Madhavi

    Options to read Excel data to WebDynpro context
    Reading Excel Sheet from Java without using any Framework
    Reading Multiple Sheets of Excel Sheet from Java
    Few Threads
    How to Display the content of Excel file into Webdynpro Table
    Is it possible to upload data from excel file(.xls)
    Re: How to export the data as integer into excel sheet?
    regards
       Vinod

  • Unable to pick up the file from Receive Location

    BizTalk is  unable to pick up the files from receive location.
    My admin console is working so slow.
    It is showing the problem of snap-in as follows:
    I have checked all my receive location and its masking,it is working fine.
    Actually it is working fine in dev server(snap-in problem is not occuring in dev server ) but when I import MSI and binding in UAT server.
    It is not picking up the file from receive location.
    I want to know one more thing :if my message box database is not working fine,will it receive the files from receive location.
    Prakash

    For files not received by receive location. If the Receive Location is still enabled but files are not processed by Receive Location, then check whether the host instance  configured with your receive location is running. If the host instance is in
    running state, restart the host instance and try.
    Regarding the error in the admin console as shown in the image, people started to see this issue with admin console from BizTalk 2009 onwards. This happens in cases like you have done some activity with console and before its been refreshed it you do more
    activities like expanding the node you will see this error. Sometimes WMI is bit slowly to refresh your admin console screen. Just wait for few seconds untill the WMI screen is rendered completely. Ensure you have all the cumulative updates installed for your
    version of BizTalk and also ensure the service pack for your OS is updated.
    Obviously if message box is not working, files will not be received/processed. But if message box is not in healthy state this would affect all other application not just one and in-fact it would affect entire BizTalk not just Receive Locations.
    To start analysing this file not been processed by Receive Location, start with checking the host instance as mentioned.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • How to copy file from  one location to another

    Hi,
    I am new to java, I tried the following code to move the file from one location to another
    public class CopyFiles {
    public String copy ( File source, File target)
    throws IOException {   
    FileChannel sourceChannel = null;
    FileChannel targetChannel =null;
    try {   
    sourceChannel =new FileInputStream(source).getChannel();
    targetChannel= new FileOutputStream(target).getChannel();
    targetChannel.transferFrom(sourceChannel, 0,
    sourceChannel.size());
    finally {   
    targetChannel.close();
    sourceChannel.close();
    return "Success";
    public static void main(String [] args) throws Exception{   
    File source = new File("C:\\users\\download.pdf");
    File destinationFile = new File("C:\\apple\\download.pdf");
    copy(source, destinationFile);
    The above code is working perfectly, but I Don't want to include the file name in destination file. i.e. File destinationFile=new File("C:\\apple"), and at the same time the pdf with same name has to get stored in the destination location, how can I achieve this.

    kameshb wrote:
    I Don't want to include the file name in destination file. i.e. File destinationFile=new File("C:\\apple"), and at the same time the pdf with same name has to get stored in the destination location, how can I achieve this.It's not totally clear what you're saying here, but what I think you mean is that you don't want to explicitly set the destination file name--you want to just give the copy the same name as the original. Yes?
    If that's the case, then break the original up into separate directory and file name portions, and then construct the destination path from the destination directory plus original file name. You can do that by manipulating the full path string, or by using the methods in java.io.File.

  • Copy file from a location to another

    I work on a Java process that must be optimized and I have some questions.
    This process includes a part of copying a file from a location from another (to be more specific, all files that exist in a directory, to copy in another directory), wich technique is more efficient and quickly? To copy using FileInputStream/FileOutputStream in Java or using a java Runtime process that calls a copy command of the Operating System?

    I work on a Java process that must be optimized and I
    have some questions.
    This process includes a part of copying a file from a
    location from another (to be more specific, all files
    that exist in a directory, to copy in another
    directory), wich technique is more efficient and
    quickly? To copy using
    FileInputStream/FileOutputStream in Java or using a
    java Runtime process that calls a copy command of the
    Operating System?Neither. Use the FileChannels in the nio package if you can:
    /* Note:  Proper resource closing and exception handling is not done here */
    try {
            // Create channel on the source
            FileChannel srcChannel = new
            FileInputStream("srcFilename").getChannel();
            // Create channel on the destination
            FileChannel dstChannel = new
            FileOutputStream("dstFilename").getChannel();
            // Copy file contents from source to destination
            dstChannel.transferFrom(srcChannel, 0, srcChannel.size());
            // Close the channels
            srcChannel.close();
            dstChannel.close();
        } catch (IOException e) {
        }Spawning a Runtime process is probably the least efficient way to do it.
    - N

  • Copy File from One Location to Another Location through xcopy or any

    Hi,
    I Need to copy one file from one location to another location. That file need to save in C:\Windows\System32 folder
    I need to create one .bat file and i want apply that bat as a startup script through GPO.
    I tried through XCopy if i test in machine that is working. If i tried in other machine that is not working. becoz of some Credential issue
    I tried in the script by netuse command after that my script itself not working.
    SET username=XYZ\Administrator
    SET password=abcd
    @ECHO OFF
    cmd "cd C:\"
    net use "\\10.50.5.68\c$\Windows\System32" %password% /user:domain\%username%
    :copy
    Xcopy /S /I /E D:\DLL \\10.50.5.68\c$\Windows\System32 
    Regards, Hari Prasad.D

    You cannot do that in a startup script.  You do not need to do that in a startup script.
    To add files to the system use GP Preferences.
    On Window 7 and later only the Trussted Installer is allowed to add files. (That means only Microsoft.)
    No programs or users should ever alter files in the system area.
    ¯\_(ツ)_/¯

  • What is the best way to work on the same InDesign file in different locations?

    I'm the creative director for an in-house creative department. We produce 37 catalogs and a multitude of print and electronic advertising each year, plus a variety of other items. Our problem is that we have two locations. In the current set-up, if I want someone at one location to work on a project but the files are at the other location, I have someone at the one location package all the materials involved with that project and either upload them to DropBox or copy them to an external drive and ship it. Not very efficient.
    We have servers at both locations but there are different files at each location. I'm able to remote from my computer into a computer at the other location, but if everyone were to do that we would need double the number of CC subscriptions and computers, and it would bog down the internet connection that the entire company uses. I'm also connected to the server at the other location (again, over the internet) and have opened InDesign files that reside on the server there and tried to work on them here (over the internet) but that is much slower than remoting in.
    The only way I can think of to alleviate this problem is to run duplicate servers at each location, but this would be an update and back-up nightmare (unless I'm missing something). Is anyone operating this same way and, if so, how are you dealing with it?
    We can't be the only company that works like this. Maybe I'm just missing something.
    Thanks,
    Lloyd

    We have servers at both locations but there are different files at each location. I'm able to remote from my computer into a computer at the other location, but if everyone were to do that we would need double the number of CC subscriptions and computers, and it would bog down the internet connection that the entire company uses. I'm also connected to the server at the other location (again, over the internet) and have opened InDesign files that reside on the server there and tried to work on them here (over the internet) but that is much slower than remoting in.
    One tiny thing bothers me about your setup. And you said it above, you would need double the number of CC subscriptions and computers. Are you using two people to access under the same CC subscription. Even if they are working in two different time zones, it is technically violating the rules and spirit of the rules of being able to install on two machines at the same time.
    You're allowed to install for two machines for one person working at the office and then at home. One person wouldn't be in two different locations at the same time.
    Meanwhile, regards your problem, I remember reading about a system many years ago that was pretty simple. It was based on an old newspaper/magaizine system of "who has the folder." (Created before computers) In the old days, if someone was working on a file, they left a folder with their name in its place.
    In the computer age, one person, working on a file, would move it to their desktop. Then, they would leave an empty folder with that document's name where it had been as well as their initials. So if I took "Shoes and Socks Fall 2015.indd" out, I would leave a folder named "Shoes and Socks Fall 2015_smsc" in its place.
    And if it was necessary for me to have the images, I would make a copy of them onto my machine so I wouldn't tax the network. Then when I was finished, I would copy the file back to the server. The links should show up. If not, we could relink later.
    With the empty folder on the server, anyone could tell who is working on a project. So if they were late getting it back, you could email them.
    It relies on the people being disciplined enough to make the folders, move the docs, etc. But since you've ruled out all the systems for companies with dumb employees, you're going to have to make them follow the rules.

  • Recently purchased song and another I transfered into my ITunes library vannot be set up in a playlist.I get the message"file cannot be located".Originally I could listen to the purchased song but now that will no longer play.What do I need to do to ?

    Recently purchased a song from ITunes and another that I downloaded from a CD will not transfer to a playlist and will not even allow me to listen to the songs.I get the message "file cannot be located"What can I do to get my system to locate the file?Originally I could play the songs from my desktop and I was able to transfer to my IPad.

    Because the location for each song in your library is on your hard drive.  If the hard drive isn't there, how can iTunes play it?
    You'll have to move/copy the music from your hard drive to your computer's hard drive.
    Basically, EASIEST way to do all this, if you don't care about your play counts, etc...
    -Delete EVERYTHING from iTunes, so that your library is now empty.
    -Go to "Advanced" inside of the "Preferences" window, found in the "Edit" drop-down.  You can also access Preferences by pressing Ctrl+, (Press Ctrl and the comma key)
    -Change your iTunes Media Folder Location to something simple, but on your computer. I use C:/iTunes.  Make sure "Keep iTunes Media Folder Organized" and "Copy files to...." are both checked.  You can close Preferences now.
    -Now, drag and drop your music from your hard drive into your iTunes library.  iTunes will automatically add the music to your library, as you would expect, and also creates a copy of each file to place into that iTunes Media Folder you just created.
    Shouldn't have any more problems...

  • Reading XML file from specific location&Storing xmldata into related tables

    I am new to xml.
    My requirement is,
    1) Get the xml file from specified location (C:\xmlfiles\ xmldata.xml)
    2)Convert xml data in clob data.
    3)store the data into related table.
    and vice-versa.
    What i did,
    a) I got the data from related tables and converted into xmlformat using SQLX
    b)converted this resultset into clob data and stored as xml file in specific location.
    It uses more then ten tables.
    All this help i got from AskTom site , thanks for that.
    Now i have to do vise-versa, i.e. i have to perform 1), 2), 3) steps........
    Please tell me proper steps to acheive it.
    Thanks in advance for giving your precious time to solve my issue.

    Have you read the"XMLDB FAQ" in this Forum?
    You could use stuff like:
    create or replace directory xmldir as C:\xmlfiles'
    declare
    xmldata xmltype;
    begin
    xmldata := xmltype(bfilename('XMLDIR','xmldata.xml'),nls_charset_id('AL32UTF8'));
      -- etc, etc your code --
      -- --> convert to clob by using for instance getclobval() function
      -- --> then insert the data in your relational table with CLOB column
      -- etc, etc your code --
    end;
    /

  • To Read the contents of the properties file which is located in webserver

    Hi,
    I have one requirement where I have to read the contents of a property file which is located in some path in server. Say for example, when you click on link abcd then contents of abcd.properties file should be displayed in one text view in webdynpro . I am trying to implement this in webdynpro for java. The main thing is like I am not able to retrieve the server path of the file and hence not getting the file contents. I tried using methods like  getApplicationPath() or getRealPath() but its not working. So can you guys please help me on to how to read the server file contents.
    Thanks and regards,
    Sai

    Hi Romano,
    Thanks a lot for your reply. However, I forgot to mention one thing in my question. Its like the path will be different everytime. Say, we have systems like development, acceptance, production. So when the user clicks on the link abcd, it should take the path of development system and similarly when the user clicks on the link in acceptance or production, the path will be different. say for example, in development the path will be
    usr/cluster/dev/abcd.properties but it acceptance it will be usr/cluster/acc/abcd.properties. So just want to know whether this will work? Anyway, I will give this a try.
    Thanks once again,
    Sai

  • I have just restored data from an external hard drive, but half of my iTunes songs are getting the error "original file cannot be located."  Where are these files?

    My Windows 7 PC just had to be reformatted, and I have retrieved all of my files from an external hard drive.  About half of my iTunes library is working fine, the other half pop up the error statement "original file cannot be located."  If they haven't come off my external drive, where are they?

    This happens if the file is no longer where iTunes expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, or that the drive it lives on has had a change of drive letter. It is also possible that iTunes has changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout,or vice-versa, and so is looking in slightly the wrong place.
    Select a track with an exclamation mark, use Ctrl-I to get info, then cancel when asked to try to locate the track. Look on the summary tab for the location that iTunes thinks the file should be. Now take a look around your hard drive(s). Hopefully you can locate the track in question. If a section of your library has simply been moved, or a drive letter has changed, it should be possible to reverse the actions.
    Alternatively, as long as you can find a location holding the missing files, then you should be able to use my FindTracks script to reconnect them to iTunes .
    tt2

Maybe you are looking for

  • Mid 2010 Macbook pro "overheating"

    First off let me just say I know there are many threads about this already - but all of them have the same kind of answer "the Macbook Pro is not overheating unless it turns off, keep it well ventialted and on a flat surface" etc, etc. I'm not compla

  • Keynote Send to iPhoto creates images too small for iBooks

    I like using iBooks, but the layout flexibility is too constraining for what I do. I like to do my layouts in Keynote (because I get freedom of layout, cool themes, and I can them use the Keynote as a presentation) then I send to iPhoto. In the past,

  • URGENT! TAB + Folder navigation Problem

    Hi! I've got a portal page with two tabs (let's say tab1 and tab2). Inside each of them I have added a portlet(wich is in fact a folder pubilshed as portlet - let's say folder1 and folder2) 1 - I click on tab1. 2 - I click on folder1 - it's subfolder

  • Need help opening a CD tutorial

    Hello Folks, I have an iMac G5 running OS X (10.3.9). I have a new CD Irish flute tutorial, called Mad for Trad, which I can't seem to open. The company says that it is Mac compatible with at least OS X (8.1) or higher, and that it should autostart.

  • Can i get a sound card that doesn't crackle or distort for gami

    Hi. I have been thinking about getting a soundcard basically for gaming (battlefield 2 & battle for middle earth 2). What I want to get out of it is to maybe take some of the load off my system by getting a sound card to take care of sound tasks givi