Skip to Content
-2

Question on report Output to send to spool

Apr 25 at 08:48 AM

23

avatar image

Hi,

I am using list display, i want to send the report o/p for which I am running to be sent to spool. I had used function modules job_open get_print_parametrs submit and job close but there are number of spools generated for exmple if there are 100 records 100 spools are genertaed.also in the spool o/p there is no data . can you please suggest.

thanks.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Horst Keller
Apr 25 at 09:53 AM
1
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi,

Thanks for your reply I had made similar changes, I called function module for JOB_OPEN and GET_PRINT_PARAMS for getting the printing parameters and submit report and job close. coding for reference.

 SELECT * FROM vbap INTO TABLE tb_vbap WHERE vbeln IN s_vbeln.





  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

    EXPORTING

      i_program_name         = sy-repid

      i_structure_name       = 'VBAP'

    CHANGING

      ct_fieldcat            = tb_fcat

    EXCEPTIONS

      inconsistent_interface = 1

      program_error          = 2

      OTHERS                 = 3.



  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

    EXPORTING

      i_callback_program = sy-repid

      is_layout          = gs_layout

      it_fieldcat        = tb_fcat

    TABLES

      t_outtab           = tb_vbap

    EXCEPTIONS

      program_error      = 1

      OTHERS             = 2.

  IF sy-subrc <> 0.

* Implement suitable error handling here

  ENDIF.



  va_jobname = sy-repid.



  CALL FUNCTION 'JOB_OPEN'

    EXPORTING

      jobname          = va_jobname

    IMPORTING

      jobcount         = va_jobnumber

    EXCEPTIONS

      cant_create_job  = 1

      invalid_job_data = 2

      jobname_missing  = 3

      OTHERS           = 4.

  IF sy-subrc <> 0.

* Implement suitable error handling here

  ENDIF.





  CALL FUNCTION 'GET_PRINT_PARAMETERS'

    EXPORTING

      immediately            = ' '

      line_size              = sy-linsz

      list_name              = 'BALU'

      list_text              = 'lIST RESULTS'

      mode                   = 'BATCH'

      new_list_id            = 'X'

      no_dialog              = 'X'

      release                = 'X'

    IMPORTING

      out_parameters         = params

      valid                  = valid

    EXCEPTIONS

      archive_info_not_found = 1

      invalid_print_params   = 2

      invalid_archive_params = 3

      OTHERS                 = 4.

  IF sy-subrc <> 0.

* Implement suitable error handling here

  ENDIF.



  SUBMIT (va_jobname) USER sy-uname

  VIA JOB va_jobname NUMBER va_jobnumber

  WITH s_vbeln = s_vbeln

  WITH s_posnr = s_posnr

  WITH s_matnr = s_matnr

  TO SAP-SPOOL SPOOL PARAMETERS params WITHOUT SPOOL DYNPRO

   AND RETURN.





  CALL FUNCTION 'JOB_CLOSE'

    EXPORTING

      jobcount             = va_jobnumber

      jobname              = va_jobname

      strtimmed            = 'X'

    IMPORTING

      job_was_released     = job_released

    EXCEPTIONS

      cant_start_immediate = 1

      invalid_startdate    = 2

      jobname_missing      = 3

      job_close_failed     = 4

      job_nosteps          = 5

      job_notex            = 6

      lock_failed          = 7

      invalid_target       = 8

      OTHERS               = 9.

  IF sy-subrc <> 0.

* Implement suitable error handling here

  ENDIF.
0

the problem is the REUSE_ALV_LIST display o/p is not seen at the spool .

0