‎2010 Jan 20 12:30 PM
Hi experts,
I'm executing a report in background. All printouts are sent to default printer even if another printer was selected. The Storage Mode is default 'Print'. Even it is taking the default format. I have submit a program with SAP-SPOOL AND RETURN.
How can i solve the problem if i chose different printer it should come with different output device and format as well if storage mode is 'Archive' it should come 'Archive' instead of 'Print'.
Thanks in Advance,
Abhijit
‎2010 Jan 20 1:06 PM
You need a TO SAP-SPOOL [spool_options|http://help.sap.com/abapdocu_70/en/ABAPSUBMIT_PRINT_PARAMETERS.htm] syntax, for that you have to call FM [GET_PRINT_PARAMETERS|http://help.sap.com/abapdocu_70/en/ABENPRINT_PARAMETERS_FUNCTION.htm] with NO_DIALOG parameter set and without passing import parameters to get current parameters before SUBMIT report. You can then call this FM many times changing only requested parameters (and always NO_DIALOG set) to adapt to each report you submit. (e.g. LAYOUT, LINE_COUNT, LINE_SIZE)
* First
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
no_dialog = 'X'
IMPORTING
out_archive_parameters = ls_archive_parameters
out_parameters = ls_parameters.
* Then - report is 255 wide
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
in_archive_parameters = ls_archive_parameters
in_parameters = ls_parameters
line_size = 255
IMPORTING
out_archive_parameters = ls_archive_parameters
out_parameters = ls_parameters.
SUBMIT report zreport TO SAP-SPOOL SPOOL
PARAMETERS ls_parameters
ARCHIVE PARAMETERS ls_archive_parameters
WITHOUT SPOOL DYNPRO.Regards,
Raymond
‎2010 Jan 20 1:06 PM
You need a TO SAP-SPOOL [spool_options|http://help.sap.com/abapdocu_70/en/ABAPSUBMIT_PRINT_PARAMETERS.htm] syntax, for that you have to call FM [GET_PRINT_PARAMETERS|http://help.sap.com/abapdocu_70/en/ABENPRINT_PARAMETERS_FUNCTION.htm] with NO_DIALOG parameter set and without passing import parameters to get current parameters before SUBMIT report. You can then call this FM many times changing only requested parameters (and always NO_DIALOG set) to adapt to each report you submit. (e.g. LAYOUT, LINE_COUNT, LINE_SIZE)
* First
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
no_dialog = 'X'
IMPORTING
out_archive_parameters = ls_archive_parameters
out_parameters = ls_parameters.
* Then - report is 255 wide
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
in_archive_parameters = ls_archive_parameters
in_parameters = ls_parameters
line_size = 255
IMPORTING
out_archive_parameters = ls_archive_parameters
out_parameters = ls_parameters.
SUBMIT report zreport TO SAP-SPOOL SPOOL
PARAMETERS ls_parameters
ARCHIVE PARAMETERS ls_archive_parameters
WITHOUT SPOOL DYNPRO.Regards,
Raymond
‎2010 Jan 20 1:51 PM
Hi,
I have done it exact way but still it is not coming. When I'm changing the parameters in mannually it's saying user don't have authorization to change it from Print-->Archive. Is it due to authorization problem? But user is sayinjg he has got all authorizations.
Thanks In advance,
Abhijit
Edited by: Abhijit Mandal on Jan 20, 2010 8:13 PM
‎2010 Jan 20 3:02 PM
Hi ,
Check the system -
>owndata >defaults>Spool control
May be u have assigned to one printer in this one.
Regards,
Bharani
‎2010 Jan 20 3:37 PM
‎2010 Jan 21 12:01 PM
Hi,
After executing SU53 it's giving like below.
Authorization check failed
Object Class BC_A Basis: Administration
Authorization Obj. S_BTCH_ADM Background Processing: Background Administrator
Authorization Field BTCADMIN Background administrator ID
Thanks ,
Abhijit