Output of spool command?

Where will the output of the "spool filename.out" command go if I do not supply a full path name? If I'm executing my PL/SQL script in iSQL, it goes into the directory I was in when I started up iSQL. When I'm using SQL Developer, it never shows up anywhere I've looked. I see the output in "script output" window below the editor, but I can't find "filename.out" anywhere.

It should go in the default script path if you have not specified where it should go. check prefs > Database > Worksheet for details

Similar Messages

  • Preserve a single space at the end of line using spool command

    Hi,
    Can you please help me to write the result of an sql query into a file with the last column of the row ending with a single space?
    For example:
    COL1DATA|COL2DATA|COL3DATA<space1>
    As mentioned in the example the col3 value in the file should end with a single space. And there should not be any delimiters at the end of the row.
    I tried with set trimspool on/off. But, it didn't work. When I say trimspool on - it is trimming all the trailing spaces.
    When I say trimspool off - it is retaining all the trailing spaces to the size of the line.
    But, I do not wish to modify the file through shell commands once it is written thru spool. I mean I do not wish to append spaces to the end of a line using shell script or any other method.
    I do not wish to use other methods like UTL_FILE also.
    Please help me how to do it using spool command?
    Thank you.
    Ramana

    My requirement is that all the trailing spaces should be truncated except the last one in the row.Why?
    As you have discovered a single column in sqlplus, is always a fixed length regardless of the size of the data, if the length of the data varies the output is padded to the maximum or line size with spaces. The trim and trimpsool commands are there to remove all the spaces from the end of a line if there are any. There are no commands to trim all the spaces except one, or even to trim all the spaces except two, or three even.
    If you want such custom processing you should post process the file in the OS using sed, awk or perl or something designed for such things.

  • Spool command in SQL Developer 3.1

    Hi,
    I am using sqldeveloper-3.1.05.97 .
    There are few scripts that I need to run on a EBS sandbox to generate txt files for a analysis tool input .
    The script is meant to be run with SQL * Plus but I am getiing a TNS listener error due to which I want to use SQL Developer.
    The Spool command is able to create file in local directory but the oputput is not the query result but the query itself. Please help if anything is wrong in the syntax below:
    ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY';
    SET NEWPAGE 0
    SET SPACE 0
    SET PAGESIZE 0
    SET ECHO OFF
    SET FEEDBACK OFF
    SET COLSEP |
    SET MARKUP HTML OFF
    SET LINESIZE 600
    SPOOL FND_USER.txt
    SELECT USER_ID, USER_NAME, LAST_UPDATE_DATE, LAST_UPDATED_BY, CREATION_DATE, CREATED_BY, START_DATE, END_DATE, DESCRIPTION, LAST_LOGON_DATE, PASSWORD_DATE, PASSWORD_ACCESSES_LEFT, PASSWORD_LIFESPAN_ACCESSES, PASSWORD_LIFESPAN_DAYS, EMPLOYEE_ID, CUSTOMER_ID, SUPPLIER_ID
    FROM APPS.FND_USER;
    SPOOL OFF

    Hi Partha,
    It seems the line "SET PAGESIZE 0" is suppressing all output in SQL Developer, and not just "all headings, page breaks, titles, the initial blank line, and other formatting information" as documented for SQL*Plus. Keep in mind that SQL Developer does not yet provide full support for all SQL*Plus formatting commands. For example, without SET PAGESIZE 0, the script output tab shows these messages:
    line 2: SQLPLUS Command Skipped: set NEWPAGE 0
    line 3: SQLPLUS Command Skipped: set SPACE 0
    line 8: SQLPLUS Command Skipped: set MARKUP HTML OFF
    I will log a bug for this.
    Regards,
    Gary
    SQL Developer Team

  • SQL Developer 1.5.5   SPOOL command

    Hello,
    I have a question to SQLplus command SPOOL
    Testsetting:
    SQL Developer 1.5.5_5969
    Oracle 10g Release 10.2.0.3.0
    The output from SPOOL in the log file is only a subset from what I get in the Script Output Panel.
    I don't see the SQL Error Message and the number of rows selected or updated. See the scenario below.
    Does anybody know, how I can get the whole output to the log file?
    Testcase: Start ScriptRunner (F5)
    =================================
    SET ECHO ON
    SPOOL C:\tmp\test.log
    SET SERVEROUTPUT ON
    SET FEEDBACK ON
    WHENEVER SQLERROR EXIT ROLLBACK
    select lcode from test_table;
    update test_table set lcode = NULL where 1=2;
    update test_table set lcode == NULL where 1=2;
    SET SPOOL OFF
    EXIT
    A.) Output from ScriptRunner (F5) at Script Output Panel:
    =========================================================
    SET ECHO ON
    SPOOL C:\tmp\test.log
    SET SERVEROUTPUT ON
    SET FEEDBACK ON
    WHENEVER SQLERROR EXIT ROLLBACK
    select lcode from test_table
    LCODE
    GL
    GL
    SK
    3 rows selected
    update test_table set lcode = NULL where 1=2
    0 rows updated
    update test_table set lcode == NULL where 1=2
    Error starting at line 3 in command:
    update test_table set lcode == NULL where 1=2
    Error at Command Line:3 Column:28
    Error report:
    SQL Error: ORA-00936: Ausdruck fehlt
    00936. 00000 - "missing expression"
    *Cause:   
    *Action:
    Rollback
    B.) Output from SPOOL in log file:
    ==================================
    SET SERVEROUTPUT ON
    SET FEEDBACK ON
    WHENEVER SQLERROR EXIT ROLLBACK
    select lcode from test_table
    LCODE
    GL
    GL
    SK
    update test_table set lcode = NULL where 1=2
    update test_table set lcode == NULL where 1=2
    Thanks
    Markus

    The connections are in
    C:\Documents and Settings\Application Data\SQL Developer/system1.5.0.53.38/o.jdeveloper.db.connection.11.1.1.0.22.49.35/connections.xml
    If you want to back them up, you can just right-click export from the tree.
    -kris

  • Spool command  in form builder

    hello;
    we try this command in sql plus(ok)
    spool c:\sample.dat
    select * from employee;
    spool off
    my problem is this possible to include spool command in program units using
    form builder.
    PROCEDURE mis$atm_dat_creation IS
    BEGIN
    SPOOL C:\ETPS\PAYROLL.DAT;
    SELECT '2146260011460000000'||company_name
    ||atm_account_number,
    DECODE(LENGTH(salary),14,LPAD(salary,15,'0')
    ,13,LPAD(salary,15,'00')
    ,12,LPAD(salary,15,'000')
    ,11,LPAD(salary,15,'0000')
    ,10,LPAD(salary,15,'00000')
    ,9,LPAD(salary,15,'000000')
    ,8,LPAD(salary,15,'0000000')
    ,7,LPAD(salary,15,'00000000')
    ,6,LPAD(salary,15,'000000000')
    ,5,LPAD(salary,15,'0000000000')
    ,4,LPAD(salary,15,'00000000000')
    ,3,LPAD(salary,15,'000000000000')
    ,2,LPAD(salary,15,'0000000000000')
    ,1,LPAD(salary,15,'00000000000000')
    ,salary)||
    '900003'||TO_CHAR(effectivity_date,'MMDDYYYY')
    FROM atm_transactions;
    SPOOL OFF;
    SELECT SUM(SALARY)
    FROM atm_transactions;
    END;
    pls helps....

    SPOOL is not a SQL statement or a PL/SQL command, it is a SQL*Plus environment command.
    Using Oracle Developer, the most efficient way to produce file output is through Oracle Reports, not Forms.
    Best!

  • Trying to use spool command

    heyyall,
    am trying to use the spool command to save a file from an output but i get the message:
    SPOOL save.lis
    SP2-0606: Cannot create SPOOL file save.lis
    am using sql-plus 10.2.0.1.0
    ?

    No its not an advanced setup , its just i logged into database using putty, easy to use.
    In Command Promt we use dir command to list the directories , in the same way in database ls list the subfolders/subdirectories and files present in the current directory.
    I think you are using local database only right?.
    Then go to command prompt (i.e., go to run and type cmd)
    And from there i had done this scenario, please view it so that you can understand clearly
    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.
    C:\Users\Balaji K>dir
    Volume in drive C has no label.
    Volume Serial Number is 0282-81BD
    Directory of C:\Users\Balaji K
    03/27/2011 12:04 AM <DIR> .
    03/27/2011 12:04 AM <DIR> ..
    03/26/2011 03:04 AM <DIR> .VirtualBox
    02/25/2011 04:57 PM <DIR> Contacts
    03/26/2011 06:07 PM <DIR> Desktop
    03/25/2011 06:00 PM <DIR> Documents
    03/25/2011 08:44 PM <DIR> Downloads
    03/04/2011 06:06 PM <DIR> Favorites
    02/25/2011 04:57 PM <DIR> Links
    02/25/2011 04:57 PM <DIR> Music
    02/25/2011 04:57 PM <DIR> Pictures
    02/25/2011 04:57 PM <DIR> Saved Games
    02/25/2011 04:57 PM <DIR> Searches
    03/26/2011 10:04 PM <DIR> Tracing
    02/25/2011 04:57 PM <DIR> Videos
    02/25/2011 06:07 PM <DIR> VirtualBox VMs
    0 File(s) 0 bytes
    16 Dir(s) 43,067,936,768 bytes free
    C:\Users\Balaji K>sqlplus sys as sysdba
    SQL*Plus: Release 10.2.0.1.0 - Production on Sun Mar 27 00:04:44 2011
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Enter password:
    Connected to:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    SQL> spool example.txt
    SQL> desc dba_users;
    Name Null? Type
    USERNAME NOT NULL VARCHAR2(30)
    USER_ID NOT NULL NUMBER
    PASSWORD VARCHAR2(30)
    ACCOUNT_STATUS NOT NULL VARCHAR2(32)
    LOCK_DATE DATE
    EXPIRY_DATE DATE
    DEFAULT_TABLESPACE NOT NULL VARCHAR2(30)
    TEMPORARY_TABLESPACE NOT NULL VARCHAR2(30)
    CREATED NOT NULL DATE
    PROFILE NOT NULL VARCHAR2(30)
    INITIAL_RSRC_CONSUMER_GROUP VARCHAR2(30)
    EXTERNAL_NAME VARCHAR2(4000)
    SQL> select username from dba_users;
    USERNAME
    SYS
    SYSTEM
    ANONYMOUS
    MDSYS
    OUTLN
    DIP
    TSMSYS
    FLOWS_FILES
    CTXSYS
    DBSNMP
    FLOWS_020100
    USERNAME
    XDB
    HR
    13 rows selected.
    SQL> exit
    Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Produ
    ction
    C:\Users\Balaji K>dir
    Volume in drive C has no label.
    Volume Serial Number is 0282-81BD
    Directory of C:\Users\Balaji K
    03/27/2011 12:04 AM <DIR> .
    03/27/2011 12:04 AM <DIR> ..
    03/26/2011 03:04 AM <DIR> .VirtualBox
    02/25/2011 04:57 PM <DIR> Contacts
    03/26/2011 06:07 PM <DIR> Desktop
    03/25/2011 06:00 PM <DIR> Documents
    03/25/2011 08:44 PM <DIR> Downloads
    03/27/2011 12:05 AM 2,398 example.txt
    03/04/2011 06:06 PM <DIR> Favorites
    02/25/2011 04:57 PM <DIR> Links
    02/25/2011 04:57 PM <DIR> Music
    02/25/2011 04:57 PM <DIR> Pictures
    02/25/2011 04:57 PM <DIR> Saved Games
    02/25/2011 04:57 PM <DIR> Searches
    03/26/2011 10:04 PM <DIR> Tracing
    02/25/2011 04:57 PM <DIR> Videos
    02/25/2011 06:07 PM <DIR> VirtualBox VMs
    1 File(s) 2,398 bytes
    16 Dir(s) 43,067,940,864 bytes free
    C:\Users\Balaji K>
    See now you can see the example.txt which we had spooled. Now if go with
    C:\Users\Balaji K>edit example.txt command you can see that all the data is spooled into it.
    And instead of exiting sqlplus, if you want to continue some other operations , then you can give spool off command .
    sql> spool off.
    Hope this helps you :)
    Thanks,
    Balaji K.
    Edited by: balaji k on Mar 26, 2011 11:42 AM
    Edited by: balaji k on Mar 26, 2011 11:43 AM

  • Spool Command not found error

    Dear friends,
    I am trying to get the list of active and inactive sessions for some users and created a script for this but getting some error message.
    Could you please check why I am getting this error while running from the putty. The same sql command I run from sql developer and get the output with no errors.
    Script:
    set pagesize 0
    set feedback off
    set echo off
    sqlplus '/as sysdba'
    spool kill_session_list.sql;
    select 'ALTER SYSTEM KILL SESSION '''||sid||','||serial#||''';'
    from v$session
    where type!='BACKGROUND'
    and username in('RO_USER','KHALIED','INFAREP','DAC','DMUSER_PROD','LAND_PROD','STAGE_PROD','BIUSER_PROD','OLAPDW','DWRO');
    spool off;
    exit
    Error msg:
    ./kill_session_generate.sql: line 5: spool: command not found
    ./kill_session_generate.sql: line 6: syntax error near unexpected token `||'
    ./kill_session_generate.sql: line 6: `select 'ALTER SYSTEM KILL SESSION '''||sid||','||serial#||''';''
    Thanks.

    877938 wrote:
    Dear friends,
    I am trying to get the list of active and inactive sessions for some users and created a script for this but getting some error message.
    ./kill_session_generate.sql: line 5: spool: command not found
    ./kill_session_generate.sql: line 6: syntax error near unexpected token `||'
    ./kill_session_generate.sql: line 6: `select 'ALTER SYSTEM KILL SESSION '''||sid||','||serial#||''';''Odd.
    Look at the script kill_session_generate.sql very carefully, especially the lines before and after the SPOOL command as well as the spool command itself. Consider deleting and retyping the line with the SPOOL command in case invisible special characters are causing problems
    Good luck!

  • How to generate text file using spool command

    How can I use a SPOOL command with DBMS_OUTPUT.PUT_LINE with PL/SQL to produce text file on oracle client machine.

    You could try using a REF CURSOR as an alternative. Bare bones example listed below:
    --- SQL Script
    SET FEEDBACK OFF
    COLUMN first_name FORMAT A25
    COLUMN last_name FORMAT A25
    VARIABLE example_data REFCURSOR
    BEGIN
    example.get_data(:example_data);
    END;
    SPOOL example_data.txt
    PRINT example_data
    SPOOL OFF
    -----Output in example_data.txt
    FIRST_NAME LAST_NAME
    First Name 1 Last Name 1
    First Name 2 Last Name 2
    First Name 3 Last Name 3
    First Name 4 Last Name 4
    First Name 5 Last Name 5
    First Name 6 Last Name 6
    First Name 7 Last Name 7
    First Name 8 Last Name 8
    First Name 9 Last Name 9
    First Name 10 Last Name 10
    -----Example package used in SQL Script
    CREATE OR REPLACE PACKAGE example
    IS
    TYPE result_set IS REF CURSOR;
    PROCEDURE get_data
    p_result_set OUT result_set
    END;
    SHOW ERRORS
    CREATE OR REPLACE PACKAGE BODY example
    IS
    PROCEDURE get_data
    p_result_set OUT result_set
    IS
    BEGIN
    -- replace this with your query
    OPEN p_result_set FOR
    WITH fake_data AS (
    SELECT
    'First Name ' || level first_name,
    'Last Name ' || level last_name
    FROM DUAL
    CONNECT BY LEVEL <= 10
    SELECT *
    FROM fake_data
    END;
    END;
    SHOW ERRORS
    SPOOL OFF

  • How to send the ALV GRID output to spool by using the print button in std t

    How to send the ALV GRID output to spool by using the print button in standard tool bar.
    We have created a button in the va02 transaction.  If user click on the button the new screen will be display on that screen we are populating the alv grid output using the oops concept.  But i am unable to send the output to spool using the print button in the standard tool bar.
    I am able to display the Print parameter dialog box but i am not able to send it to spool.
    Kindly help.
    Thanks In Advance.
    G.V.Ramana

    Hi Shaik,
    There is not properties button in my print screen.
    MODULE user_command_0900 INPUT.
        WHEN 'EXCEL'.
          PERFORM excel_download.                              
        WHEN 'PRI'.
          PERFORM print_output.
    form Print_output.
    CALL FUNCTION 'RSPO_LIST_LAYOUT_FITS'
               EXPORTING
                    columns        = 80
                    device         = 'ANY '
                    lines          = 65
                    maxpenality    = 1999
               TABLES
                    layouts        = lt_layouts1
               EXCEPTIONS
                    unknown_device = 1
                    OTHERS         = 2.
          IF sy-subrc = 0.
            LOOP AT lt_layouts1.
              IF lt_layouts1-penality < 1000        AND
                 lt_layouts1-penality < l_min_penality.
                l_layout       = lt_layouts1-layout.
                l_min_penality = lt_layouts1-penality.
              ENDIF.
            ENDLOOP.
            IF NOT l_layout IS INITIAL.
              CALL FUNCTION 'GET_PRINT_PARAMETERS'
                   EXPORTING
                        mode                   = 'CURRENT'
                        line_size              = 80             "#EC *
                new_list_id            = l_new_list_id
                        no_dialog              = l_no_dialog
                        layout                 = l_layout
                   IMPORTING
                        out_archive_parameters = rs_arc_params
                        out_parameters         = rs_pri_params
                        valid                  = l_valid
                   EXCEPTIONS
                        archive_info_not_found = 1
                        invalid_print_params   = 2
                        invalid_archive_params = 3
                        OTHERS                 = 4.
              IF sy-subrc NE 0.                                 " INS SLIN
              ENDIF.                                            " INS SLIN
              IF rs_pri_params-linsz LT 80 OR
                 rs_pri_params-linsz LT gt_stack-s_lprint-width.
                gt_stack-print_line_break = 'X'.
              ELSE.
                CLEAR gt_stack-print_line_break.
              ENDIF.
              IF l_valid NE 'X'.
                rs_pri_params = ls_pri_params_sav.
                rs_arc_params = ls_arc_params_sav.
              ENDIF.
            ENDIF.
          ENDIF.
    endform.                    " Print_output
        CALL METHOD gv_cost_tot_alv_grand->set_table_for_first_display
                EXPORTING
                   is_layout         = gs_layout_cost_tot_grand
                CHANGING
                   it_fieldcatalog   = gt_fcat_cost_tot_grand[]
                   it_outtab         = gt_cost_tot_grand[].
    Please check my code

  • Spool Command with dbms_metadata.GET_DDL function

    Hi All,
    My requirement is before applying a patch on the Database Schema, I need to take a backup of the db objects DDL script, so that incase if I want to rollback I can use it. what I am trying to use is the dbms_metadata.GET_DDL function to get the DDL script and with the help of spool command store that in a text file.
    The problem I am encountering is the whole script runs without an error but whne I check the spool file for certain big packages the DDL script is not fully exported. The below is the script that I make use of to generate the DDL script.
    set heading off
    set feedback off
    set echo off
    set term off
    set newpage none
    set space 0
    set trimout on
    set TRIMSPOOL ON
    column c1 format a4000
    set long 99999
    set lines 1000
    exec DBMS_METADATA.SET_TRANSFORM_PARAM (DBMS_METADATA.SESSION_TRANSFORM, 'PRETTY', true);
    spool c:\Rollback.sql
    select dbms_metadata.GET_DDL('FUNCTION',u.object_name) || '/' c1
    from user_objects u
    where object_type = 'FUNCTION'
    and object_name in ('FN_CALCMASTERDATA_AGE','FUNC_ASSIGNBENEFITSNONFLEX','FUNC_CHECKNEWEMPLOYEE');
    select dbms_metadata.GET_DDL('PACKAGE_SPEC',u.object_name) || '/' c1
    from user_objects u
    where object_type = 'PACKAGE'
    and object_name in('PKGT_BEN_YEAR_DETL','PKGT_BENS_TEST');
    select dbms_metadata.GET_DDL('PACKAGE_BODY',u.object_name) || '/' c1
    from user_objects u
    where object_type = 'PACKAGE'
    and object_name in ('PKGT_BEN_YEAR_DETL','PKGT_BENS_TEST','PKGT_FLEX_INITIALIZATION','PKGT_EMP');
    spool off
    Note: Database Oracle 10 g,
    Client Machine Windows XP from where the script is ran.
    Is there any limitation in amount of data that can be spooled? or is there is any better way to accomplish this task, please help.
    Thanks
    Saami

    set long longer ;-)
    set long 1000000 longchunksize 1000000 linesize 32000 pagesize 0

  • Problem with output string to command

    hey i have no idea why this aint working
    its a simple output string to command.
    what it is supposed to do is make a new directory given by the input string
    e.g. mkdir /home/luke/dep
    thanks for the help
    //methods input save files
         saveFile = JOptionPane.showInputDialog("Save Files To : ");
         //method command for saving files
         //Stream to write file
         FileOutputStream fout;          
         try { Process myProcess = Runtime.getRuntime().exec("mkdir" + saveFile );
          InputStreamReader myIStreamReader = new InputStreamReader(myProcess.getInputStream());
          fout = new FileOutputStream ("file.txt");
          while ((ch = myIStreamReader.read()) != -1) { new PrintStream(fout).print((char)ch); } }
              catch (IOException anIOException) { System.out.println(anIOException); }

    What you fail to understand is that "aint working" and "Problem with output string to command" tells us absolutely squat about what your problem is. This is the same as saying to the doctor "I'm sick" and expecting him to cure you. As mentioned by Enceph you need to provide details. Do you get error messages? If so post the entire error and indicate the line of code it occurs on. Do you get incorrect output? Then post what output you get, what output you expect. The more effort you put into your question the more effort others will put in their replies. So until you can manage to execute a little common sense then the only responses you will get will be flames. Now is your tiny little brain able to comprehend that?

  • How to maintain the report output in Spool

    Hi All,
    I have a requirement to display a normal report and also send the same report output to spool simultaneously while executing in foreground. How can this be done? Any kind of help is welcome.
    Regards,
    Bansi

    Hi,
    try creating your own spool request.
    Sample
    FORM maak_aparte_spool .
      DATA: l_layout       LIKE tsp01-rqpaper,
            l_doctype      LIKE tsp01-rqdoctype,
            l_name         TYPE tsp01-rq0name,
            l_length       TYPE i,
            l_pri_params   TYPE pri_params,
            l_spool_handle TYPE sy-tabix,
            lv_lines       TYPE i,
            l_line_length  TYPE i.
      l_doctype = 'LIST'.
      l_layout = 'X_PAPER'.
      l_name = l_pri_params-plist.
    ** Open Spool
      CALL FUNCTION 'RSPO_SR_OPEN'
        EXPORTING
          dest             = 'PDUM'
          layout           = l_layout
          name             = l_name
          immediate_print  = l_pri_params-primm
          titleline        = 'this'
          receiver         = l_pri_params-prrec
          division         = l_pri_params-prabt
          authority        = l_pri_params-prber
          doctype          = l_doctype
        IMPORTING
          handle           = l_spool_handle
          spoolid          = gv_spool_nr
        EXCEPTIONS
          device_missing   = 1
          name_twice       = 2
          no_such_device   = 3
          operation_failed = 4
          OTHERS           = 5.
    ** Schrijven naar spool
      LOOP AT gt_spool INTO gs_spool.
        lv_lines = lv_lines + 1.
        l_line_length = 255.
        CALL FUNCTION 'RSPO_SR_WRITE'
          EXPORTING
            handle = l_spool_handle
            text   = gs_spool
            length = l_line_length.
        IF lv_lines EQ '65'.
          CALL FUNCTION 'RSPO_SR_PAGE_BREAK'
            EXPORTING
              handle           = l_spool_handle
            EXCEPTIONS
              handle_not_valid = 1
              operation_failed = 2
              OTHERS           = 3.
          CLEAR: lv_lines.
        ENDIF.
      ENDLOOP.
    * Zorg ervoor dat er op het einde zoiezo een page break zit
    * dit ivm met het openen van de PDF
      CALL FUNCTION 'RSPO_SR_PAGE_BREAK'
        EXPORTING
          handle           = l_spool_handle
        EXCEPTIONS
          handle_not_valid = 1
          operation_failed = 2
          OTHERS           = 3.
    ** Spool sl
      CALL FUNCTION 'RSPO_SR_CLOSE'
        EXPORTING
          handle = l_spool_handle.
    ENDFORM.                    " MAAK_APARTE_SPOOL
    Best regards,
    John

  • ALV output to spool

    hi,
    i am having a issue when running ALV output to background. If user gives his email address i am able to send output as attachment to email.but incase he doesnt give then i have to send it to SPOOL.
    I am able to send the output to spool but when i execute the report in background i get a POPUP where i have to input device and then a other dialog box which gives formatting information I.E. X_65_132' and when i click OK then spool is getting generated.
    i tried ways to suppress this popup but couldnt find the way..can anyone suggest me a way to suppress this popup?
    i used get_print_parameters function module but the program doesn't go till that place and immediately before executing start-of-selection i am getting this popup.
    regards

    REPORT  ytest.
    INCLUDE yest_top.
    AT SELECTION-SCREEN OUTPUT.
      PERFORM selectionscreen_modify.
      PERFORM validate_selscreen .
    START-OF-SELECTION.
    PERFORM fetch_data.
        PERFORM build_dyntable.
    Inside the build_dyntable perform i am calling alv_list_display to dislay output.
    when i debug the code after executing report from seleciton screen in background execution immediately after AT SLECTION SCREEN OUTPUT i get the popup.
    let me know incase anything to be done to suppress the popup.
    thanks

  • Send Report output to spool

    Hi,
         i developed one report.My Requirement is i have to send that report output to spool and aswell as i have to display the output in the output screen.At present i am using GET_PRINT_PARAMETERS function module.
    Regards,
    Kiran Kumar.G.A

    Hi
    FORM GET_PRINTER_PARAMETERS .
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
         DESTINATION            = GV_SPLD
         COPIES                 = 1
          LIST_NAME              = 'TEST'
         LIST_TEXT              = 'Test NEW-PAGE PRINT ON'
         IMMEDIATELY            = ' '
         RELEASE                = ' '
         NEW_LIST_ID            = 'X'
         EXPIRATION             = DAYS
         LINE_SIZE              = 255
         LINE_COUNT             = 65
         LAYOUT                 = 'Y_PAPER'
         SAP_COVER_PAGE         = 'X'
         RECEIVER               = 'SAP*'
         DEPARTMENT             = 'System'
         SAP_OBJECT             = 'RS'
         AR_OBJECT              = 'TEST'
         ARCHIVE_ID             = 'XX'
         ARCHIVE_INFO           = 'III'
         ARCHIVE_TEXT           = 'Description'
          NO_DIALOG              = 'X'
        IMPORTING
          OUT_PARAMETERS         = PARAMS
          OUT_ARCHIVE_PARAMETERS = ARPARAMS
          VALID                  = VALID.
      NEW-PAGE PRINT ON
      NEW-SECTION
      PARAMETERS PARAMS
      ARCHIVE PARAMETERS ARPARAMS
      NO DIALOG.
      LOOP AT GT_FINAL_ABAP_TABLE INTO GS_FINAL_ABAP_TABLE.
    *To print each ABAP spool in new page
        IF GS_FINAL_ABAP_TABLE = 'NEW-PAGE'.
          NEW-PAGE.
        ENDIF.
        IF GS_FINAL_ABAP_TABLE <> 'NEW-PAGE'.
          WRITE / GS_FINAL_ABAP_TABLE.
        ENDIF.
      ENDLOOP .
      NEW-PAGE PRINT OFF .
      SELECT  RQIDENT
              RQCLIENT
              RQO1NAME
      INTO    TABLE GT_TSP01
      FROM    TSP01
      WHERE   RQOWNER = SY-UNAME
      AND     RQ2NAME = 'TEST' .
      IF SY-SUBRC = 0 .
        SORT GT_TSP01 BY RQIDENT DESCENDING.
        READ TABLE GT_TSP01 INTO GS_TSP01 INDEX 1.
        FREE GT_TSP01.
      ENDIF
    Reward if useful
    narendra

  • How to Use SPOOL Command with Bind Variables

    For the Following SPOOL I want the GEN_DATE to be entered by the User at the time of execution of the SQL Script. Is it possible in SPOOL Command.
    set colsep , -- separate columns with a comma
    set pagesize 1000 -- get rid of disturbing ---- between pages
    set heading on -- Print column heading
    set trimspool on -- remove trailing blanks. eliminating the spaces up to eol
    set linesize 700 -- line size should be the sum of the column widths
    spool spool_results.csv
    SELECT *
    FROM GUI_SITE_JOURNAL
    WHERE GENDATE_ BETWEEN '2012-11-01 00:00:00:00000' AND '2012-11-02 00:00:00:00000'* ORDER BY GEN_DATE;
    spool off;
    The reason is to give the ability to user so that he can enter any range without modifying the code of the script.
    Can Any one help me please.
    Edited by: user10903866 on Feb 18, 2013 7:44 PM

    Hi,
    user10903866 wrote:
    For the Following SPOOL I want the GEN_DATE to be entered by the User at the time of execution of the SQL Script. Is it possible in SPOOL Command.Do you want the user input in the SPOOL command, or do you want it in the query?
    set colsep , -- separate columns with a comma
    set pagesize 1000 -- get rid of disturbing ---- between pages
    set heading on -- Print column heading
    set trimspool on -- remove trailing blanks. eliminating the spaces up to eol
    set linesize 700 -- line size should be the sum of the column widths
    spool spool_results.csv
    SELECT *
    FROM GUI_SITE_JOURNAL
    WHERE GENDATE_ BETWEEN '2012-11-01 00:00:00:00000' AND '2012-11-02 00:00:00:00000'* ORDER BY GEN_DATE;What is the data type oif gen_date?
    If it's a string, that's a big mistake. Information about dates belongs in DATE columns.
    If it's a DATE, then don't try to compare it to strings, such as '2012-11-01 00:00:00:00000' .
    spool off;
    The reason is to give the ability to user so that he can enter any range without modifying the code of the script.
    Can Any one help me please.One way to do that is with substitution variables:
    SET     VERIFY  OFF
    ACCEPT  start_gen_date     PROMPT "Starting date (e.g., 2013-02-18 23:00:00.00000): "
    ACCEPT  end_gen_date     PROMPT "Ending date   (e.g., 2013-02-18 23:59:59.99999): "
    SPOOL  spool_results.csv
    SELECT    *
    FROM        gui_site_journal
    WHERE        gen_date  BETWEEN '&start_gen_date'
                    AND     '&end_gen_date'
    ORDER BY  gen_date;
    SPOOL  OFFThere are security considerations. Substitution variables give devious users the power to issue any SQL command, such as DROP TABLE. Users that have SQL*Plus access already have that power, anyway.

Maybe you are looking for