Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Write data to spool

Hi all,

I have two similar doubts.

1) I have some data in internal table. I want to write that into a file in the spool.

Is that possible ? If so how do we achieve that.

2) I have zscript and the print program. When I run the print program the script will be generated, there by I can view it or print it. Now I wnt to send the script to spool with out preview or printing.

Is that possible ? If so how do we achieve that.

Please help me with these queries.

Regards,

Varun.

Tags:
replied

Hi,

1 for the first one.

      call function 'GET_PRINT_PARAMETERS'
       exporting
         immediately                  = ' '
         line_size                    = 220
         release                      = ' '
         mode                         = 'CURRENT'
         no_dialog                    = ' '
       importing
*     OUT_ARCHIVE_PARAMETERS       =
         out_parameters               = l_params
         valid                        = l_valid
       exceptions
         archive_info_not_found       = 1
         invalid_print_params         = 2
         invalid_archive_params       = 3
         others                       = 4.
        IF SY-SUBRC <> 0.
*           MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.

      new-page print on   parameters l_params no dialog.

      perform select_data.
      perform display_data." you can loop and write the data that will be sent to spool.
      new-page print off.

2. second you need to pass print params to open_form FM. that will take care of the spool.

check OPEN_FORM Fm there you have paramters for Printing , using that you can generate the spool

regards

vijay

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question