Generate Spool for a report

Hi,
I am asked to develop a program that will run a report with a variant and then return a spool number for the run.
I'm assuming this can be done in background? The program however needs to wait for the spool number.
Any ideas?
Thanks
Tyken

HI ,
Try this code, Hope it helps.
Without archiving
DATA: PARAMS LIKE PRI_PARAMS,
      DAYS(1)  TYPE N VALUE 2,
      COUNT(3) TYPE N VALUE 1,
      VALID    TYPE C.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
  EXPORTING
            DESTINATION           = 'LT50'
            COPIES                = COUNT
            LIST_NAME             = 'TEST'
            LIST_TEXT             = 'SUBMIT ... TO SAP-SPOOL'
            IMMEDIATELY           = space
            RELEASE               = 'X'
            NEW_LIST_ID           = 'X'
            EXPIRATION            = DAYS
            LINE_SIZE             = 79
            LINE_COUNT            = 23
            LAYOUT                = 'X_PAPER'
            SAP_COVER_PAGE        = 'X'
            COVER_PAGE            = 'X'
            RECEIVER              = 'SAP*'
            DEPARTMENT            = 'System'
            NO_DIALOG             = ' '
  IMPORTING OUT_PARAMETERS        = PARAMS
            VALID                 = VALID.
IF VALID <> SPACE.
  SUBMIT RSTEST00 TO SAP-SPOOL
    SPOOL PARAMETERS PARAMS
    WITHOUT SPOOL DYNPRO.
ENDIF.
Thanks & Regards,
Nagaraj Kalbavi

Similar Messages

  • Unable to generate spool for two tables in report output

    Hi,
    I created report with two custom containers displaying two tables in output. When I execute the report in background spool is created only for one table in top custom container.
    What should be done to generate spool for both the tables in two different custom containers.
    Thanks,
    Abhiram.

    Hi,
    Check the bellow link for your requirement.
    <<link removed>>
    Regards,
    Goutam Kolluru.
    Edited by: kishan P on Feb 2, 2012 1:50 PM

  • How can we stop generating spools for some batch jobs?

    HI guys,
    Is memory will be occupied in SAP  during spool generation from batch jobs ?
    If yes, to reduce occupied memory, we want to stop generating spools for few batch jobs. Please suggest me the way how we can acheive this.(Step details)
    Please help me.
    Thanks in Advance.
    Regards,
    Sahil

    Stopping the spool generation for background jobs will not help you to reduce the memory load.
    First check what is the total memory utilization and type of processes where the memory is being utilized more.
    EWA can give you better idea to get the above details.
    Spooling concept doesn't eat that much of memory what you are expecting.
    Regards,
    Nick Loy

  • Creation of Spool for a Report Output in background.

    Hi Gurus,
    I am working on a Report and my requirement is that a Spool should be Generated for the Report Output in background. Instead of generating the spool manually, I need it to be generated in background.
    Please let me know ASAP.
    Regards,
    Amit.

    Get print parameters using 'GET_PRINT_PARAMETERS'.
      DATA : rep LIKE pri_params-plist,
    w_title TYPE tsp01-rqtitle,
    mstr_print_parms LIKE pri_params.
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING destination           = 'LP01'
                  copies                = 1
                  list_name             = rep
                  list_text             = w_title
                  immediately           = 'X'
                  release               = 'X'
                  new_list_id           = 'X'
                  expiration            = 1
                  line_size             = 132
                  line_count            = 65
                  layout                = 'X_65_132'
                  sap_cover_page        = 'X'
                  cover_page            = ' '
                  receiver              = sy-uname
                  department            = 'System'
                  no_dialog             = 'X'
        IMPORTING out_parameters        =  mstr_print_parms
      valid = mc_valid.
    and then use submit statement-
      SUBMIT
      zp1012_ar_rep_vendstat
      TO SAP-SPOOL
      WITHOUT SPOOL DYNPRO
              SPOOL PARAMETERS mstr_print_parms
      WITH s_lifnr IN s_lifnr
      WITH p_bukrs eq p_bukrs
      WITH s_gjahr eq p_gjahr SIGN 'I'
      WITH s_monat BETWEEN p_per-low AND p_per-high SIGN 'I'
                       AND RETURN.
      COMMIT WORK.
    Regards,
    Aparna Gaikwad

  • Creating spool for ALV report in background

    Hi,
    Can we create a spool request if we run in background/forgorund? please help me..
    I am very much thankful for your quick responses.

    Yes we can create it. Execute the report in background using SM36 and then u can view the output using SM35 or the spool request number and tcode SP01.
    I hope it helps.
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • Not Generating Spool for my user id

    Initially when i run the transaction CO02 and printing the production order, spool was generating properly. so in next day due to some issues i changed the print program or adobe form then spool was not generating to my user id only, if i print with any other user id i am able to see the spool , so what is the problem for my user id, could any one help in this scenario.

    Hi,
    Adding to Ashwin's point there can be another possibility, go to tcode SU3 and in Defeaults tab check and compare the Spool control Section between your login and the other user login.
    Check if the check box 'Output immediatly' is selected or not.

  • Usage error while generating spool for adobe forms

    I need to create a function module which would be called from a BRF. The function module must generate an adobe form and sent to the spool.
    I get usage error at the call form function module level. could someone suggest if anything is missing in the below code.
    ""Local Interface:
    *" IMPORTING
    *" REFERENCE(I_FORM_NAME) TYPE FPNAME
    *" REFERENCE(I_BP_DETAILS) TYPE ZRP_STRU_RTRN_BP_DETAILS
    *" REFERENCE(I_AMT_DETAILS) TYPE ZRP_STRU_RTRN_AMT_DETAILS
    *" EXPORTING
    *" REFERENCE(E_RETURN) TYPE BAPIRET2_T
    DATA : gv_fm_name TYPE rs38l_fnam,
    ga_outputparams TYPE sfpoutputparams,
    gs_docparams TYPE sfpdocparams,
    le_result TYPE sfpjoboutput,
    gs_output TYPE fpformoutput,
    l_return TYPE bapiret2..
    Get the Form function module name
    CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
    EXPORTING
    i_name = i_form_name
    IMPORTING
    e_funcname = gv_fm_name
    E_INTERFACE_TYPE =
    Open Print Job
    ga_outputparams-device = 'PRINTER'.
    ga_outputparams-nodialog = 'X'.
    ga_outputparams-preview = space.
    ga_outputparams-dest = 'LP01'.
    CALL FUNCTION 'FP_JOB_OPEN'
    CHANGING
    ie_outputparams = ga_outputparams
    EXCEPTIONS
    cancel = 1
    usage_error = 2
    system_error = 3
    internal_error = 4
    OTHERS = 5.
    call the generated Function Module
    gs_docparams-langu = 'E'.
    gs_docparams-country = 'US'.
    CALL FUNCTION gv_fm_name "'/1BCDWB/SM00000014'
    EXPORTING
    /1bcdwb/docparams = gs_docparams
    is_bp_details = i_bp_details
    is_return_details = i_amt_details
    IMPORTING
    /1bcdwb/formoutput = gs_output
    EXCEPTIONS
    usage_error = 1
    system_error = 2
    internal_error = 3
    OTHERS = 4.
    IF sy-subrc EQ 0.
    Close spool job
    CALL FUNCTION 'FP_JOB_CLOSE'
    IMPORTING
    e_result = le_result
    EXCEPTIONS
    usage_error = 1
    system_error = 2
    internal_error = 3
    OTHERS = 4.
    ELSE.
    l_return-type = 'E'.
    l_return-message = 'Print Error'.
    APPEND l_return TO e_return.
    ENDIF.

    Suri , Have you solve this  please replly as i am facing such a problem

  • Generate  Spool in abap report

    Hello ,
    I created report that should run in background job. I am not sure how to create spool containing all sales orders and items that are
    selected in report.
    Please could some one explain creation of the spool.  Used  needs to see spool in sm37 when the job is in status finished.
    Thanks
    Chris

    Hi,
    did you check Post HOw to create Spool Request.
    it was the first hit i got in google as i searched "sap how to create spool"
    Please search befor writing new post
    regards
    Stefan Seeburger

  • Generated Query for Interactive Report

    Hi folks
    I am getting an error in an Interactive Report: "Column ambiguously defined".
    This cannot have been triggered by the columns selected to appear in the report. Where can I see the query generated by the report after all the user-defined edits on the original query?
    Regards
    CS

    Hi Chris,
    I'm not sure what version it became available, but in later versions you can enable debugging at the application level and then view the debugging information when running the application as a developer. This gives you information on the actual query issued by Apex.
    Andre

  • Unable to generate spool in certain t codes

    Dear All,
    I am unable to generate spool for cetain t codes like mctg. I am able to see the report complete in sm37, however unable to see the result in sp02, plz help?

    Hi,
    please have look at these Links:
    No Spool Request Generated: Analyzing a Spool Dump (SAP Library - SAP Printing Guide (BC-CCM-PRN))
    Spool is not generating.

  • New Tcodes for COPA Reports from KE31

    Hi All.
    I have created several report for COPA from KE31. Now i want to create seperate TCodes for each report. So please kindly guide me how can i generate TCode for these reports.
    I will be thankful.

    Hi,
    Get the generated name of ur program from ur tcode.
    Then goto se93
    give transaction code and click create
    select the second radio button(transaction code for reports)
    give short description and press enter
    after that give your program name
    and select the gui check boxes as required for html ,java,
    and save it
    you can use the transaction code
    REGARDS
    JAGADISH

  • Transaction code for COPA reports from KE31

    Hi All.
    I have create several report for COPA from KE31. Now i want to create seperate TCodes for each report. So please kindly guide me how can i generate TCode for these reports.
    I will be thankful.

    Ideally its best for an ABAP Developer to do this... You should be able to do this using SE93
    Enter the Program name SAPMKCEE, and Screen 5000.
    Cheers.

  • Generate spool req number for report output list

    Hi,
    How to generate spool request number for report output list while executing the report.Please provide if you have any sample code.
    Thanks and Regards,
    BSR.

    HI srinivas,
    welcome to sdn.
    Exporting the Contents of a Spool Request
    Use
    You want to export the content of a spool request in one of the following ways:
    ·        As a text file to the SAP GUI working directory
    ·        Unconverted or as a table, RTF, or HTML to a directory of your choice
    ·        As a PDF file to a directory of your choice
    Procedure
    Follow the procedure below:
    Exporting to the SAP GUI Working Directory
    If you are exporting large quantities of data, downloading the spool request as a text file to the SAP GUI working directory is a good solution.
    Choose Spool Request ® Forward® Export as Text.
    The entire text is stored in your SAP GUI working directory in ASCII format.
    A file of this type is named using the following pattern:
    .txt
    Example: ABC0000004327.txt
    You require appropriate authorization for this function from your administrator.
    Exporting Unconverted or as a table, RTF, or HTML to a Directory of Your Choice
    With this method of exporting a spool request, the content of the spool request is first displayed, and you then download the content in the format of your choice to a directory of your choice.
           1.      Select the spool request to be exported and choose  Display Contents.
           2.      In the case of SAPscript/Smart Forms documents, activate list display by choosing Goto.
           3.      Choose System ® List ® Save ® Local File.
           4.      Choose one of the available formats and confirm your choice.
           5.      Choose a directory and save the spool request.
    By default, only the first 10 pages of a spool request are saved in a file. You can increase the number of pages to be saved by choosing Goto ® Display Requests ® Settings and making the desired entries in the Display Area group box.
    Exporting as a PDF File
    You want to export the contents of a spool request as a PDF file to a directory of your choice, and print the file as required. The PDF file contains the print data in the format in which it would be output by the printer.
    The following procedure is irrelevant for the printing of PDF-based forms, since a PDF file is already returned with this method. See also Displaying and Printing PDF-Based Forms.
    You also require authorization from your administrator to run this report.
    The PDF file is generated as follows with report RSTXPDFT4:
           1.      Generate a spool request from the document to be printed.
           2.      In transaction SE38, start report rstxpdft4.
           3.      In the displayed window, enter the spool request number and the directory in which the PDF file is to be stored.
    Leave the Download PDF File option selected.
    Choose  Execute.
           4.      In the next window, you can confirm or change the path in which the file is be stored.
    Save your entries.
           5.      The system displays a log from which you can see whether the report was successfully performed.
    You can then open the file from the directory and print it as required.
    Restrictions for Exporting as a PDF File
    ·        The PDF conversion only supports true bar codes for Smart Forms, which were generated with the new bar code technology as of SAP NetWeaver 04. In all other cases, the bar code is only simulated.
    ·        PDF conversion, especially of ABAP lists, is slower and is therefore not suitable for mass printing. However, you can speed up the conversion to PDF using the FASTLISTCONV option in report RSTXPDF3.
    ·        The font selection for ABAP lists is predefined in the PDF converter and cannot be changed.
    For more information about constraints, see SAP Note 323736 in the SAP Service Marketplace
    see this links
    http://help.sap.com/saphelp_40b/helpdata/en/d9/4a98f351ea11d189570000e829fbbd/content.htm
    http://web.mit.edu/SAPR3/docs/webdocs/reports/rpRFprint.html
    regards
    shankar
    reward me if usefull

  • Smartforms: Appending Spool o/p(report)  to  PDF generated by SSF

    Dear Murugesh
    I have attached the code for Appending Spool o/p(report)  to  PDF generated by SSF below
      Please suggest as i will have 2 finish by this SAT.
    (Hint : Under 1 SOrdr there may be several line items==>
      The material with ref 2 every line-item either may be configurable(ZPL3) or nonconfigurable(ZA3C)) .
    *ENCLOSER TO PACKING LIST
    SELECT VBELN POSNR INTO CORRESPONDING FIELDS OF TABLE T_VBAP
                        FROM  VBAP
                        WHERE VBELN = SSORD.
    *For capturing the o/p pages from ZPL3 and consolidating into table
    *T_OTF to get single PDF
      LOOP AT T_VBAP INTO T_VBAP.
        ITNO = T_VBAP-POSNR.
      SELECT SINGLE * FROM ZPP_PLCMH WHERE VBELN = SSORD
                                     AND   POSNR = ITNO.
       IF SY-SUBRC EQ 0.
         SET PARAMETER  ID: 'AUN' FIELD SSORD ,
                            'APO' FIELD ITNO.
         CALL TRANSACTION 'ZPCE' AND SKIP FIRST SCREEN.
         IMPORT A = T_OTF2 FROM  MEMORY ID 'MEMID'.
         LOOP AT T_OTF2  INTO T_OTF2.
           APPEND T_OTF2 TO T_OTF.
         ENDLOOP.
         REFRESH T_OTF2.
       ELSE.
    *For capturing the o/p pages from ZA3C and Appending
    *at the end of the PDF file just created by the above code
        SELECT SINGLE * FROM ZPLH WHERE VBELN = SSORD
                                  AND   POSNR = ITNO.
         IF SY-SUBRC EQ 0.
           SET PARAMETER  ID: 'AUN' FIELD SSORD,
                            : 'APO' FIELD ITNO.
           CALL TRANSACTION 'ZPNE' AND SKIP FIRST SCREEN.
           IMPORT B = SPOOL_ID  FROM  MEMORY ID 'MEMID2'.
           CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
             EXPORTING
               SRC_SPOOLID                    = SPOOL_ID
               NO_DIALOG                      = ''
               DST_DEVICE                     = E_DEVTYPE
              PDF_DESTINATION                = 'LOHP'
            IMPORTING
               PDF_BYTECOUNT                  = BTC
             PDF_SPOOLID                    =
             LIST_PAGECOUNT                 =
             BTC_JOBNAME                    =
             BTC_JOBCOUNT                   =
            TABLES
               PDF                            = T_SPOOL_2_PDF
           EXCEPTIONS
             ERR_NO_ABAP_SPOOLJOB           = 1
             ERR_NO_SPOOLJOB                = 2
             ERR_NO_PERMISSION              = 3
             ERR_CONV_NOT_POSSIBLE          = 4
             ERR_BAD_DESTDEVICE             = 5
             USER_CANCELLED                 = 6
             ERR_SPOOLERROR                 = 7
             ERR_TEMSEERROR                 = 8
             ERR_BTCJOB_OPEN_FAILED         = 9
             ERR_BTCJOB_SUBMIT_FAILED       = 10
             ERR_BTCJOB_CLOSE_FAILED        = 11
             OTHERS                         = 12
           IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
           ENDIF.
    ELSE.
           TEXT02 = ITNO.
           MESSAGE I014(ZQOTBANK) WITH TEXT02.
       ENDIF.
    ENDIF.
    ENDLOOP.
    CALL FUNCTION 'CONVERT_OTF_2_PDF'
      EXPORTING
        USE_OTF_MC_CMD               = 'X'
      ARCHIVE_INDEX                =
    IMPORTING
        BIN_FILESIZE                 = BIN_FILESIZE
    TABLES
        OTF                          = T_OTF
        DOCTAB_ARCHIVE               = T_DOC
        LINES                        = T_LINES
    EXCEPTIONS
       ERR_CONV_NOT_POSSIBLE        = 1
       ERR_OTF_MC_NOENDMARKER       = 2
       OTHERS                       = 3.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        BIN_FILESIZE                    = BIN_FILESIZE
        FILENAME                        = 'C:\SD6.pdf'
        FILETYPE                        = 'BIN'
        APPEND                          = 'X'
      WRITE_FIELD_SEPARATOR           = ' '
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
      WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
    IMPORTING
        FILELENGTH                      = BIN_FILESIZE
      TABLES
        DATA_TAB                        = T_LINES
      FIELDNAMES                      =
    EXCEPTIONS
      FILE_WRITE_ERROR                = 1
      NO_BATCH                        = 2
      GUI_REFUSE_FILETRANSFER         = 3
      INVALID_TYPE                    = 4
      NO_AUTHORITY                    = 5
      UNKNOWN_ERROR                   = 6
      HEADER_NOT_ALLOWED              = 7
      SEPARATOR_NOT_ALLOWED           = 8
      FILESIZE_NOT_ALLOWED            = 9
      HEADER_TOO_LONG                 = 10
      DP_ERROR_CREATE                 = 11
      DP_ERROR_SEND                   = 12
      DP_ERROR_WRITE                  = 13
      UNKNOWN_DP_ERROR                = 14
      ACCESS_DENIED                   = 15
      DP_OUT_OF_MEMORY                = 16
      DISK_FULL                       = 17
      DP_TIMEOUT                      = 18
      FILE_NOT_FOUND                  = 19
      DATAPROVIDER_EXCEPTION          = 20
      CONTROL_FLUSH_ERROR             = 21
      OTHERS                          = 22
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Thanx
    Moni
    Message was edited by: md monirujjaman

    Hello,
    Can you explain the problem in detail plz.
    I do see that the logic which was proposed is implemented in code.
    please check at various places, in run time the following points:
    1. Spool ID exported into ABAP Memory.
    2. Contents of the Main OTF IntTab.
    3. Conversion of the Spool to PFD.Check whether SUBRC = 0. <b>Un-comment all the Exceptions in your FMs where-ever you make a call in your program.</b>
       If this conversion of Spool to PDF is successful, you can choose "Append" option from the popup.
    Hope this helps you. Or if you have any specific query let me know.
    Regards, Murugesh AS

  • Regarding running a report in background and generate spool

    Hi,
    I am developing a report [<b>REPORT1</b>].
    It is taking long to execute if data is more.
    Now i want to schedule this report in background and generate spool along with.
    So once i execute REPORT1 it should run in background & generate spool?
    Can anybody give inputs for the same!
    Thanks,
    Deep.

    Hi,
              to generate spool, use below code
    FORM create_spool .
    CONSTANTS : l_c_device(4) VALUE 'LOCL'.
    Create Spool Request
    NEW-PAGE PRINT ON
    LINE-SIZE 120
    DESTINATION l_c_device
    IMMEDIATELY ' '
    KEEP IN SPOOL 'X'
    NEW LIST IDENTIFICATION 'X'
    NO DIALOG.
    ENDFORM. " create_spool
    And after createing spool to get the spool number use below code,
    FORM obtain_spool_id .
    TYPES : BEGIN OF t_tsp01,
    rqident TYPE tsp01-rqident,
    rqowner TYPE tsp01-rqowner,
    END OF t_tsp01.
    DATA : it_tsp01 TYPE STANDARD TABLE OF t_tsp01,
    wa_tsp01 LIKE LINE OF it_tsp01.
    SELECT rqident
    rqowner
    FROM tsp01
    INTO TABLE it_tsp01
    WHERE rqowner = sy-uname.
    SORT it_tsp01 BY rqident DESCENDING.
    READ TABLE it_tsp01 INTO wa_tsp01 INDEX 1.
    IF sy-subrc = 0 .
    v_spool_nr = wa_tsp01-rqident.
    ENDIF.
    Capture the immediate spool created for this report
    v_spool_nr = sy-spono.
    ENDFORM. " obtain_spool_id
    <b>Reward points</b>
    Regards

Maybe you are looking for

  • [SOLVED] RT2870 drops connection after pacman update

    Since last pacman upgrade my USB wireless works for just a few seconds while used; while watching transfer speed I see at first full speed and then going slower and slower and in a few secs totally stopped, without being disconnected. I have to reboo

  • Font titles hard to read in new software update

    Is there a way to make the icon titles black instead of white?  I changed my setting to bold but the titles are still hard to read.

  • % in parameter form

    Hi, I want to display a report with % in a parameter. But i receive the message: REP-52006 FAILED TO DECODE THE SPECIFIED URL %1 In the Report Builder with paper layout, all works fine. But not with web layout. Everyone find the solution? Can someone

  • How to execute java programs in xcode

    I cannot execute Java program in XCode for Mountain Lion 10.8.2. Please help me how to execute a Java program.

  • What is an AirPrint Printer?

    What is an AirPrint Printer?