on 12-04-2009 10:34 AM
Hi,
Firstly I apologise for spamming your mail box.
We are facing an issue with printing smartforms.
We are calling multiple smartforms in a report program in succession and are trying to print all of them at one go.
But in the spool queue, there are multiple requests generated, each corresponding to one smart form.
Is there any configuration or code setting or workaround to create a single spool request for all the forms.
Any pointers in this regard would be of great help.
Thanks in advance.
varun
hi ,
if u have multiple forms to be printed in your report , then first u have to get the print parameters after each report using the function module "GET_PRINT_PARAMETERS". then use the following code to get the spool job for each report.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
IMMEDIATELY = space "C_CHAR_UNKNOWN
IMPORTING
OUT_ARCHIVE_PARAMETERS =
OUT_PARAMETERS = mstr_print_parms
VALID = t_valid
VALID_FOR_SPOOL_CREATION =
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.
*-- 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 = linsz.
mstr_print_parms-paart = paart.
submit (PROG_NAME) to sap-spool without spool dynpro
spool parameters mstr_print_parms
via selection-screen
and return.
data : f_repid type sy-repid,
f_uname type sy-uname.
data:
lc_rq2name like tsp01-rq2name,
f_rqident like tsp01-rqident,
byte_count type i,
f_repid = sy-repid.
f_uname = sy-uname.
concatenate f_repid+0(9)
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.
then using that abap spooljob u cud print the report individually .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
in control parameters u will have
control-no_open
control-no_close
Check example :sf_example_03.
check this link also
http://www.sapfans.com/forums/viewtopic.php?f=13&t=23697&start=0&st=0&sk=t&sd=a
or
use this
CALL FUNCTION OPEN_SPOOL.
--> CALL FUNCTION SMARTFORM1.
--> CALL FUNCTION SMARTFORM2.
--> CALL FUNCTION SMARTFORM3.
.
CALL FUNCTION CLOSE_SPOOL.
surya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.