Need help for Scheduling a Spool file and FTP the file

I have one requirement like below...
1. Start Scheduling a job
2. Generate a Spool file (.csv file)
3. If Spool file generation is successful then start FTP the file
Else End job
4. After successful FTP process end the job.
We need to create a log file also for this job.
Can any body give some idea how will i proceed?
Thanks in advance.

Billy  Verreynne  wrote:
BluShadow wrote:
Chris' may be wrapped, but it includes the funky ability to query remote files directly in SQL due to it's use of pipelined functions. A feature I've also got in my own FTP package and very useful for monitoring logs on remote servers through our Apex applications. ;)Ditto - also rolled my own FTP package as doing wildcard file listing requires custom support depending on the type of FTP server you're dealing with. The text part of the responses differ (these are not RFC'ed) and makes parsing more complex than what it could have been.Yeah, the differing responses can be a pain, though fortunately they are far and few between. There was a bug in Chris' package in that it wasn't handling a two code response from a windows FTP server for one of the commands, but I emailed him and he fixed that. Not his fault, he didn't have a windows FTP server to test on at the time.
FTP is a pretty straight forward protocol and easy to wrap a PL/SQL package around (using <i>UTL_TCP</i>).Absolutely. and the RFC details almost everthing you need to handle. It was quite quick to knock up a package, similar to the code hoek has linked to.
I think there is a lot of common stuff that many of us do in this regard. Always wondered how well a proper GPL'ed open source project providing a PL/SQL development framework and libraries would do...I think there'd be a lot of arguments about what is the best way of doing things. :D

Similar Messages

  • FILE and FTP Adapter file size limit

    Hi,
    Oracle SOA Suite ESB related:
    I see that there is a file size limit of 7MB for transferring using File and FTP adapter and that debatching can be used to overcome this issue. Also see that debatching can be done only for strucutred files.
    1) What can be done to transfer unstructured files larger than 7MB from one server to the other using FTP adapter?
    2) For structured files, could someone help me in debatching a file with the following structure.
    000|SEC-US-MF|1234|POPOC|679
    100|PO_226312|1234|7130667
    200|PO_226312|1234|Line_id_1
    300|Line_id_1|1234|Location_ID_1
    400|Location_ID_1|1234|Dist_ID_1
    100|PO_226355|1234|7136890
    200|PO_226355|1234|Line_id_2
    300|Line_id_2|1234|Location_ID_2
    400|Location_ID_2|1234|Dist_ID_2
    100|PO_226355|1234|7136890
    200|PO_226355|1234|Line_id_N
    300|Line_id_N|1234|Location_ID_N
    400|Location_ID_N|1234|Dist_ID_N
    999|SSS|1234|88|158
    I would need a the complete data in a single file at the destination for each file in the source. If there are as many number of files as the number of batches at the destination, I would need the file output file structure be as follows:
    000|SEC-US-MF|1234|POPOC|679
    100|PO_226312|1234|7130667
    200|PO_226312|1234|Line_id_1
    300|Line_id_1|1234|Location_ID_1
    400|Location_ID_1|1234|Dist_ID_1
    999|SSS|1234|88|158
    Thanks in advance,
    RV
    Edited by: user10236075 on May 25, 2009 4:12 PM
    Edited by: user10236075 on May 25, 2009 4:14 PM

    Ok Here are the steps
    1. Create an inbound file adapter as you normally would. The schema is opaque, set the polling as required.
    2. Create an outbound file adapter as you normally would, it doesn't really matter what xsd you use as you will modify the wsdl manually.
    3. Create a xsd that will read your file. This would typically be the xsd you would use for the inbound adapter. I call this address-csv.xsd.
    4. Create a xsd that is the desired output. This would typically be the xsd you would use for the outbound adapter. I have called this address-fixed-length.xsd. So I want to map csv to fixed length format.
    5. Create the xslt that will map between the 2 xsd. Do this in JDev, select the BPEL project, right-click -> New -> General -> XSL Map
    6. Edit the outbound file partner link wsdl, the the jca operations as the doc specifies, this is my example.
    <jca:binding  />
            <operation name="MoveWithXlate">
          <jca:operation
              InteractionSpec="oracle.tip.adapter.file.outbound.FileIoInteractionSpec"
              SourcePhysicalDirectory="foo1"
              SourceFileName="bar1"
              TargetPhysicalDirectory="C:\JDevOOW\jdev\FileIoOperationApps\MoveHugeFileWithXlate\out"
              TargetFileName="purchase_fixed.txt"
              SourceSchema="address-csv.xsd" 
              SourceSchemaRoot ="Root-Element"
              SourceType="native"
              TargetSchema="address-fixedLength.xsd" 
              TargetSchemaRoot ="Root-Element"
              TargetType="native"
              Xsl="addr1Toaddr2.xsl"
              Type="MOVE">
          </jca:operation> 7. Edit the outbound header to look as follows
        <types>
            <schema attributeFormDefault="qualified" elementFormDefault="qualified"
                    targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/file/"
                    xmlns="http://www.w3.org/2001/XMLSchema"
                    xmlns:FILEAPP="http://xmlns.oracle.com/pcbpel/adapter/file/">
                <element name="OutboundFileHeaderType">
                    <complexType>
                        <sequence>
                            <element name="fileName" type="string"/>
                            <element name="sourceDirectory" type="string"/>
                            <element name="sourceFileName" type="string"/>
                            <element name="targetDirectory" type="string"/>
                            <element name="targetFileName" type="string"/>                       
                        </sequence>
                    </complexType>
                </element> 
            </schema>
        </types>   8. the last trick is to have an assign between the inbound header to the outbound header partner link that copies the headers. You only need to copy the sourceDirectory and SourceGileName
        <assign name="Assign_Headers">
          <copy>
            <from variable="inboundHeader" part="inboundHeader"
                  query="/ns2:InboundFileHeaderType/ns2:fileName"/>
            <to variable="outboundHeader" part="outboundHeader"
                query="/ns2:OutboundFileHeaderType/ns2:sourceFileName"/>
          </copy>
          <copy>
            <from variable="inboundHeader" part="inboundHeader"
                  query="/ns2:InboundFileHeaderType/ns2:directory"/>
            <to variable="outboundHeader" part="outboundHeader"
                query="/ns2:OutboundFileHeaderType/ns2:sourceDirectory"/>
          </copy>
        </assign>you should be good to go. If you just want pass through then you don't need the native format set to opaque, with no XSLT
    cheers
    James

  • Need help to count number of rows and display in file

    Hello,
    my scenario is IDOC to File......i am using XSLT mapping and using FCC parameters to convert the flat file.
    now new requirement is i need to count number of rows and add count value last of the file.
    Please let me know how to do it,
    thanks in advance for your help.
    Regards,
    Chinna

    thanks again, one more Q.
    in XSLT mapping i have written for loop for complete structure.
    example : <Details>
                         <node1>
                         <node2>
                   </details>
    in XSLT mapping
                         <xsl:for-each select="ZMATMAS_01/IDOC/E1MARAM">
         <Details>
         </Details>
         </xsl:for-each>
    if i add the field at target side....then i will come under details node and it will be repeated.
    how to declare in XSLT mapping.

  • Schedule job in background and ftp the data to non-sap system

    Hello All,
    I have a requirement where in i have to write a program(with selection screen) to download 2 files into application server(frequency: end of each day i.e daily at 23:59), and then in turn i need to put those two files into FTP server using FTP script.
    i guess my flow of the code should be
    1. write the program with selection screen and
    2. get the data from corresponding tables and put it into internal tables.
    3. then i have download the data into application server
    my question is : how i will schedule the job in background to download the data into application server daily? using job_open, job_submit, job_close?
    4. then how i need to move the files from application server to FTP server using FTP SCRIPT?
    Also my doubt is once i execute the program ONLY, the background job is triigred (because i wrote job_open, job_submit and job_close inside my program). then how will i input the data into screen daily and download the data into application server in background automatically???? i am confused ...
    Please help me to solve the above issues
    thanks
    sangeetha

    >
    sangeetha s k wrote:
    How my data in application server will be transfer to another system using above FM? Because i am not passing application server file path in SAP to that FM. Could you please explain ?
    So the path name and the file name are always the same? In that case you could simply create a SM49 entry with hard coded file & path name.
    An easy example for the COPY command under WINDOWS OS:
    Create a command in SM49 called ZCOPY with following data:
    Operating System = Windows NT
    OS command: cmd
    Parameters for os command: /C copy  "C:\tmp\my_file.txt" "z:\tmp\my_file_copy.txt"
    Additional parameters allowed: (leave blank)
    In this case you would call SXPG_COMMAND_EXECUTE by filling this 2  parameters:
         commandname                  = 'ZCOPY'     
         operatingsystem               = 'Windows NT'
    In the case that the file name and the path are not fixed you would set the following in the SM49 definition:
    Additional parameters allowed: X
    In this case you would call SXPG_COMMAND_EXECUTE by filling this 3  parameters:
         commandname                   = 'ZCOPY'     
         operatingsystem                = 'Windows NT'
         additional_parameters       = params  "<== fill in the path and file name during run time into this variable

  • How to locate a phrase in a file and read the file after that location

    I have a text file with the following contents
    Previous date data.....[10,000 lines ]
    same as below but with earlier dates
    * ABC  AutoJournal Utility - Version 2.00 *
    Beginning Reportournal at (time): Tue May 04 18:07:46 IST 2010
    AutoJournal assigned updated records a timestamp of (server time):  *2010-05-04*  //THIS IS THE PHRASE  i am looking for
    #  Posted Date,           Policy,  Reason, Amount, Insured Name, Agent Name
    1) 2010-04-26 00:00:00.0, 7363496, GRSS, 10.0, KRASSNER W, BROOKS STEVEN E
    2) 2010-04-23 00:00:00.0, 4768200, GRSS, 0.0, STECKLER M, STECKLER GIBSON
    3) 2010-04-20 00:00:00.0, 7328358, GRSS, 4.0, LYON GREGO, WEST MICHAEL J
    4) 2010-04-20 00:00:00.0, 4754236, GRSS, 0.0, PEEBLES JA, HOFFMANN GABRIE
    5) 2010-04-22 00:00:00.0, 7363793, GRSS, 2.0, LAHAYE NAN, GONYEA MICHAEL
    6) 2010-04-26 00:00:00.0, 7360935, GRSS, 35.0, AMITAY NOA, WIESEL HENRYI need to locate the date and start reading the data for the current date only i.e Today's date
    Thus far i have done this....
    it's just the outline
    String srchDate="2010-05-04";
    BufferedReader bf=null;
                   try {
                          bf = new BufferedReader(new FileReader("C:\\File.log"));
                       int lineID = 0;  
                       Pattern pattern =  Pattern.compile(srchDate);  
                       Matcher matcher = null;  
                       String line =null;
                          while((line=bf.readLine())!=null){ 
                                 System.out.println(line);
                                    lineID++;  
                                    matcher = pattern.matcher(line);      //Will match the entire line against srchDate and will return false ...
                                    if( matcher.find()){  
                                        //do stuff...      //stuck here
                                          //get the line no..
                        } catch (Exception e) {
                             e.printStackTrace();
                        }     Some help on this would be very helpful...
    Thanks :)
    P.S:This needs to be done using java 1,4 only

    kevinaworkman wrote:
    RainaV wrote:
    kevinaworkman wrote:
    If I were you, I would split your problem up into smaller pieces.
    Write a method that reads a file into a String.This file is actually quiet huge i am not sure if this would work as the file will only grow in size in the future....How big is "quiet huge"? I wouldn't worry about optimization until you've actually encountered a problem.FYI The file size is 20MB ...
    >
    Write a method that figures out where in a String a substring occurs (hey, that one might be done for you already...).
    Write a method that returns a substring of a String, based on a start index and a length (something tells me this one might exist already too).
    Write a method that converts a String to the correct datatype.
    Regarding these steps i am not sure if i follow>>
    the lines you see 1)....
    2).... till last line say 800..
    I don't understand your question.I was wondering if your appraoch would be complicated but will give it a try...
    >
    Actually i thght i would just read one complete line and store that in an list and then write it to an excel sheet...Okay, and the steps I outlined would work for reading in one line at a time, as well. It's just one more step.
    i am unable to locate this phrase using regex so can you suggest something on that lines
    You're trying to find today's date? Why does that require a regular expression?I want to read the data after i have located today's date in the Text file so i need to locate it first but the code i posted doesn't work so i suggested if you can advice on the correction....as per my approach mentioned in the original post
    But if i do it your way then definately no need for regex i need to store all of it in a string and work woth sub strings so on,...

  • How  to   download the file and delete the file

    plz send me reply

    Hi Nagalakshmi,
    If you want to download a file on to the presentation server from your application then please have a look at the methods listed under the OO class CL_GUI_FRONTEND_SERVICES from transaction SE24 to perform similar operations as requested by you on files on presentation server.
    However if u are considering downloading and then deleting a file on the application server, then u would need commands like OPEN DATASET, TRANSFER and CLOSE and eventually DELETE DATASET.
    F1 on the commands should help you along.
    Hope this helps.
    Regards,
    Aditya

  • Read encrpted zip file and ftp unzip file

    Hi,
    I have a situation,where i need to read 3 zip files, which are encrpted, and each zip file may have lot of images and text files. all i want to do is, read these 3 zip files and unzip + ftp to another directory. No mapping is involved. if the three files are not there, it should error out.
    I have some ideas, but thought if any of you have better ideas.
    Thanks
    Pandari

    Hi Pandari
    File adapter
    module to zip and unzip
    /people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework
    /people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
    <b>Check this weblog:</b>
    /people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework
    Check this out !
    /people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework%3Fpage%3Dlast%26x-order%3Ddate%26x-showcontent%3Doff
    also
    https://service.sap.com/sap/support/notes/965256
    Check this weblog on how to zip the file using XI:
    /people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework
    PayloadZip Bean
    /people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework%3Fpage%3Dlast%26x-order%3Ddate%26x-showcontent%3Doff
    Through command line
    Check case 2 in this blog
    /people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
    or ref plsz go tru it,
    /people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
    Check this weblog on this from stefan:
    /people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework
    http://help.sap.com/saphelp_nw70/helpdata/en/84/2e3842cd38f83ae10000000a1550b0/frameset.htm
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    Zip or Unzip your Payload with the new PayloadZipBean module of the XI Adapter
    /people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework
    XI/PI: Command line sample functions -> go through case 2
    /people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
    Create encrypted ZIP files
    Thanks!!!

  • Save data in a file and email the file

    Dear all,
    I have 2 vi files:
    1. one vi file can store data into a file when it runs and stopped
    2. another vi can send a file out through email when it is run.
    Is it possible for me to run the first vi and stop after one hour (to store data into A file), then run the second vi file and stop (to send A file through email), and then run the first vi again immediately after running the second vi? This is because I need to send out my data saved hourly through email and get my 1st vi to continue running through out the day.
    Due to the file path for my first vi and the second vi are the same, I keep getting error as below when either 1 vi is not stopped.
    Error 5 occurred at Open/Create/Replace File in Write Spreadsheet String.vi->Write To Spreadsheet File (DBL).vi
    Please advice. Thanks.
    Kim

    Dear Ravens,
    I tried to kill (remove) the event structure from my earlier code, but as I run it, I get the same error again- error 5.
    I also tried to put time out value 200 at the timenode at the upper left of the event structure but the email part just never executed.
    I searched thru the forum and found a several examples on state machine as attached. I tried the first attachment for my program but obviously I used the wrong one as you adviced. As for the other state machine examples that I downloaded, I couldn't figure out how to apply them for my case correctly. Can you advcice how can I implement state machine to get the results tat I need?... Pls gv me some clearer hints? 
    Attachments:
    QueuedStateMachineWithEvents.vi ‏49 KB
    StandardStateMachine_2MOD.vi ‏19 KB
    JKI State machine.vi ‏75 KB

  • How to use cfdocument  create a PDF file and save the file in server?

    Hi,
    I want to use cfdocument to create a PDF file and save it in
    the server for other people to download,can you give me a idea how
    to do this.Thanks.
    <cfdocument format = "PDF" pagetype="A4"
    orientation="portrait">
    </cfdocument>
    Mark

    Hi
    <cfdocument filename="" format = "PDF" pagetype="A4"
    orientation="portrait">
    </cfdocument>
    Give the physical path to the filename. You have write
    permission for this folder to create a PDF file.

  • Read file and store the file into a string

    i want to read the file and copy it to a string.
    i wrote this code but don't know what to do next..
    please help me urgent.....
    File file_to_text = new File("c:\\wtgapp.xml");
    String wtgapp_string=new String();
    try
    BufferedInputStream stream = new BufferedInputStream(new FileInputStream(file_to_text));
    catch (FileNotFoundException file_error)
    JOptionPane.showMessageDialog(null, "FILE READ ERROR", "READ ERROR!",JOptionPane.INFORMATION_MESSAGE );
    System.exit(1);
    }

    BufferedReader reader = new BufferedReader(new FileReader(file_to_text));
    try
    while(reader.readLine() !=)
    wtgapp_string = wtgapp_string+ reader.readLine();
    System.out.println(wtgapp_string);
    i did this..
    but reader.readLine() != null
    didn't work.
    what shoud i write? to go to the end of file
    no it is 16.00pm in here i live in TURKIYE istanbul :)

  • Download a file and give the file name as default name while saving

    Hi folks
    I am facing a problem. I have jsp which fetchs the file name and it's location from the database.
    It can fetch many row's. Now i have provided a radio button, against each row, By clicking on it , the user selects the file to download.
    And clicks on download button, which call an action say "Download File".
    It's downloading the file successfully. But displaying the action name as default name while selecting the location to save the file on local machine.
    I want the file name which he opted to download, should get displayed as default name.

    Set it in the content disposition header.
    The downloadFile() snippet here might give some useful insights: http://balusc.xs4all.nl/srv/dev-jep-pdf.html

  • Need help for Flash quiz with score and timer

    Greetings, I need to urgently create a flash
    game with 10 questions, 3 answers per question. At the end of the
    quiz I need to get the time the quiz was completed for, what answers the player answered correctly and the time its completed into a database, + a couple of fields like name and phone that the user fills also needed to be added into db with the score and time. I need it by the end of tomorrow and I do realise i dont have the knowledge to make it, So if there is anyone that wishes to help or trade services I can give you back the favour by creating some html/css/web design content for you. Thanks in advance and please excuse me for my terrible english.

    download flash cs6 and use it to publish your ad or expand flash cc's publishing capabilites.  if you have a flash cc subscription you can download and use flash cs6 after logging into your cc acount.
    here's how to expand publishing capabilites of flash cc: http://forums.adobe.com/message/5511080#5511080#5511080

  • I need help for Arabic Typing in Pages and PhotoShop and how can I change the Typing Direction to Be from right to left

    Hi there
    Accualy I have 2 problems with Pages
    1- How can I get more Arabic Fonts with More Decorated style
    2- The typing in Arabic should be from right to left and in Pages it's Happining but the typin marker is not doing this so its hard to fix any mistakes in the middel of the paragraph.
           - how to change the alignment from left to right (Ctrl + Shift in MO Word) to do the hall text from right to left not only the paragraph Icon
    I think this will afect the other application Im using If some one help me with it.

    "Many" is an exageration, you can count R to L languages on one hand.
    Mostly they are used in countries which try not to pay for their software, and seem to have a pretty shoddy printing industry, so not much incentive for developers.
    However Arabic is a major language and Apple should fix the problem.
    As Tom suggests try Mellel, which is the best solution on the Mac.
    Adobe has ME versions of both Indesign and Photoshop, for which you pay extra. They mostly work well.
    MsWord for Windows (not the Mac) does reasonably well, but I have not tried its DTP features with Arabic so can't vouch for how solid they are in Word.
    Peter

  • Need help for two thing:: JFace/SWT and Drawing an updating graph! plz help

    Hey all,
    This is my first post on this forum and I was wondering if you guys can help me with two problems that im currently having and I would be really grateful.
    1. When ever i try to use the SWT/JFace tools and run it as a java app. I get this error:
    java.lang.NoClassDefFoundError: org/eclipse/core/runtime/IProgressMonitor
    Exception in thread "main"
    any suggestions??
    2. Now this is my main question:: How should I go about programming a graph that updates based on numbers in an array? Basically set of numbers in an array ( unsorted ), and as it is getting sorted I want a graph displaying how it is getting sorted. The graph is just a basic XY chart.
    Thank you.

        @n2medallas,
    Let's get your phone working right!
    You mentioned your getting a message that the phone is rooted. Where are you seeing this message? What is the current bilud and software version on your phone? Have you taken the phone into a VZW store to check the message you are seeing?
    JohnB_VZW
    Follow us on Twitter @VZWSupport

  • Needs help adding images to movie clips and referencing the frames

    i havent started with a blank, script made movie clip.
    I want to add frames from action script 2, and be able to
    reference/show the induividual frames for a video game and not a
    movie. I dont realy need animation, i just need certain frames to
    show, that i want to load load(from a non script made movie clip
    with one loaded frame(bitmap data).

    you can't add frames to a movieclip using actionscript. so,
    if that's what you're trying to do you'll need to find some other
    way to accomplish your goal.

Maybe you are looking for

  • Setting up wifi for ipad with an existing hard wired network

    Greets all. Got my aged mother in law an ipad so her bad eyes could read ebooks. Only way she can download new books is with a wifi connection. Trouble is, at her house My aged father in law had a hard wired dsl connection to the internet with Window

  • Glossary in a RoboHelp HTML .chm not showing content on Win7

    I created a RoboHelp HTML .chm with a Glossary using RoboHelp6. My users with Windows 7 computers are unable to install and register the HHActiveX.DLL file and see the Glossary content. They are using the suggested procedure for WinXp but it does not

  • How do u switch from US store to Canada store to buy and update apps?

    Trying to update apps on my phone, except it said I have to switch to Canada iTunes Store from US iTunes Store. So I go into my apple account to switch to Canadian store and try to update again with the same message coming up.  

  • HELP!  ipod will not reset

    I was listening to my ipod before i went to bed last night and everything was fine. When i unplugged it this morning and tried to play a song, the screen faded and the ipod shut down. I then plugged it in and it worked. When i unplugged it, it showed

  • Java Best Practices

    Hi All, can any one tell me what are all Java Best Practices or can you please refer site where we can find java best practices. pvmk