Skip to Content
author's profile photo Former Member
Former Member

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 12:20 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 12:22 PM

    sri,

    i have same requirement with PO - print preview - everytime new spool request no.

    I took help of BASIS consultant. some setting is there from Basis side. so check with your Basis guy.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 12:26 PM

    dear friend

    try thins hope your probelm will solve.

    rewards are expecting.

    vivek

    FUNCTION zalvmail.

    *"----


    ""Local Interface:

    *" IMPORTING

    *" REFERENCE(P_MTITLE) TYPE STRING

    *" REFERENCE(P_REPORT) TYPE STRING

    *" TABLES

    *" I_REMAIL

    *" I_FINAL

    *" FCAT

    *"----


    *-> Check Input.

    IF i_remail[] IS INITIAL.

    MESSAGE s001(zmail).

    EXIT.

    ENDIF.

    IF i_final[] IS INITIAL.

    MESSAGE s002(zmail).

    EXIT.

    ENDIF.

    IF fcat[] IS INITIAL.

    MESSAGE s003(zmail).

    EXIT.

    ENDIF.

    IF p_mtitle IS INITIAL.

    MESSAGE s004(zmail).

    EXIT.

    ENDIF.

    IF p_report IS INITIAL.

    MESSAGE s005(zmail).

    EXIT.

    ENDIF.

    IF sy-batch EQ 'X'.

    *-> RUN ALV and Generate SPOOL.

    CALL FUNCTION 'ZALVSPOOL'

    TABLES

    i_final = i_final[]

    fcat = fcat[]

    CHANGING

    v_spool = v_spool.

    clear v_spoolid.

    MOVE v_spool TO v_spoolid.

    *-> Spool to PDF online

    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'

    EXPORTING

    src_spoolid = v_spoolid

    no_dialog = c_no

    dst_device = c_device

    IMPORTING

    pdf_bytecount = gd_bytecount

    TABLES

    pdf = it_pdf_output

    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.

    CHECK sy-subrc = 0.

    LOOP AT it_pdf_output.

    TRANSLATE it_pdf_output USING ' ~'.

    CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.

    ENDLOOP.

    TRANSLATE gd_buffer USING '~ '.

    DO.

    it_mess_att = gd_buffer.

    APPEND it_mess_att.

    SHIFT gd_buffer LEFT BY 255 PLACES.

    IF gd_buffer IS INITIAL.

    EXIT.

    ENDIF.

    ENDDO.

    DESCRIBE TABLE it_mess_att LINES gd_recsize.

    CHECK gd_recsize > 0.

    REFRESH it_mess_bod.

    *-> Default subject matter

    gd_subject = 'Subject'.

    gd_attachment_desc = 'Attachname'.

    *-> CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.

    it_mess_bod = p_report.

    APPEND it_mess_bod.

    *-> If no sender specified - default blank

    IF p_sender EQ space.

    gd_sender_type = space.

    ELSE.

    gd_sender_type = 'INT'.

    ENDIF.

    IF p_sender IS INITIAL.

    p_sender = sy-uname.

    ENDIF.

    *-> Send file by email as .PDF

    PERFORM send_file_as_email_attachment

    TABLES it_mess_bod

    it_mess_att

    i_remail

    USING p_mtitle

    'PDF'

    gd_attachment_name

    gd_attachment_desc

    p_sender

    gd_sender_type

    CHANGING gd_error

    gd_reciever.

    WAIT UP TO 3 SECONDS.

    ELSE.

    MESSAGE s013(ymess).

    EXIT.

    ENDIF.

    ENDFUNCTION.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.