Skip to Content
0
Jun 15, 2009 at 02:17 PM

Retrieve the spool ID

30 Views

HI GUru's

I have some problem to retrieve my spool id. After did my 'Submit' I pass my parameter and no spool id is generated. Does anybody could help me please?

"Select the Cost Centers Responsible
  LOOP AT i_cntrllng_rsp INTO wa_cntrllng_rsp.
    SELECT  * FROM  csks APPENDING TABLE i_csks
            WHERE  usnam  = wa_cntrllng_rsp-bname
            AND kokrs = s_corea-low.

  ENDLOOP.


  IF sy-subrc = 0.

    LOOP AT s_corea.
      wa_p-selname = 'S_COREA'.
      wa_p-kind = 'S'.
      wa_p-sign = s_corea-sign.
      wa_p-option = s_corea-option.
      wa_p-low = s_corea-low.
      wa_p-high = s_corea-high.
      APPEND wa_p TO i_tab.
    ENDLOOP.

    LOOP AT s_part.
      wa_p-selname = 'S_PART'.
      wa_p-kind = 'S'.
      wa_p-sign = s_part-sign.
      wa_p-option = s_part-option.
      wa_p-low = s_part-low.
      wa_p-high = s_part-high.
      APPEND wa_p TO i_tab.
    ENDLOOP.

CALL FUNCTION 'GET_PRINT_PARAMETERS'
    EXPORTING
      archive_mode           = '3'
    IMPORTING
      out_parameters         = print_parameters
      out_archive_parameters = archi_parameters
      valid                  = valid_flag
    EXCEPTIONS
      invalid_print_params   = 2
      OTHERS                 = 4.
* Retrieve the spool-id

  SUBMIT rkaep000
    WITH SELECTION-TABLE i_tab
     TO SAP-SPOOL
*     SPOOL PARAMETERS print_parameters
*     ARCHIVE PARAMETERS archi_parameters
*     WITHOUT SPOOL DYNPRO
     AND RETURN.
TRY.
IMPORT w_spool_nr FROM MEMORY ID 'TEST_SPONO'.
CATCH CX_SY_IMPORT_MISMATCH_ERROR.
ENDTRY.