To Copy the file content to another file and to delete the orginal file.

Hi ,
Can you pls let me know how i need to copy the contents of one file to other,
For e.g   P_FL Consits of following records ( Assume that file need to created on application server)
  This is standard header ( header record)
name  school class adreess ( item records)
xyz     abc     1        kkkkk
jjjj        cba     2       jkjkjkj
uiui      cab     3       oioioioi
  i need to copy the above mentioned file contents( P-FL) into another file say P_NEWFL.
so how i need to create this new file and how to copy the content of old file to new file.
After copying the contents of old file to new file i need to delete old file.

Sample code to implement this
PARAMETER: p_file TYPE file DEFAULT 'd:\interface\In\barcoinbound2sap.txt',
           p2_file TYPE file DEFAULT 'd:\interface\In\backup_barcoinbound2sap.txt'.
START-OF-SELECTION.
  OPEN DATASET p_file IN TEXT MODE ENCODING DEFAULT FOR INPUT.
  OPEN DATASET p2_file IN TEXT MODE ENCODING DEFAULT FOR OUTPUT.
  DO.
    READ DATASET p_file INTO line.
    IF sy-subrc NE 0.
      EXIT.
    ENDIF.
    TRANSFER line TO p2_file.
   IF sy-subrc NE 0.
     EXIT.
   ENDIF.
    SPLIT line AT ',' INTO lit_barco-prodnorder lit_barco-quant lit_barco-machtime lit_barco-duedate.
    APPEND lit_barco.
    CLEAR lit_barco.
  ENDDO.
  CLOSE DATASET p_file.
  CLOSE DATASET p2_file.
dalete dataset p_file

Similar Messages

  • How do I reinstall Adobe Acrobat XI Pro from the Creative Cloud? I was deleting another program and accidently deleted Acrobat.

    How do I reinstall Adobe Acrobat XI Pro from the Creative Cloud? I was deleting another program and accidently deleted Acrobat.

    Sweetmelissa63 for information on how to reinstall Adobe Acrobat XI Professional please see CC desktop lists applications as "Up to Date" when not installed - http://helpx.adobe.com/creative-cloud/kb/aam-lists-removed-apps-date.html.

  • I just copied my TB profle in another computer and the folders sre dublicated. I keep deleting them and they keep reapper. What should I do?

    I use english and greek letters for the folders and the folders that are dublicted seem to be only te greek ones.

    Attached is Dennis Linam’s Audition – “Log File” and “Log – Last File”
    Contact information Dennis [email protected]
    Previous contact information with your organization (DURIM):
    Dennis - i just finished my audition trial and bought the subscription the 2014 version.
    created by durin in Audition CS5.5, CS6 & CC - View the full discussion 
    DURIM - Okay.  I would expect the "Cache Warning" message because your default directories would not be the same as the ones in the settings file I generated.
    If you go back to the "7.0" directory and open the "Logs" folder, can you copy the "Audition Log.txt" file and send it as an attachment to [email protected]?  We'll take a look in that logfile and see if it gives us more information about why this is failing now.
    Also, do you have any other Adobe applications installed on this machine, such as Premiere Pro?  If so, do they launch as expected or fail as well?
    I do have the trial Pro version of Adobe reader, but I have not activated it, because I fear the same thing will happen did it. I cannot afford to activate the subscription for that product and take the chance of it not working either. I depend on those two programs religiously. Here is the files that you requested. I appreciate any help you can give me to get this audition program started
    Audition Log- file
    Ticks = 16       C:\Program Files (x86)\Common Files\Adobe\dynamiclink\7.0\dynamiclinkmanager.exe
    Sent from Windows Mail

  • How to Copy Azure Table Content to another Storage Account's Table

    Hi Team,
    We have two storage accounts in Azure. StorageAccount1 has several Tables like Table1. Table1 has 50 rows & 4 columns.
    We want to copy the Table1's content from StorageAccount1 to StorageAccount2. Please let us know how can we use Native Windowds Azure
    Powershell command-lets to accomplish this task.
    Thanks.
    Regards,
    Subhash Konduru
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Hi,
    Moving this to Azure cmdline tools forum since it is not specifically related to the Azure Automation service.

  • If I copy my Bootcamp contents to my Mac and back, will they be fragmented?

    I'd like to resize my Boot Camp partition by copying the contents of the install (Windows XP) entirely to my OS X partition, deleting/recreating the Boot Camp partition, and copying the files directly back.
    My question is whether these files will be fragmented when I copy them back that way?

    g-pod wrote:
    I'd like to resize my Boot Camp partition by copying the contents of the install (Windows XP) entirely to my OS X partition, deleting/recreating the Boot Camp partition, and copying the files directly back.
    My question is whether these files will be fragmented when I copy them back that way?
    I presume you will be using WinClone to clone the Windows partition. You don't want to simply copy them - that won't work.
    The Windows files will be restored exactly as they were when they were cloned.
    You can defrag the Windows files before cloning or after restoring (it makes no difference) using the Windows defrag tools.
    There will be no change to the Windows files.

  • How do I copy all Email messages to another system and view them seperately from any messages on the new system?

    We're giving my wife's old laptop to our children. We have already set up her E-mail accounts on the new laptop which is now 2-3 months old. While cleaning off the data from the old laptop, I have found hundreds of Emails that I want to save for future use. I just archived the old messages tonight. How do I copy them to an external drive so we can read them later without writing over all the new Emails on the new laptop?

    ImportExporttool:
    * https://freeshell.de//~kaosmos/mboximport-en.html
    how to install addon:
    * https://support.mozilla.org/en-US/kb/add-ons-and-extensions-faq#w_how-do-i-install-an-add-on
    On old laptop:
    Right click on the folder containing the emails > ImportExporttools > choose from options eg: Export folder
    choose where to export.
    You can also choose to export all the messages as eml files.
    Copy file to desktop of new computer
    To Import onto new computer.
    right click on 'Local Folders' > ImportExporttools > Import mbox file
    choose file and click on open
    or if you exported as eml files:
    right click on Local Folder Inbox > ImportExporttools > Import Messages
    See image attached:

  • When I plug in my iPhone to my mac it doesn't sync the music and when I try to sync the music is says that it is with another library and will delete all the songs on my phone to put the ones from my computer on it.

    Whenever I try to sync my phone with my computer it won't automatically sync my new music from my computer to my phone. When i select it to sync it says that it is going to delete all the music off my phone because its already with another device (or something along those lines) but I use my itunes from my computer to my phone. Does anyone know how I can fix this so it will sync. Will all the songs on my phone be on my computer so it won't matter if it deletes them off of my phone?

    In the course of your troubleshooting to date, have you worked through the following document?
    iOS: Device detected but not identified properly on iTunes for Windows

  • I accidentally moved my iphoto library to another foler, and i delete the original one, how can i get my images back

    i was thinking of clear some space for my macbook, so i moved some images form picture to window disk, but i accidentally moved iphoto library too. And i didn't realised it would affect iphoto, until i opened iphoto finding all the images were gone. How can i get the images back?

    This might help:  Rebuilding the iPhoto library

  • I have an ipod and an iphone. I would like to use both devices for my work and home computer. But it tells me that its installed to another library and will delete all items to sync to itunes. Is there a way to do this without deleting?

    OK....... I have an Ipod and an Iphone. Would like all the Movies and music i have on both. My computer broke and now the only music i have is on ipod. It wont let me transfer to itunes. It says this device is linked to a different library and if i want to sync to a new one and delete everything on it. UH....NO   Is there a way to do this without deleting ? All purchases were made though the same apple id.

    - An iPod can only sync with one iTunes library. Yu can however manage music and videos among different computers by:
    Using iPhone, iPad, or iPod with multiple computers
    - To change syncing computer, move all the media to compute r#2
    - Connect the iPod to #2 and make a backup by right clicking on the iPod under Devices in iTunes and select Back Up
    - Restore the iPod from that backup
    Note tha the iPod backup the iTunes makes does not include synced media like apps and music.

  • ECC6 EHP2 (ABAP+Java)  system copy using file system copy

    Hello Experts,
    I have a question around system copy method for a dual stack ECC6 EHP2 system.
    We are planning to take full file system backup of this entire ECC6 EHP2 dual stack system and throw it on a completely new hardware with new host name but same SID.  We are also planning to do a host renaming in instance profiles and re-building the control files in target system after we finish the file system restore.
    Is this method supported in SAP ? Or we strictly have to use  SAPinst to do export and import method.  In any case our source and target platform is not going to chance as per our scenario.
    Any suggestions will be greatly appreciated.
    Thanks,
    Harshal

    > Thanks for the quick response. Is their any document that says it is not supported ?  Because of no proper document that says no to do it, client want's to try it out.
    For the ABAP part this is certainly feasible.
    The Java part has not only issues with the secure store but also with SID and hostname. The old values are stored in many places in the database and in, depending on the applications installed, many .properties files in the filesystem. So it would be not enough to somehow regenerate the secure store but also change hostname and SID in different places that are not really all documented.
    What you are basically looking for is
    Note 757692 - Changing the hostname for J2EE Engine 6.40/7.0 installation
    with the significant sentence
    This note should be applied only when the hostname of a machine
    where the j2ee engine was already installed has changed.
    It does not replace the SAP official system copy procedure and
    MUST NOT be used for copying of an instance to another host and/or with different SID.
    Markus

  • Copy ESS HTML Content Package

    Hi,
    When I try copying ESS HTML Content Package from "Life and Work Events - US" folder to another folder, it crashes with a Null Pointer exception.
    Any ideas please?
    Trace:
    java.lang.NullPointerException
         at com.sap.caf.eu.gp.ui.gallery.VCopyDialog.createTreeElement(VCopyDialog.java:272)
         at com.sap.caf.eu.gp.ui.gallery.VCopyDialog.wdDoInit(VCopyDialog.java:163)
         at com.sap.caf.eu.gp.ui.gallery.wdp.InternalVCopyDialog.wdDoInit(InternalVCopyDialog.java:207)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
         at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:445)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.getView(ViewManager.java:709)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.bindRoot(ViewManager.java:579)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.init(ViewManager.java:155)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.doOpen(WebDynproWindow.java:295)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.handle(ApplicationWindow.java:259)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.handleWindowEvents(ApplicationWindow.java:239)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:149)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:313)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Cheers,
    Rajit

    Hi,
    When I try copying ESS HTML Content Package from "Life and Work Events - US" folder to another folder, it crashes with a Null Pointer exception.
    Any ideas please?
    Trace:
    java.lang.NullPointerException
         at com.sap.caf.eu.gp.ui.gallery.VCopyDialog.createTreeElement(VCopyDialog.java:272)
         at com.sap.caf.eu.gp.ui.gallery.VCopyDialog.wdDoInit(VCopyDialog.java:163)
         at com.sap.caf.eu.gp.ui.gallery.wdp.InternalVCopyDialog.wdDoInit(InternalVCopyDialog.java:207)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
         at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:445)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.getView(ViewManager.java:709)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.bindRoot(ViewManager.java:579)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.init(ViewManager.java:155)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.doOpen(WebDynproWindow.java:295)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.handle(ApplicationWindow.java:259)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.handleWindowEvents(ApplicationWindow.java:239)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:149)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:313)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Cheers,
    Rajit

  • Copying the background job

    Hi,
    I have a background job with has a start condition after execution of a particular event.
    Now i need to copy this background job to another name and execute it. I tried using the function module BP_JOB_COPY, but that copied the background job without the job start conditions. How can i copy the background job along with start conditions.
    Thank you in anticipation.

    Hi Nikhil,
    the follwoing code schedules 2 jobs from a source job (which is maintaned in the system).
    data: s_tbtcjob1 like tbtcjob,         "target job #1"
          s_tbtcjob2 like tbtcjob.         "target job #1"
    data: h_1 like tbtco-jobcount,         "jobcount"
          h_2 like tbtco-jobcount,         "jobcount"
          h_1s like tbtco-jobname,         "jobname source"
          h_2s like tbtco-jobname,         "jobname source"
          h_1t like tbtco-jobname,         "jobname target"
          h_2t like tbtco-jobname.         "jobname target"
    selection-screen begin of line.
    selection-screen position 2.
    parameters ra radiobutton group rad1.
    selection-screen comment 4(70) text-001.
    selection-screen end of line.
    selection-screen begin of block block1 with frame.
    parameters: p_a1 like h_1,
                p_a1s like h_1s,
                p_a1t like h_1t,
                p_a2 like h_2,
                p_a2s like h_2s,
                p_a2t like h_2t.
    selection-screen end of block block1.
    start-of-selection.
      perform create_jobs using p_a1 p_a1s p_a1t p_a2 p_a2s p_a2t.
    *       FORM CREATE_JOBS                                              *
    form create_jobs using h_1 h_1s h_1t h_2 h_2s h_2t.
      call function 'BP_JOB_COPY'
           exporting
                dialog                  = 'N'
                source_jobcount         = h_1
                source_jobname          = h_1s
                target_jobname          = h_1t
           importing
                new_jobhead             = s_tbtcjob1
           exceptions
                cant_create_new_job     = 1
                cant_enq_job            = 2
                cant_read_sourcedata    = 3
                invalid_opcode          = 4
                jobname_missing         = 5
                job_copy_canceled       = 6
                no_copy_privilege_given = 7
                no_plan_privilege_given = 8
                others                  = 9.
      call function 'BP_JOB_COPY'
           exporting
                dialog                  = 'N'
                source_jobcount         = h_2
                source_jobname          = h_2s
                target_jobname          = h_2t
           importing
                new_jobhead             = s_tbtcjob2
           exceptions
                cant_create_new_job     = 1
                cant_enq_job            = 2
                cant_read_sourcedata    = 3
                invalid_opcode          = 4
                jobname_missing         = 5
                job_copy_canceled       = 6
                no_copy_privilege_given = 7
                no_plan_privilege_given = 8
                others                  = 9.
      call function 'JOB_CLOSE'
           exporting
                jobcount                    = s_tbtcjob2-jobcount
                jobname                     = s_tbtcjob2-jobname
                pred_jobcount               = s_tbtcjob1-jobcount
                pred_jobname                = s_tbtcjob1-jobname
              targetsystem                = '<<SYSTEM IN CASE OF MULTIPLE SERVERS>>'
           exceptions
                cant_start_immediate        = 1
                invalid_startdate           = 2
                jobname_missing             = 3
                job_close_failed            = 4
                job_nosteps                 = 5
                job_notex                   = 6
                lock_failed                 = 7
                others                      = 8.
      call function 'JOB_CLOSE'
           exporting
                jobcount                    = s_tbtcjob1-jobcount
                jobname                     = s_tbtcjob1-jobname
                strtimmed                   = 'X'
              targetsystem                = '<<SYSTEM IN CASE OF MULTIPLE SERVERS>>'
           exceptions
                cant_start_immediate        = 1
                invalid_startdate           = 2
                jobname_missing             = 3
                job_close_failed            = 4
                job_nosteps                 = 5
                job_notex                   = 6
                lock_failed                 = 7
                others                      = 8.
    endform.

  • Whem i'm doing the backup it automaticaly saves contacts.....because i've synced with another computer anf it deleted all my contacts...and i really need them!!!!!

    Whem i'm doing the backup it automaticaly saves contacts.....because i've synced with another computer and it deleted all my contacts...and i really need them!!!!!

    If you haven't been using your phone as recommended, then you've lost all your contacts.  Contacts should be synched to your computer (Address Book, Outlook) or a cloud service (MobileMe, Google) for safekeeping.  The iPhone was never intended to be a storage device.
    If you haven't been using your phone as recommended and synching your contacts as above, frankly, you've no one to blame for your loss of data but yourself. 
    On that topic, are you making regular backups of your computer's data as well?  Hard drives WILL fail.

  • Sync itunes with atv and then delete itunes content? possible?

    i have a mac book pro with a 80 gb hdd... i'm running too short of space because i have movies and music in my itunes...
    is there any way to send this movies to an apple tv and watch them from there, so i can delete them from my hdd and save space?...

    There are two parts to consider, moving some of the content to another location and then maintaining a split library.
    To move your movies simply copy them to their new location, you'll find movies in a folder called movies in your itunes music folder which by default is your music folder. Then you can delete the originals by selecting all the movies in itunes and deleting them and choosing to move originals to the trash when prompted.
    Now select all the movies you have on your external drive while holding down the 'alt' key drag them into the itunes window. This will put them into itunes without copying them to your itunes music folder again.
    Once this is done and you are certain your movies work as expected you can now empty your trash.
    From now on when you add content to itunes you will need to decide where you want the original to go, dragging anything into itunes will copy it to your itunes folder which is fine for your music but not what you want for movies. So when you add movies, copy them to your external drive and then from there use 'alt' + drag and drop into the itunes window.
    Does that make sense.

  • How to copy the content of one file into another

    I have tried this code
    try {
                   fin = new FileInputStream("file path");
              catch(FileNotFoundException exc)
                   System.out.println("File not found");
                   return 0;
              catch(ArrayIndexOutOfBoundsException exc)
                   System.out.println("Usage: Showfile file");
                   return 0;
              while(true){
                   i=fin.read();
                   if(i==-1)
                        break;
                   cnt++;
              fin.close();*/
    now in this way i can lift one character at a time and copy it into another file (note i have not done the copy part in this code but that can be implemented) however this whole procedure is taking too much time if the size of the file is too big....kindly suggest another way to copy one file into another

    have you ever copied and pasted a large file in Windows or another OS? Larger files take more time to copy, that's just how it is.

Maybe you are looking for