Application Development 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: 

Write data to spool

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

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

5 REPLIES 5

Former Member
0 Kudos

If you execute it in Background it will automatically write into spool.

0 Kudos

Hi ,

Amandeep, Thank you very much for your quick reply.

The script I am talking about is an FI script which will be triggered by the tcode F110 for payment program. I dont know wether it will run in the backgrond or not. I have no clear idea. Can anyone explain me this one.

Regards,

varun.

0 Kudos

Hi Varun,

Not sure but check if you can attach any output type to that FI script so that you have chance to generate the spool.

Regards

vijay

Former Member
0 Kudos

hii

SUBMIT TO SAP-SPOOL

1.... DESTINATION dest ... COPIES cop

... LIST NAME name

... LIST DATASET dsn

... COVER TEXT text

... LIST AUTHORITY auth

... IMMEDIATELY flag

... KEEP IN SPOOL flag

... NEW LIST IDENTIFICATION flag

... DATASET EXPIRATION days

... LINE-COUNT lin

... LINE-SIZE col

... LAYOUT layout

... SAP COVER PAGE mode

... COVER PAGE flag

... RECEIVER rec

... DEPARTMENT dep

... ARCHIVE MODE armode

... ARCHIVE PARAMETERS arparams

... WITHOUT SPOOL DYNPRO

use this fm <b>SLVC_TABLE_PS_TO_SP</b>

RSPO_SX_OUTPUT_TEXTDATA

for internal table to spool

CALL FUNCTION 'SLVC_TABLE_PS_TO_SPOOL'

EXPORTING

i_file_length = 255

  • IMPORTING

  • E_SPOOLID =

tables

it_textdata = itab

  • EXCEPTIONS

  • SPOOL_ERROR = 1

  • PARAMETERS_INVALID = 2

  • OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Regards

Naresh

former_member188685
Active Contributor
0 Kudos

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