Skip to Content
0
Jun 15, 2009 at 04:28 PM

How to retrieve a spool id

183 Views

Hi I generated a spool id by a submit but I wanted to retrieve it because I have to convert the report in pdf. The function 'CONVERT_ABAPSPOOLJOB_2_PDF' requires the spoolid.

Anybody has a solution please?

* Generate spool-id.

  SUBMIT rkaep000
    WITH P_TCODE = 'KSB1'
    WITH SELECTION-TABLE i_tab
     TO SAP-SPOOL
*       SPOOL PARAMETERS print_parameters
*       ARCHIVE PARAMETERS archi_parameters
*       WITHOUT SPOOL DYNPRO
     AND RETURN.

CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
      EXPORTING
        src_spoolid   = spoolid
        no_dialog     = 'X'
      IMPORTING
        pdf_bytecount = l_pdf_fsize
      TABLES
        pdf           = l_pdf_table
      EXCEPTIONS
        OTHERS        = 0.
    IF SY-SUBRC EQ 0.
    ENDIF.

Regards,

Mohamed.