Downloading spool requests

I have a requirement to download 1600 pages of spool request instead of printing it.
The issue we have is the timeout when we are downloading it from SP01.
Is there anyway i can download from SAP to a local file either in excel or as a PDF file.

Hi Vijay,
You can download the spool to file at SP01 -> Mark the spool request to download the click on Spool request -> Forward -> Save to local file
If the request time out you can increase parameter rdisp/max_wprun_time but this will require a system restart and probably once you have downloaded the file you'll need to return the parameter value to the previous one as it can potentially cause performance problems if left with large value.
regards
Juan
Please reward with points if helpful

Similar Messages

  • How to get Formatted Excel file when downloading spool request of a r paint

    I have scheduled a Report painter program  in background  & spool is generated .
    When I download the output in the Excel file its not in the proper format . We need to format the file file by adding  deleting blank Line in the report .
    Can it be possible when we Download the Report painter. Its come The generated Excel file should come in formatted way.
    Thanks

    kiro123 wrote:
    I have scheduled a Report painter program  in background  & spool is generated .
    >
    > When I download the output in the Excel file its not in the proper format . We need to format the file file by adding  deleting blank Line in the report .
    >
    > Can it be possible when we Download the Report painter. Its come The generated Excel file should come in formatted way.
    >
    >
    > Thanks
    Yes the report painter report especially in the hierarchial format will not make much sense when you download to excel. Until now I also have not seen any solution to this.

  • Spool request to Excel

    Hi Gurus,
    I want to download spool request into excel file. Is there any function module or program is available for that?
    Thanks,
    Amal

    Hi,
    There is a possibility of download the spool file as txt-file. .
    Use Tranx SP01 - select the spool entry -->"spool request --> forward  as text . You will find the file in your SAP work directory as .
    http://www.sap-img.com/abap/download-in-background-in-excel-format.htm
    or use fm RSPO_DOWNLOAD_SPOOLJOB.
    a®s
    Points are always welcome

  • Exporting a spool request

    Hello Techies,
         I have a spool request that I need to get out so we can distribute to JPMC and PWC for analysis.  The report is 90,000 pages.  Any ideas?  Someone had asked if we could do an FTP.
    Regards
    Thirupathioreddy

    Hi,
    Please check the below link
    http://help.sap.com/saphelp_autoid2007/helpdata/en/30/cc154219fce12ce10000000a1550b0/content.htm
    Also check the note
    Note 24834 - How to download spool requests?
    Thanks
    Debdeep

  • Spool request error in downloading 4000 pages

    Hi all
    I have a small doubt regarding the spool request.
    In my scenario I am running the transaction FBL3N
    in the background and I am getting an output of around 4000 pages.
    I need to download it but my Spool request contains only 10 pages
    by default.
    I changed it to 4000 but it gives the error of memoryoverflow.
    I could work by dividing the file into parts say 500 or 1000 but
    is there any way out so that I could download all the pages in
    one go.
    Hope you ppl have got me.
    Please respond asap.
    Thanks in advance.
    Sumit

    hi,
    you can divide data into different spools in following way:
    call function 'GET_PRINT_PARAMETERS'
          exporting
            destination    = 'LOCL'
            copies         = count
            list_name      = 'TEST'
            list_text      = 'Test for multiple spools'
            immediately    = ' '
            release        = 'X'
            new_list_id    = 'X'
            expiration     = days
            line_size      = 79
            line_count     = 23
            layout         = 'X_PAPER'
            sap_cover_page = 'X'
            receiver       = 'SAP*'
            department     = 'System'
            no_dialog      = 'X'
          importing
            out_parameters = params
            valid          = valid.
       IF VALID eq SPACE.
          new-page print on parameters params no dialog.
       endif.
    writes data into spool 1.
    new-page print off.
          new-page print on parameters params no dialog.
    write into spool 2.
    new-page print off.
    thanks,
    anupama.

  • Converting spool request into multiple pdf formated documents

    Hi Guys,
                 I am designing a report with several pages of output and running it in background.
    Is there a possibility to convert each page into an separate pdf format document ?
    If I use ALV report as output, if its more than page, do I face any issue with pdf conversion.
    Thanks

    Check the Following code, This might be helpful:
    form rstxpdft4 using filename.
    * Read spool job contents (OTF or ABAP list) and convert
    * to PDF, download PDF
      data: download  value 'X'.
      data: lv_filename like rlgrap-filename.
      lv_filename = filename.
      data otf like itcoo occurs 100 with header line.
      data cancel.
      data pdf like tline occurs 100 with header line.
      data doctab like docs occurs 1 with header line.
      data: numbytes type i,
            arc_idx like toa_dara,
            pdfspoolid like tsp01-rqident,
            jobname like tbtcjob-jobname,
            jobcount like tbtcjob-jobcount,
            is_otf.
      data: client like tst01-dclient,
            name like tst01-dname,
            objtype like rststype-type,
            type like rststype-type.
      select single * from tsp01 where rqident = gt_rq-rqident.
      if sy-subrc <> 0.
        write: / 'Spool request does not exist', gt_rq-rqident
                color col_negative.
        exit.
      endif.
      client = tsp01-rqclient.
      name   = tsp01-rqo1name.
      call function 'RSTS_GET_ATTRIBUTES'
           exporting
                authority     = 'SP01'
                client        = client
                name          = name
                part          = 1
           importing
                type          = type
                objtype       = objtype
           exceptions
                fb_error      = 1
                fb_rsts_other = 2
                no_object     = 3
                no_permission = 4.
      if objtype(3) = 'OTF'.
        is_otf = 'X'.
      else.
        is_otf = space.
      endif.
      if is_otf = 'X'.
        call function 'CONVERT_OTFSPOOLJOB_2_PDF'
             exporting
                  src_spoolid              = gt_rq-rqident
                  no_dialog                = ' '
             importing
                  pdf_bytecount            = numbytes
                  pdf_spoolid              = pdfspoolid
                  btc_jobname              = jobname
                  btc_jobcount             = jobcount
             tables
                  pdf                      = pdf  .
      else.
        call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
             exporting
                  src_spoolid              = gt_rq-rqident
                  no_dialog                = ' '
             importing
                  pdf_bytecount            = numbytes
                  pdf_spoolid              = pdfspoolid
                  btc_jobname              = jobname
                  btc_jobcount             = jobcount
             tables
                  pdf                      = pdf
    *************** download PDF file ***********
    v_filename = lv_filename.
    *  call function 'WS_DOWNLOAD'
    *       exporting
    *            bin_filesize            = numbytes
    *            filename                = lv_filename
    *            filetype                = 'BIN'
    *       tables
    *            data_tab                = pdf
    *       exceptions
    *            file_open_error         = 1
    *            file_write_error        = 2
    *            invalid_filesize        = 3
    *            invalid_type            = 4
    *            no_batch                = 5
    *            unknown_error           = 6
    *            invalid_table_width     = 7
    *            gui_refuse_filetransfer = 8
    *            customer_error          = 9
    *            others                  = 10.
    *  if sy-subrc <> 0.
    ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    **         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *  else.
    *    gv_count = gv_count + 1.
    *  endif.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        BIN_FILESIZE                    = numbytes
        FILENAME                        = v_filename
        FILETYPE                        = 'BIN'
    *   APPEND                          = ' '
    *   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'
    *   WK1_N_FORMAT                    = ' '
    *   WK1_N_SIZE                      = ' '
    *   WK1_T_FORMAT                    = ' '
    *   WK1_T_SIZE                      = ' '
    *   WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
    *   SHOW_TRANSFER_STATUS            = ABAP_TRUE
    * IMPORTING
    *   FILELENGTH                      =
      TABLES
        DATA_TAB                        = pdf .
    *   FIELDNAMES                      =
    Thanks.

  • Creating Spool request

    Hi friends,
    as per the old message I am trying to create a spool request which further will be downloaded to PDF format. I am facing a problem, as per message  when I try to do write in worte_perform I am receving ABAP dumps with Illegal page number
    anyidea why is it so .
    Thanks
    Lakhbir
    data: loc_dest like pri_params-pdest .
      clear : wf_listname , loc_dest , wf_listtext .
      move: 'List name' to   wf_listname .
      move: 'List header text' to   wf_listtext .
    select single spld into usr01-spld from usr01 where bname eq sy-uname .
      if sy-subrc eq 0 .
        move: usr01-spld to loc_dest .
      endif .
      call function 'GET_PRINT_PARAMETERS'
           exporting
                destination    = loc_dest
                copies         = wf_copies
                list_name      = wf_listname
                list_text      = wf_listtext
                immediately    = ' '
                release        = ' '
                new_list_id    = 'X'
                expiration     = wf_days
                line_size      = 200
                line_count     = 65
                layout         = 'X_65_200'
                sap_cover_page = 'X'
                receiver       = 'SAP*'
                department     = ''
                no_dialog      = 'X'
           importing
                out_parameters = wf_params
                valid          = wf_valid.
      if wf_valid <> space.
        new-page print on parameters wf_params no dialog.
        perform write_summary .
        new-page print off.
      endif .
    within the write_summary do a normal write operation.
    loop at <itab> .
    write:/
    endloop .

    We encountered a similar problem on 4.6C using a custom BAPI to save invoices to PDF for an internal web app.  We used a BDC/call transaction to access the output function from there.  This was only supposed to be a temporary workaround but has been working and we probably won't revisit until our next upgrade.  Hopefully this idea will help on your version, if so I am new here and need points!
    *Generate Transaction
      PERFORM dynpro USING :
                     'X' 'SAPMV60A'   '0101'   ,
                     ' ' 'VBRK-VBELN' v_invoice ,
                     ' ' 'BDC_OKCODE' '=DRCK'   .
      PERFORM dynpro USING :
                     'X' 'SAPLVMSG'   '0110'   ,
                     ' ' 'DNAST-KSCHL' v_kschl,
                     ' ' 'BDC_OKCODE' '=STAR'   .
      SELECT * UP TO 1 ROWS
        FROM nast WHERE objky = v_invoice
                  AND   vstat = '1'
                  AND   kappl = 'V3'
                  AND   kschl = v_kschl
                  AND   aktiv = space.
      ENDSELECT.
      IF sy-subrc = 0.
        PERFORM dynpro USING :
                       'X' 'SAPLSPO1'   '0300'   ,
                       ' ' 'BDC_OKCODE' '=YES'   .
      ENDIF.
      PERFORM dynpro USING :
                     'X' 'SAPLVMSG'   '0100'   ,
                     ' ' 'NAST-LDEST' 'TD06',
                     ' ' 'NAST-DIMME'  space,
                     ' ' 'NAST-TDOCOVER' space,
                     ' ' 'NAST-TDRECEIVER' space,
                     ' ' 'NAST-DELET' 'X',
                     ' ' 'BDC_OKCODE' '=STAR'   .
      CALL TRANSACTION   'VF03'
           USING         i_bdcdata
           MODE          v_mode
           UPDATE        'S'
           MESSAGES INTO i_bdcmsgcoll.

  • Converting spool request into PDF forms

    Hi gurus
    i am working on upgrade project from 4.6C to ECC 6.0. Business had the functionality developed in 4.6C to " Convert the spool request into PDF forms and can be downloaded into local PC".
    Moving to ECC 6.0, is there any standard functionality available in ECC 6.0 to "Convert spool request to PDF forms and download"?
    Any help towards this is appreciable.
    Thanks
    Aleem

    Hello,
    Yes. The program is RSTXPDFT4.
    Sourabh

  • Convert Spool Request in chinese Language to PDF

    kindly help me to solve the issues.
    is there any way to convert the spool request which is in chinese langauge,
    Requirement is to download SAP Script to PDF, where the PDF file should be in Chinese format.
    i used the following FM
    1)CONVERT_OTFSPOOLJOB_2_PDF
    2)CONVERT_ABAPSPOOLJOB_2_PDF
    in the spool the chinese format is visible, but in the PDF instead of the chinese language, v r getting Junk values.
    Thanks in Advance.
    Kesav

    Hi,
    Try executing the Program: 'RSTXPDFT4'.
    This Program will generate a PDF file when spool request is given in the selection screen.
    Regards,
    Ravi Kiran..

  • How to print the spool request with a given file name.

    Dear Experts;
    I used FM RSPO_OUTPUT_SPOOL_REQUEST to print spool request. And the device type is a local pdf printer. By default, the download file name will be the spool id. How can I change the download file name? Thanks!
    Convert 'CutePrinter' to qualify the format.
      CALL FUNCTION 'CONVERSION_EXIT_SPDEV_INPUT'
        EXPORTING
          input  = 'CutePrinter'
        IMPORTING
          output = lv_device.
    Downloading as pdf by printer
      CALL FUNCTION 'RSPO_OUTPUT_SPOOL_REQUEST'
        EXPORTING
          device                         = lv_device
          spool_request_id               = pa_spool
       EXCEPTIONS
         archive_dest_invalid           = 1
         archive_dest_not_found         = 2
         archive_dest_no_right          = 3
         cannot_archive                 = 4
         change_archdest_no_right       = 5
         change_copies_no_right         = 6
         change_dest_no_right           = 7
         change_devtype_no_right        = 8
         change_prio_no_right           = 9
         change_telenum_no_right        = 10
         change_title_no_right          = 11
         dest_invalid                   = 12
         dest_not_found                 = 13
         dest_no_right                  = 14
         internal_problem               = 15
         invalid_fax_attribute          = 16
         invalid_parameters             = 17
         non_owner_no_right             = 18
         no_layout                      = 19
         no_spool_request               = 20
         out_again_no_right             = 21
         spooler_problem                = 22
         OTHERS                         = 23

    SELECT SINGLE * FROM tsp01 into rq WHERE rqident = p_spool  .
    *   To get attributes of spool request
    CALL FUNCTION 'RSPO_GET_ATTRIBUTES_SPOOLJOB'
        EXPORTING
          rqident     = p_spool             "Spool Request Number
        IMPORTING
          rq          = rq                                 "Consists the Spool Document Type Details
        TABLES
          attributes = dummy
        EXCEPTIONS
          no_such_job = 1
          OTHERS      = 2.
      IF sy-subrc <> 0.
      ENDIF.
    *Convert spool request into PDF, dependent on document type
    IF rq-rqdoctype = 'OTF' OR rq-rqdoctype = 'SMART'.    "Doc Type is of Sap Script or Smart form
        CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
          EXPORTING
            src_spoolid              = p_spool               "Spool Request Number
            no_dialog                = 'X'
            pdf_destination          = 'X'
            no_background            = 'X'
          IMPORTING
            pdf_bytecount            = bin_size
            bin_file                 = pdf_xstring                  "This fm will convert the spool data into
         TABLES
            pdf                      = it_pdf   .                                                                       "PDF Format in this importing string
      ELSEIF rq-rqdoctype = 'LIST'.                 "Doc Type of List
    * Convert spool to PDF
        CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
          EXPORTING
            src_spoolid              = p_spool               "Spool Request Number
            no_dialog                = ' '
            dst_device               = 'LOCL'
            pdf_destination          = 'X'
            no_background            = 'X'
          IMPORTING
            pdf_bytecount            = bin_size
            bin_file                 = pdf_xstring                     "This fm will convert the spool data into
                                                                                  "PDF Format in this importing string
          TABLES
            pdf                      = it_pdf.
        ENDIF.
    *      Downloading file to p_file loation in PDF foramt
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
              bin_filesize            = bin_size
              filename                = w_filename     "Custom File name
              filetype                = 'BIN'
            TABLES
              data_tab                = it_pdf
    Prabhudas

  • Regd - Spool request

    Dear all,
    I have a requirement, to download the list output in PDF format. I am using the following code. This program converts the list output into spool request. But the problem is it is having number of pages is 0(We can see in SP01).
    Could you please let me know the reason why it is having the number of pages is 0. It shoud show number of pages is atleast 1(since its having some data).
    Please help me at the earliest.
    This is the code I am using.....
    TABLES :mara, makt.
    TYPES: BEGIN OF t_mara,
               matnr LIKE mara-matnr,
               meins LIKE mara-meins,
               matkl like mara-matkl,
               ersda LIKE mara-ersda,
               ername LIKE mara-ernam,
          END OF t_mara.
    DATA: i_mara TYPE TABLE OF t_mara,
          wa_mara LIKE LINE OF i_mara.
    DATA: v_dest LIKE tsp01-rqdest,
    v_handle LIKE sy-tabix,
    v_spool_id LIKE tsp01-rqident,
    v_rc TYPE c,
    v_errmessage(100) TYPE c,
    v_text(70) TYPE c,
    gd_spool_nr LIKE tsp01-rqident.
    START-OF-SELECTION.
      SELECT matnr FROM mara INTO TABLE i_mara
             UP TO 10 ROWS.
      CALL FUNCTION 'RSPO_OPEN_SPOOLREQUEST'
      EXPORTING
       dest = 'LOCL'
       layout = 'X_58_170'
       name =   ' LOCL'
       suffix1 =  'LOCL'
       suffix2 = 'Z_DOWNLOASUT'
       copies = '1'
       prio = '5'
      immediate_print = 'X'
    AUTO_DELETE =
    TITLELINE =
    RECEIVER =
    DIVISION =
    AUTHORITY =
    POSNAME =
    ACTTIME =
    LIFETIME = '8'
    APPEND =
    COVERPAGE =
    codepage = '1152'
    doctype = 'LIST'
      IMPORTING
      handle = v_handle
      spoolid = gd_spool_nr
      rc = v_rc
      errmessage = v_errmessage.
      LOOP AT i_mara INTO wa_mara.
        CONCATENATE wa_mara-matnr wa_mara-meins "i_mara-maktl
                    wa_mara-ersda wa_mara-ername INTO v_text SEPARATED BY space.
        CALL FUNCTION 'RSPO_WRITE_SPOOLREQUEST'
        EXPORTING
        handle = v_handle
        text = v_text
    LENGTH =
    CODEPAGE =
    TRUNCATE =
        IMPORTING
        rc = v_rc
        errmessage = v_errmessage
        EXCEPTIONS
        handle_not_valid = 1
        OTHERS = 2.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDLOOP.
      CALL FUNCTION 'RSPO_CLOSE_SPOOLREQUEST'
        EXPORTING
          handle           = v_handle
        IMPORTING
          rc               = v_rc
          errmessage       = v_errmessage
        EXCEPTIONS
          handle_not_valid = 1
          OTHERS           = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      COMMIT WORK.
      SUBMIT rstxpdft4 WITH spoolno = gd_spool_nr
                       WITH download = 'X'
                       VIA SELECTION-SCREEN
                       AND RETURN.
    Thanks And regards,
    Janardhan

    oK

  • HotNews correction for Y2010 spool request error available

    Dear gurus,
    I became aware of [SAP Note 1422843|https://service.sap.com/sap/support/notes/1422843] which has affected all my systems's spool request reorg jobs.
    It is currently release and patch level independent, so you will all be affected by it as well.
    You can verify this via entries in table SP01 field RQDELTIME = 2099*
    As a kernel patch might take a while (also to download, install, test, etc...) there is a workaround attached to the note until you get there.
    Cheers and best wishes for the new years until 2099..
    Julius

    > ...and the variant provided in this note 1422843 doesn't clean at all....
    Yes, it does not "clean" the spool requests out of the system - it corrects the deletion date symptom so that your reorg job will pick them up again. Dependent on your config, this might take a few days to become "cleaned", as they were before as well.
    Another option is to reorg the spool requests based on the creation date alone. This works fine for "smaller" systems and will protect the spool overflow and number range problem. It will however not correct the other less critical symptoms, so applying the kernel patch at some stage soon is recommended anyway.
    Cheers,
    Julius

  • Problem : Spool Request 0 does not exist ..

    Hi, I have a report to be converted to PDF format and then download the pdf as a local file. The code are as below.
    My problem is each time i execute my program, it will show me a message saying "Spool request 0 does not exist". Then i wil have to delete that particular code (the code below), activate the program and then copy and paste back the code (the code below from elsewhere) and activate it again. The code i copied is exactly the same, nothing is changed. But i dont want to practice this method everytime i execute my program.
    What are the cause to this problem and how should i solve it ? Please advise me..
    Thanks.
    Extracted Code ****
    *&      Form  print_pdf
    FORM print_pdf .
    STRUCTURES
      DATA: mstr_print_parms LIKE pri_params,
            mc_valid(1)      TYPE c,
            mi_bytecount     TYPE i,
            mi_length        TYPE i,
            mi_rqident       LIKE tsp01-rqident.
    INTERNAL TABLES
      DATA: mtab_pdf    LIKE tline OCCURS 0 WITH HEADER LINE,
            mc_filename LIKE rlgrap-filename.
      CONCATENATE 'c:\EEOReport-' sy-datum '_' sy-uzeit '.pdf' INTO mc_filename.
    Setup the Print Parmaters
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          destination    = space
          copies         = '1'
          list_name      = space
          list_text      = space
          immediately    = space
          release        = space
          new_list_id    = 'X'
          expiration     = '1'
          line_size      = 132
          line_count     = 65
          layout         = 'X_65_132'
          sap_cover_page = 'X'
          receiver       = 'SAP*'
          department     = ''
          no_dialog      = 'X'
        IMPORTING
          out_parameters = mstr_print_parms
          valid          = mc_valid.
      IF mc_valid <> space.
        NEW-PAGE PRINT ON PARAMETERS mstr_print_parms NO DIALOG.
        NEW-PAGE PRINT OFF.
      ENDIF .
    Make sure that a printer destination has been set up
    If this is not done the PDF function module ABENDS
      IF mstr_print_parms-pdest = space.
        mstr_print_parms-pdest = 'LOCL'.
      ENDIF.
    Explicitly set line width, and output format so that
    the PDF conversion comes out OK
      mstr_print_parms-linsz = 132.
      mstr_print_parms-paart = 'X_65_132'
    Find out what the spool number is that was just created
      PERFORM get_spool_number USING sy-repid
                 sy-uname
        CHANGING mi_rqident.
    Convert Spool to PDF
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
        EXPORTING
          src_spoolid              = mi_rqident
          no_dialog                = space
          dst_device               = mstr_print_parms-pdest
        IMPORTING
          pdf_bytecount            = mi_bytecount
        TABLES
          pdf                      = mtab_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.
      CALL FUNCTION 'DOWNLOAD'
        EXPORTING
          bin_filesize = mi_bytecount
          filename     = mc_filename
          filetype     = 'BIN'
        IMPORTING
          act_filename = mc_filename
        TABLES
          data_tab     = mtab_pdf.
    ENDFORM.                    " print_pdf
    *&      Form  get_spool_number
    FORM get_spool_number  USING    P_SY_REPID
                                    P_SY_UNAME
                           CHANGING P_MI_RQIDENT.
    DATA: lc_rq2name LIKE tsp01-rq2name.
      SELECT * FROM tsp01 WHERE  rq2name = lc_rq2name
      ORDER BY rqcretime DESCENDING.
        P_MI_RQIDENT = tsp01-rqident.
        EXIT.
      ENDSELECT.
      IF sy-subrc NE 0.
        CLEAR P_MI_RQIDENT.
      ENDIF.
    ENDFORM.                    " get_spool_number

    Hi.. i've added this line
      submit (sy-repid) to sap-spool without spool dynpro
                                             spool PARAMETERS mstr_print_parms
                                             and return.
    added before
    *-- Find out what the spool number is that was just created
      perform get_spool_number using sy-repid
                 sy-uname
    It will keep going back to my selection-screen unless i click the back button. when i click on the back button it will only convert the pdf file and it can be converted succesfully. Is there any way where i can modify the code so that it wont return to the selection-screen again and again when i click one execute ??
    Please assist... i need this urgently.. thanks

  • PO spool request

    hi experts,
    We faced PO printout problem during our Go Live. We have implemented SAP with new Plant/Company.
    For all PO forms in existing company are printing fine, but for this new company, we are trying to print PO but it only goes with the spool request no.
    Next problem, all PO is saving under 1 spool request no. so when you open the Spool request, all PO store in 1 spool.
    can any tell me, what is this problem came from? set-up or from smartforms?
    thanks in advance.
    regards,
    Maia

    Hi,
    Spool Request- As per my knowledge u require spool request no to download the PO in Acrobat format. In messages only we do the settings
    Goto messages- communication method- specify logical destination -tick print immediately- in SAP cover page select X Print and go to further data select despatch time - 4 send immediately save ur PO and and come out and go back to the PO and again click messages- go prcessing log u will get spool request no.
    Check the above settings that u have made properly ornot.
    ok

  • Splitting the Spool Request for Form Printing

    Hello,
    I have a requirement where I need to print data for 1500 employees (1 Page per employee) which makes 1500 pages per spool request. Now, there is a change in the printer due to which the printer only accepts only 300 pages in the buffer. So, after printing 300 pages, it stops. Is there any way I can split the spool request and generate 5 spool requests (1 request for every 300 pages) so that all the pages are printed at once? Please let me know.
    Regards,
    Venkata Phani Prasad Konduri

    i have created a program using which you can create multiple pdf from a single spool number
    first in the code below i have taken a spool number which has 2 pages in it.
    second you must use the FM : RSPO_RETURN_SPOOLJOB  in the program to get the content of the spool .  while to perform analysis on how to build logic to split the spool otf/pdf user the FM RSPO_DISPLAY_SPOOLJOB, here by passing the spool number you will get the content in display mode and then based on the keyword you will build logic for e.g in my case i have to perform segregation based on material number so it can be used to decide how many pages are reserved by a specific material number.
    another important point to kept in mind is that otf begins with "//"  and a page ends with "EP" and last page ends with  "//" along with "EP". It can be used to remove the number of lines to keep specific pages .
    program layout as with proper documentation has been provided.
    REPORT  zdk_spool_split.
    * DATA DECLARATION.
    TYPES : tbuf LIKE tline OCCURS 1.
    FIELD-SYMBOLS: <buf> TYPE tbuf.
    FIELD-SYMBOLS : <lit_otf> TYPE ANY TABLE.
    DATA : lit_otf TYPE STANDARD TABLE OF itcoo.
    DATA : objcont LIKE soli  OCCURS 0 WITH HEADER LINE.
    DATA : format(5) TYPE c, dummy TYPE i.
    DATA : buffer_pdf TYPE STANDARD TABLE OF tline.
    DATA : p_file LIKE rlgrap-filename VALUE 'C:\temp\file1.pdf'. "#EC NOTEXT
    DATA : numbytes TYPE i VALUE 255.
    DATA : cancel.
    DATA : otfcmd LIKE itcoo VALUE '//'.
    DATA : pdfcnv_archive_index LIKE toa_dara.
    DATA : bin_file TYPE xstring,
            pdf_username TYPE c.
    * GET THE SPOOL NUMBER FROM THE USER.
    PARAMETERS : p_sid TYPE tsp01-rqident OBLIGATORY.
    * GET THE CONTENT OF THE SPOOL NUMBER
    CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
       EXPORTING
         rqident              = p_sid
       TABLES
         buffer               = objcont
       EXCEPTIONS
         no_such_job          = 1
         job_contains_no_data = 2
         selection_empty      = 3
         no_permission        = 4
         can_not_access       = 5
         read_error           = 6
         type_no_match        = 7
         OTHERS               = 8.
    IF sy-subrc <> 0.
       MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    * INCORPORATE YOUR LOGIC TO DELETE LINES WHICH ARE NOT REQUIRED.
    * IN MY CASE I HAVE REMOVED LINES FROM 351 TO 715 TO REMOVE THE SECOND PAGE FROM MY SPOOL
    * MY OBJCONT AFTER DELTED BEGINS WITH "//" AND ENDS WITH "EP" AND "//"
    DELETE objcont[] FROM 351 TO 715.
    * IT ONLY CONTAINS ONE PAGE OUT OF 2 PAGES FROM THE SPOOL NUMBER I HAVE PROVIDED.
    * CONVERT OTF TO PDF
    lit_otf = objcont[]. " GET THE OTF IN CORRECT OTF FORMAT
    ASSIGN buffer_pdf TO <buf>.
    format = 'PDF'. " CHOOSE THE CORRECT FORMAT IE PDF MUST FOR CONVERSION
    CALL FUNCTION 'CONVERT_OTF'
       EXPORTING
         format                = format
       IMPORTING
         bin_filesize          = dummy
       TABLES
         otf                   = lit_otf
         lines                 = <buf>
       EXCEPTIONS
         err_max_linewidth     = 1
         err_format            = 2
         err_conv_not_possible = 3
         OTHERS                = 4.
    IF sy-subrc IS NOT INITIAL.
       MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    * GET THE NUMBYTES OF THE PDF CONTENT OBTAINED AFTER THE CONVERSION
    * CORRECT NUMBYTE IS VERY IMPORTANT OTHERWISE IT WILL NOT GENERATE
    * PDF IN CORRECT FORMAT.
    PERFORM convert_otf2pdf_end(rstxcpdf) TABLES <buf>
                                           USING otfcmd
                                                 numbytes
                                                 pdfcnv_archive_index
                                                 bin_file
                                                 pdf_username.
    * NOW DOWNLOAD THE PDF TO VIEW IN ACTUAL PDF AT DESIRED PATH
    PERFORM download_w_ext(rstxpdft) TABLES <buf>
                                      USING p_file
                                            '.pdf'
                                            'BIN'
                                            numbytes
                                            cancel.

Maybe you are looking for