2006 Jun 13 11:34 AM
Hi
Is it possible to send the internal table data to spool directly . I know that we can send list output to spool .
But our requirment is to send the internal table data to spool . We dont want create the list first and then send it to spool as we dont want the list output on screen at all .
If this is possible then please let me know .
Thanks in advance
Vikas
Hi
Is it possible to send the internal table data to spool directly . I know that we can send list output to spool .
But our requirment is to send the internal table data to spool . We dont want create the list first and then send it to spool as we dont want the list output on screen at all .
If this is possible then please let me know .
Thanks in advance
Vikas
2006 Jun 13 11:35 AM
2006 Jun 13 11:37 AM
2006 Jun 13 11:39 AM
Hi Vikas,
Welcome to SDN.
Use the function module RSPO_SX_OUTPUT_TEXTDATA
RSPO_SX_OUTPUT_TEXTDATA
exporting
name = "LOCAL"
rows = <no of rows>
startrow = 1
title = <title>
immediately = ""
tables
text_data = datatab
importing
rqid = <returned spool number> .
Thanks,
Susmitha.
Please mark all helpful answers
Message was edited by: Susmitha Thomas
2006 Jun 26 6:18 PM
Hi Susmitha,
Have you used this Function Module before. IF yes - then did you had any problem with the number of pages that could be spooled and printed
Somehow I have been able to create only '1' page. Even if i pass the parameter as either blank or '2'.
CALL FUNCTION 'RSPO_SX_OUTPUT_TEXTDATA'
EXPORTING
NAME = device
DEST = device
ROWS = 0
STARTROW = 1
PAGES = ''
Any insight in this matter will be appreciated.
Thank You,
Almas.
2006 Jun 13 11:42 AM
Hi,
We can use GET_PRINT_PARAMETERS' Function module
and use its importing variable to write
list to spool directly using
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
ARCHIVE_INFO = GC_ARCH_INFO
ARCHIVE_MODE = GV_ARCH_MODE
ARCHIVE_TEXT = LV_ARCHTXT
AR_OBJECT = GC_ARCH_OBJ
COVER_PAGE = ' '
DESTINATION = LV_PDEST
EXPIRATION = 45
IMMEDIATELY = LV_WPIMM
LAYOUT = 'X_65_132'
LINE_COUNT = 65
LINE_SIZE = 132
LIST_NAME = P_NAME
LIST_TEXT = LV_TEXT
NEW_LIST_ID = GC_X
NO_DIALOG = GC_X
RELEASE = ' '
SAP_COVER_PAGE = ' '
SAP_OBJECT = GC_OBJ
IMPORTING
OUT_ARCHIVE_PARAMETERS = W_ARCPARM
OUT_PARAMETERS = W_PRIPARM
VALID = GV_VALID
EXCEPTIONS
ARCHIVE_INFO_NOT_FOUND = 1
INVALID_PRINT_PARAMS = 2
INVALID_ARCHIVE_PARAMS = 3
OTHERS = 4.
IF SY-SUBRC EQ 0 AND NOT GV_VALID IS INITIAL.
new-page print on parameters w_priparm
archive parameters w_arcparm
new-section
no dialog.
endif.
new-page print off.
Regards,
Amole
2006 Jun 13 12:15 PM
Hai vikas
check the following code
Save Report Output to a PDF File
This report takes another report as input, and captures the output of that report. The output is then converted to PDF and saved to a local file. This shows how to use some of the PDF function modules, as well as an easy way to create PDF files.
Source Code Listing
report zabap_2_pdf.
*-- Enhancements: only allow to be run with variant. Then called
*-- program will be transparent to users
*-- TABLES
tables:
tsp01.
*-- STRUCTURES
data:
mstr_print_parms like pri_params,
mc_valid(1) type c,
mi_bytecount type i,
mi_length type i,
mi_rqident like tsp01-rqident.
*-- INTERNAL TABLES
data:
mtab_pdf like tline occurs 0 with header line,
mc_filename like rlgrap-filename.
*-- SELECTION SCREEN
parameters:
p_repid like sy-repid, " Report to execute
p_linsz like sy-linsz default 132, " Line size
p_paart like sy-paart default 'X_65_132'. " Paper Format
start-of-selection.
concatenate 'c:\'
p_repid
'.pdf'
into mc_filename.
*-- Setup the Print Parmaters
call function 'GET_PRINT_PARAMETERS'
exporting
authority= space
copies = '1'
cover_page = space
data_set = space
department = space
destination = space
expiration = '1'
immediately = space
in_archive_parameters = space
in_parameters = space
layout = space
mode = space
new_list_id = 'X'
no_dialog= 'X'
user = sy-uname
importing
out_parameters = mstr_print_parms
valid = mc_valid
exceptions
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
others = 4.
*-- Make sure that a printer destination has been set up
*-- If this is not done the PDF function module ABENDS
if mstr_print_parms-pdest = space.
mstr_print_parms-pdest = 'LOCL'.
endif.
*-- Explicitly set line width, and output format so that
*-- the PDF conversion comes out OK
mstr_print_parms-linsz = p_linsz.
mstr_print_parms-paart = p_paart.
submit (p_repid) to sap-spool without spool dynpro
spool parameters mstr_print_parms
via selection-screen
and return.
*-- Find out what the spool number is that was just created
perform get_spool_number using sy-repid
sy-uname
changing mi_rqident.
*-- Convert Spool to PDF
call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
exporting
src_spoolid= mi_rqident
no_dialog = space
dst_device = mstr_print_parms-pdest
importing
pdf_bytecount = mi_bytecount
tables
pdf = mtab_pdf
exceptions
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
others = 12.
call function 'DOWNLOAD'
exporting
bin_filesize = mi_bytecount
filename = mc_filename
filetype = 'BIN'
importing
act_filename = mc_filename
tables
data_tab = mtab_pdf.
----
FORM get_spool_number *
----
Get the most recent spool created by user/report *
----
--> F_REPID *
--> F_UNAME *
--> F_RQIDENT *
----
form get_spool_number using f_repid
f_uname
changing f_rqident.
data:
lc_rq2name like tsp01-rq2name.
concatenate f_repid+0(8)
f_uname+0(3)
into lc_rq2name separated by '_'.
select * from tsp01 where rq2name = lc_rq2name
order by rqcretime descending.
f_rqident = tsp01-rqident.
exit.
endselect.
if sy-subrc ne 0.
clear f_rqident.
endif.
endform." get_spool_number
Thanks & regards
Sreeni
2006 Jun 26 6:29 PM
HI Vikas
data: wf_params like pri_params .
data: loc_dest like pri_params-pdest .
data: wf_days(1) type n value 8,
wf_copies(3) type n value 1,
wf_valid type c ,
wf_listname like pri_params-plist ,
wf_listtext like pri_params-prtxt .
clear : wf_listname , loc_dest , wf_listtext .
move: 'List text' to wf_listname .
move: 'List text' to wf_listtext .
select single spld into usr01-spld from usr01 where bname eq sy-uname .
if sy-subrc eq 0 .
move: usr01-spld to loc_dest .
endif .
call function 'GET_PRINT_PARAMETERS'
exporting
destination = loc_dest
copies = wf_copies
list_name = wf_listname
list_text = wf_listtext
immediately = ' '
release = ' '
new_list_id = 'X'
expiration = wf_days
line_size = 200
line_count = 65
layout = 'X_65_200'
sap_cover_page = 'X'
receiver = 'SAP*'
department = ''
no_dialog = 'X'
importing
out_parameters = wf_params
valid = wf_valid.
if wf_valid <> space.
new-page print on parameters wf_params no dialog.
perform write_summary .
new-page print off.
endif .
form write_summary.
loop at itab .
write:/ tab-....
endloop .
endform. " write_summary
regards,
Laxmi
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |