Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Background Execution - Spool is taking default print parameters

Former Member
0 Likes
953

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

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
724

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

5 REPLIES 5
Read only

RaymondGiuseppi
Active Contributor
0 Likes
725

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

Read only

0 Likes
724

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

Read only

0 Likes
724

Hi ,

Check the system -


>owndata >defaults>Spool control

May be u have assigned to one printer in this one.

Regards,

Bharani

Read only

0 Likes
724

Does SU53 show any authorization error log ? (read [Analyzing Authorization Checks|http://help.sap.com/saphelp_nw70/helpdata/en/52/6716b3439b11d1896f0000e8322d00/frameset.htm])

Regards,

Raymond

Read only

0 Likes
724

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