05-23-2006 2:03 PM
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.
05-23-2006 2:14 PM
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
05-23-2006 2:10 PM
If you execute it in Background it will automatically write into spool.
05-23-2006 2:15 PM
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.
05-23-2006 2:19 PM
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
05-23-2006 2:12 PM
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
05-23-2006 2:14 PM
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