Programmatically reading and processing a spool file

Hello,
I would like to read and process a spool file generated by a background job in my ABAP program.
Can anyone advise if this is possible in SAP and if so, the best way to do this?
The only information I will have in my program is the job name and the date on which the job was run. I then need to find the corresponding spool and read this into an internal table.
Any ideas on how to do this would be appreciated.
Thanks,
Ruby

DATA : it_spool      TYPE STANDARD TABLE OF rsporq    .
*&      Form  find_spool_request_id
FORM find_spool_request_id.
  CALL FUNCTION 'RSPO_FIND_SPOOL_REQUESTS'
    EXPORTING
      allclients          = '320'
      datatype            = '*'
      has_output_requests = '*'
      rq0name             = nast-dsnam
      rq1name             = '*'
      rq2name             = '*'
      rqdest              = 'LOCL'
      rqowner             = sy-uname
    TABLES
      spoolrequests       = it_spool
    EXCEPTIONS
      no_permission       = 1
      OTHERS              = 2.
  IF sy-subrc <> 0.
    MESSAGE i000 DISPLAY LIKE 'E' WITH text-002.
    LEAVE LIST-PROCESSING.
  ENDIF.
ENDFORM.                    " find_spool_request_id
READ TABLE it_spool INTO wa_spool INDEX 1.
  v_spoolno = wa_spool-rqident.
*Get Spool request attributes
  SELECT SINGLE *
    FROM tsp01
    INTO tsp01
    WHERE rqident EQ v_spoolno.
Edited by: K.Manas on Jan 7, 2011 6:22 AM

Similar Messages

  • Reading and processing file(s) in a filesystem

    I'm fairly new to java programming and need help.
    I need to write code which will and read and process 1 or many files from a filesystem. If a file is found, read and process it. Then do same for all files found.
    Please help.
    Thanks in advance!

    Some classes of the package java.io will be used .
    http://java.sun.com/j2se/1.4.1/docs/api/java/io/package-tree.html
    (The java.io.File has the methods list() and listFiles(), of which the former returns an array String[] and the latter returns an array java.io.File[]. )

  • How to read and process oData service's ATOM XML output?

    Hi,
    I have a RFC created in system A which will call oData services of system B. I am calling this in a report using class methods,  cl_http_client. I will get the response in a ATOM XML format. Is there a standard way to read and process such ATOM XML in abap report without using further addons?
    Regards,
    Vinay

    You need to pass your filename String as a parameter to your functionality. It depends how you're currently set up though. We can't really see the top of your call so it's difficult to determine what you are calling and we don't really know from where you're calling either.
    If you're running standalone, then on launch of the application, you can feed in a file name as an argument that you can read in in String args[] in the main function and pass down to your XML splitter.
    If you're a method in a class that's part of a bigger pile, you can feed the file name as a String to the method from wherever you call from if it makes sense architecturally.
    You might also want to pass down a File object if that makes sense in your current code (i.e. if you're using your file for other purposes prior to the split, to avoid recreating closing/opening for no reason).
    Depends what you're trying to do. If I put together a piece like this, I would probably create an <yourcurrentrootpackage>.xml.splitter package.
    Also, on a side note, you're problem isn't really reading and writing XML in java, but seems more to be making your functionality generic so that any XML file can be split with your code.
    Regards
    JFM

  • Reading and writing from a file

    I am trying to read and write to a file so that I may store an array of string and a double in my application, but I have come upon a couple of problems; first when I put my file path into the path constant it will say that the file is not there ever though it is (so I have to force the issue and when the application asks for a file I have to browse and add the files), secondly when I run the program and it reads from the file it does not display the strings or doubles immediately instead I have to hit the submit button and than they finally come up, thirdly when I reset my values in the .txt files and put in my string and double and hit submit the array jumps one spot and starts at the index of 1 (array[1])  if anyone can help I would appreciate it a lot.
    here is my code:
    Harold Timmis
    [email protected]
    Orlando,Fl
    *Kudos always welcome
    Solved!
    Go to Solution.
    Attachments:
    testingfileIO.vi ‏30 KB
    double.txt ‏1 KB
    string.txt ‏1 KB

    Harold Timmis wrote:
    I am trying to read and write to a file so that I may store an array of string and a double in my application, but I have come upon a couple of problems; first when I put my file path into the path constant it will say that the file is not there ever though it is (so I have to force the issue and when the application asks for a file I have to browse and add the files),
    I don't see that behavior at all about forcing the issue.  Why are you using Not a Path constants?  Why not turn those constants into controls you put on your front panel?
    secondly when I run the program and it reads from the file it does not display the strings or doubles immediately instead I have to hit the submit button and than they finally come up,
    Put your array indicators before your event structure rather than after.  Think dataflow.  The code pauses at the event structure waiting for an even to fire.  Only when it does (such as hitting the submit button) does the data get written to the array indicators. 
    thirdly when I reset my values in the .txt files and put in my string and double and hit submit the array jumps one spot and starts at the index of 1 (array[1])  if anyone can help I would appreciate it a lot.
    I don't see this behavior either.  How come your double.txt file has names in it, and your string.txt file has doubles in it?

  • How can I hide page thumbnails navigation bar at the start up of Adobe Reader and open a pdf file?

    How can I hide page thumbnails navigation bar at the start up of Adobe Reader and open a pdf file? I could not find this option under Preferences tab? Thanks

    Hey there,
    Thanks for your reply. That works for the files I do what you said. However, for files I have not done that, It still shows the navigation bar. Any idea, how to do it default for any files?
    Thanks agian

  • Read and write a .CSV file contains cirillic characters issue

    Hi guys,
    I am a developer of a web application project which uses Oracle Fusion Middleware technologies. We use JDeveloper 11.1.1.4.0 as development IDE.
    I have a requirement to get a .csv file from WLS to application running machine. I used a downloadActinLinsener in front end .jspx in order to do that.
    I use OpenCSV library to read and write .csv files.
    Here is my code for read and write the .csv file,
    public void dwdFile(FacesContext facesContext, OutputStream out) {
    System.out.println("started");
    String [] nextLine;
    try {
    FileInputStream fstream1 = new FileInputStream("Downloads/filetoberead.CSV");
    DataInputStream in = new DataInputStream(fstream1);
    BufferedReader br = new BufferedReader(new InputStreamReader(in,"UTF-8"));
    CSVReader reader = new CSVReader(br,'\n');
    //CSVReader reader = new CSVReader(new FileReader("Downloads/ACTIVITY_LOG_22-JAN-13.csv"),'\n');
    List<String> list=new ArrayList();
    while ((nextLine = reader.readNext()) != null) {
    if(nextLine !=null){
    for(String s:nextLine){
    list.add(s);
    System.out.println("list size ; "+list.size());
    OutputStreamWriter w = new OutputStreamWriter(out, "UTF-8");
    CSVWriter writer = new CSVWriter(w, ',','\u0000');
    for(int i=0;i<list.size();i++){
    System.out.println("list items"+list.get(i));
    String[] entries = list.get(i).split(",");
    writer.writeNext(entries);
    //System.out.println("list items : "+list.get(i));
    writer.close();
    } catch (IOException e) {
    e.printStackTrace();
    say the filetoberead.CSV contains following data,
    0,22012013,E,E,ASG,,O-0000,O,0000,100
    1,111211,LI,0,TABO,B,M002500003593,,,К /БЭ60072715/,КАРТЕНБАЙ
    2,07,Balance Free,3
    1,383708,LI,0,BDSC,B,НЭ63041374,,,Т /НЭ63041374/,ОТГОНБААТАР
    2,07,Balance Free,161
    It reads and writes the numbers and english characters correct. All cirillic characters it prints "?" as follows,
    0,22012013,E,E,ASG,,O-0000,O,0000,100
    1,111211,LI,0,TABO,B,M002500003593,,,? /??60072715/,?????????
    2,07,Balance Free,3
    1,383708,LI,0,BDSC,B,??63041374,,,? /??63041374/,???????????
    2,07,Balance Free,161
    can somone please help me to resolve this problem?
    Regards !
    Sameera

    Are you sure that the input file (e.g. "Downloads/filetoberead.CSV") is in UTF-8 character set? You can also check it using some text editor having a view in hex mode. If each Cyrillic character in your input file occupies a single byte (instead of two), then the file is not in UTF-8. Most probably it is in Cyrillic for Windows (CP1251).
    If this is the case, you should modify the line
    BufferedReader br = new BufferedReader(new InputStreamReader(in,"UTF-8"));toBufferedReader br = new BufferedReader(new InputStreamReader(in,"windows-1251"));Dimitar

  • How to read and upload microsoft word file into database using forms9i

    Hi,
    How to read and upload microsoft word file into oracle database using forms9i. I appretiate if anyone can send me example or atleast a sujjetion.
    Thanks in advance
    Mahesh Ragineni

    The webutil package includes the ability up upload from the client to the database. See otn.oracle.com/products/forms and click on webutil for more details.
    Regards
    Grant Ronald
    Forms Product Management

  • Can I read and search a PDF file on my IPAD

    Can I read and search a PDF file on my IPAD??

    Several apps will allow you to work with PDFs. iBooks will handle them, but there have been a few issues reported about using it for that purpose. My guess is it depends on the size and complexity of the file. Adobe has a reader in teh app store (free). Goodreader is an option, and provides functionality for searches.

  • Read and Process Microsoft Word's Form

    Hi,
    Is there any WDP API or open source Java API to read and process Ms Word's Form, such as input field, pull down list etc.? I know of POI's HWPF, but it can only do some basic Word processing.
    Thanks.
    - julius

    JAWIN or NEWJAWIN!!!!
    newjawin consists of a java-com-codegenerator, which generates Java-Proxy-classes for COM-components like MS Word, Excel, ...
    1. download newjawin
    2,. start codegenerator (exe)
    3. choose COM-Component (f..e. winword.exe)
    4. press "generate"-Button
    5. Use Javaproxyclasses to access full MS Word
    Or you can use a commercial software like J-Integra that provides ready-to-use Java API to access Word. The benefit of using this tool  is that it exposes all the formatting tools Word provides like adding header, footer, page numbers, tables, etc. Also, if you require user interaction to manipulate the Word document, you can listen to Word events from your Java program and implement event handlers accordingly.

  • How to read spool file and get the spool file number

    Hey everyone.
    I created a program ztemp that is calling another program ztemp2 within, ztemp2 creates a spool file. Now the requirement is I need to write a code within ztemp to download that spool request and then convert it to the pdf file. I know I can use program rstxpdft4 to convert the spool file to the PDF but for this I need to give the spool number, so can you please tell me how can I get the spool number and then fetch it to the program rstxpdft4 .
    Thank you.
    Rhul goel

    Hi,
       Please check the [link|Convert ABAP List to PDF and display without downloading first; (Rich's reply) and get the spool similarly.
    Or read from table TSP01 to get the latest spool using sy-uname.
    Regards,
    Srini.

  • When will Elements 13 be updated to read and process Lummix FZ1000 RAW files?

    Elements 13 will not read and proceess RAW fileds from Lummix FZ 1000.  How soon can we expect an update to address this?

    Since pse 13 ships with camera raw 8.6 and that camera only requires camera raw 8.5, pse 13 should already open the Lumix DMC-FZ1000 files without any needed updates.
    Which operating system are you using?
    If in the pse 13 editor you go to Help>About Plug-in and click on the words Camera Raw, what version does it say?
    (on a mac Photoshop Elements Editor>About Plug-in)
    Have you tried Help>Updates from within the pse 13 editor to get camera raw 8.7.1 and pse 13.1 update?

  • Photoshop plugin/script to have it read and create a new file from an excel file?

    I do prepress and cover design for our book manufacturing company. I have made a tool that I input book specs into and it tells me the exact size of the photoshop document I need to create for an accurate book cover layout. It calculates total width, height, spine placement and spine width, bleeds, and even where to place the adobe guides in the document.
    I've always book toggling back and forth on my mac to get the measurements etc while I am designing a cover. What I want to know is if there is a way this can all be automated.
    I know photoshop supports scripting and plugins but I have not found anything remotely along the lines of what I am looking for. If I could get this process automated somehow my workflow and productivity would shoot through the roof!
    In short I am looking for a script/plugin for Adobe photoshop CS3 that can read from an excel sheet and create a new document based on the specifications in that excel file.
    Does anyone know if this is already out there? Or if it can be done? I would certainly invest in this.
    Thanks!

    xbytor answered to you already for javascript.
    It's something that is very easy to do using applescript (scripting excel through excel applescript dictionary, i have used it for a projet, found it usefull for the scenario i was working with, but it was incredibly slow.. same thing in Realbasic when driving application through automation.
    Depending on the number of record that need to be processed (if you dont have to fetch data in different tabs) it's often better to have a "pre-process" to save the excel file as a CSV and using any other solution to process the text file. Can make a HUGE difference in processing time...
    You will surely be able to find a professional to help you with this task if you willing to pay for custom developpement.
    If you have internal ressource or want to give it a try yourself, have a look at this:
    http://download.microsoft.com/download/3/A/7/3A70FB4B-0C6A-43E3-AAB7-AC9166B25632/Excel200 4AppleScriptRef.pdf
    ps: Beware! The dictionnary can have little difference depending of the excel version that you use.

  • Reading and printing from a file

    I have a method that reads temperatures from a data file and prints them to the monitor. I use a while loop to read each line of the file, but for some reason it doesnt skip the loop when readLine returns null. My question is how do i get the method to stop reading before it returns null...
       public static void printFile(String textFile) throws IOException
            String inputString="";
            BufferedReader inputDataFile=
            new BufferedReader(new FileReader(CENTIGRADE_DATA_FILE));
            while(inputString!=null)
                inputString= inputDataFile.readLine();
                System.out.println(inputString);
            inputDataFile.close();
       

    ok cool thanks for pointing that out guys i appreciate it...now i need to take those temps and convert them from Strings to doubles so they can be converted i tried this but im getting a NumberFormatException error...
    public static void buildReport() throws IOException
            double centigradeTemp=0.00;
            String inputTemp="";
            //Open centigrade temps to be read and converted
            BufferedReader inputDataFile=
            new BufferedReader(new FileReader(CENTIGRADE_DATA_FILE));
            //Open file writer to write report
            PrintWriter outFile=new PrintWriter(new FileWriter("TempReport.txt"));
            //While loop to read a temp, convert it, and write it in the report
            while((inputTemp= inputDataFile.readLine())!=null)
                centigradeTemp=Integer.parseInt(inputTemp);           
                outFile.println(fahrenheit(centigradeTemp));
            outFile.close();
        public static double fahrenheit(double centigrade)
            double fahrenTemp=0.00;
            fahrenTemp=(9/5)*centigrade + 32;
            return fahrenTemp;
     

  • How do I read and write to text files on a remote computer's hard drive

    I would like to read and write data to a text file on a remote computer. This is easily accomplished using one of the file functions such as "write characters to file.vi". If I am already connected to the remote computer, all I need to do is specify the path to the particular file and it will work fine.
    My problem is that I want to connect to the remote computer programatically within LabVIEW (I do not want to have to use the computer's OS to establish the connection. Is there a function that I can use to do this?
    Thomas D. Schaefer
    Wells Manufacturing Corp

    Yariv,
    You should really start a new thread with a new question like this, so that more people see it. Some people look primarily at threads that have no responses yet. Also, don't post the exact same question in multiple places. Or, if you must cross-post to some other forum, make sure to mention it in your question text.
    I'm happy to be a brick in your Western Wall, but I'm not sure what the main objective is here. Is the main problem really getting access to the "X bytes received in Y seconds at Z bytes/sec" string? Or is it accomplishing the file transfer? And what OS and LabVIEW version are you running?
    I think your problem is that you the LabVIEW System Exec command does not allow for the degree of interactivity that you need if you want to issue a sequence of commands to a command-line executable. However, under Windows XP (and, presumably, other Windows versions, though I can't check), you can tell the FTP executable to use commands from a textfile script by using the -s switch, and you can override the prompts during multiple file transfers with the -i switch:
    ftp -i -s:FILEPATH SERVERNAME
    If you issue a command in this format to System Exec, and make sure to create a file at FILEPATH with your command sequence (one per line), then you should at least accomplish the FTP actions. This won't give you the transfer details in the standard output, unfortunately. However, if you just want a general sense of how much was transferred and how quickly it happened, you can code that in LabVIEW by getting the resulting file sizes and using Tick Count before and after the System Exec call to see how long the transfer took.
    Hope that helps,
    John

  • Will PS express on Win.8.1 read and edit a PSD file?

    Hi, I am trying to find a reliable program to open PSD files for a business card i have had created. I may want to change the verbage around on the template. I searched the microsoft store for programs and PH express came up but did not describe if the program will read and edit PSD files.
    Can anyone provide some feed back on this?
    Or provide another option besides purchasing PS?
    Thank you.

    Updated: i installed PS express and shocker... it doesnt evan acknowledge the PSD file in my folder.
    so i read somewhere that i may be able to edit a PSD with an older version of photshop., but i am running Win. 8.1 ...
    can someone suggest a older more echonomical version of PS that will read and edit PSDs???
    need help... thank you.

Maybe you are looking for