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

Doubt regarding spool

Hi ABAPers,

I want to create multiple spool outputs programatically, How do i do that??

Requirement: I am looping at an internal table to display its contents. Everytime the material number field changes there should be a separate spool output created.....

As far as i have searched the NEW-PAGE PRINT ON statement creates a separate spool but i dont want to print the contents of the spool but want to email that contents as an attachment... I need ideas as to how i can create separate spools

Any advice....

Thanks & Regards,

Prakash

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 10:56 AM

    1st create the spool, convert it to pdf and then u can send it as a mail attachment

    use that spool to convert it to PDF and then download it

    CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'

    EXPORTING

    RQIDENT = GS_OTF_SPOOLS-RQIDENT

    TABLES

    BUFFER = GT_TEMP_TABLE

    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.

    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 'CONVERT_OTF_2_PDF'

    EXPORTING

    USE_OTF_MC_CMD = 'X'

    IMPORTING

    BIN_FILESIZE = SIZE

    TABLES

    OTF = GT_OTF_TABLE

    DOCTAB_ARCHIVE = DOC

    LINES = GT_PDF

    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.

    U can also use the standard pgm RSTXPDFT4

    Award points

    Narendra

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi narendra,

      I think u didnt get my doubt... My doubt was how to create the spool..

      For example: Lets say i have the following set of write statements

      LOOP AT i_tab into wa_tab.

      AT NEW matnr.

      WRITE:/ wa_tab-matnr.

      WRITE:/ wa_tab-maktx.

      .

      .

      .

      .

      ENDAT.

      ENDLOOP.

      My doubt is how do i program such that each time it loops there is a separate spool created??

      Is there a statement for that??

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 10:59 AM

    at change of material no

    u need to close the form using close_form FM

    and need to open the form using open_form FM

    Madhavi

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi madhavi,

      Does the 2 function modules just create a spool output without doing any kind of printing or asking for any sort of printing parameters???

      Also can you throw light on wat JOB_OPEN & JOB_CLOSE does??? Is it anything similar??

      Thanks & Regards,

      Prakash

      Edited by: Prakash K on Jan 30, 2008 12:23 PM

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.