Skip to Content
avatar image
Former Member

Without SPOOL Dynpro!

Hi friends!

We are trying to submit a SAP Standard program in FOREGROUND mode that gives the output in form of SAP SCRIPT but we are unable to generate a spool from it.

Whenever a SUBMIT statement is triggered a BOX is popped up and spoils the show.

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

no_dialog = 'X'

IMPORTING

valid = w_valid

out_parameters = e_params.

submit ZPROGRAM

to SAP-SPOOL without spool dynpro

spool parameters e_params

AND RETURN

USING SELECTION-SET '28951'.

Any thoughts, how do we generate a SPOOL number from this. As later we need to take this spool and convert into PDF.

Thanks.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jul 09, 2009 at 01:43 PM

    Hi ,

    see the sample code..

    
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
    EXPORTING
    no_dialog = 'X'
    IMPORTING
    valid = w_valid
    out_parameters = e_params.
    
    submit ZPROGRAM
    TO SAP-SPOOL SPOOL PARAMETERS e_PARAMS
                      WITHOUT SPOOL DYNPRO
    USING SELECTION-SET '28951'
    AND RETURN.
    
     
     
    * To fetch the spool number from TSP01 table
      SELECT rqident
             FROM tsp01
             INTO w_rqident
             UP TO 1 ROWS
             WHERE rq2name = e_params-plist.
      ENDSELECT.
    
    * Function Module to Convert Spool to PDF file
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
        EXPORTING
          src_spoolid     = w_rqident
          no_dialog       = 'X'
          dst_device      = 'LP01'
          pdf_destination = 'X'
        TABLES
          pdf             = t_pdf.
    
    
    * Now t_pdf table contains the PDF data...
    " now call the function module in backgrond task destination and push the PDF format dat to external system... 
     

    Prabhu

    Add comment
    10|10000 characters needed characters exceeded