Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Retrieve the spool ID

mrahhaoui
Participant
0 Likes
646

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.

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.

3 REPLIES 3
Read only

naimesh_patel
Active Contributor
0 Likes
603

Instead of Import / Export of the spool number, try to get it from the SY-SPONO.

Regards,

Naimesh Patel

Read only

0 Likes
603

Hi Naimesh,

Do you have an example?

Regards,

Mohamed.

Read only

mrahhaoui
Participant
0 Likes
603

See other topic