on 01-06-2011 3:50 AM
Dear all,
I have two reports with different output page size.
Those two reports print with the same local printer.
Each time i print report, i need manully select the print page size on the printer setting page (on printer server level, not sap level).
It is possiable that printer server auto select the opportune page for the report.
Please give adivces, thanks .
BR.
Wu
Hi Wu,
Try this piece of code to set print parameters by refering structure PRI_PARAMS Structure for Passing Print Parameters.
DATA: l_param TYPE pri_params,
l_valid(1) TYPE c .
*Get the parameters user specified
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
mode = 'CURRENT'
no_dialog = 'X'
IMPORTING
out_parameters = l_param
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
CHECK sy-subrc EQ 0.
*If user selected 'print immediately' OR 'delete after print', we need
*to unselect them
CLEAR v_newspool.
IF l_param-primm EQ 'X' OR
l_param-prrel EQ 'X'.
v_newspool = 'X'.
ENDIF.
CHECK v_newspool EQ 'X'. "skip rest if user param is correct
*Overwrite the ones we care about
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
expiration = '8' "keep in spool 8 days
immediately = ' ' "don't send to printer
in_parameters = l_param
no_dialog = 'X'
release = ' ' "keep in spool
IMPORTING
out_parameters = l_param
valid = l_valid
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
CHECK sy-subrc EQ 0.
*Force subsequent output to spool, with modified print parameters.
*a new spool is created. see also documentation on the option
*'NEW-SECTION'.
NEW-PAGE PRINT ON NEW-SECTION PARAMETERS l_param NO DIALOG
For auto-settings you can refer the steps described in this link:
Edited by: K.Manas on Jan 6, 2011 6:40 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Wu,
Is this print created via a sapscript or a smartform? If so what page format do you specify in the form?
If you specify page format INCH12 in the form, then no command is sent to the printer to select a page size. The default page size of the printer is used automatically.
Regards,
Aidan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
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.