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

PRINT Parameters for SPOOL

Former Member
0 Likes
4,172

Hi,

When we schedule a job in Background and when we ran that job it is populating content to the SPOOL. However the spool status is always 'Waiting'. We do not want to print the spool using a printer. Can you please suggest how can we pass this status and make it complete.

We tried GET_PRINT_PARAMETERSas below , it didn't work.

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

mode = 'BATCH'

no_dialog = 'X'

  • ABAP_LIST = 'X'

IMPORTING

out_parameters = LS_printparam.

Regards,

Srikanth.

1 ACCEPTED SOLUTION
Read only

former_member226519
Active Contributor
0 Likes
2,191

you have to set the print parameters before list output:

NEW-PAGE PRINT ON PARAMETERS ls_printparam NO DIALOG.

...

NEW-PAGE PRINT OFF.

if you want it in batch mode only you could add

IF SY-BATCH = 'X'.

Hi,

When we schedule a job in Background and when we ran that job it is populating content to the SPOOL. However the spool status is always 'Waiting'. We do not want to print the spool using a printer. Can you please suggest how can we pass this status and make it complete.

We tried GET_PRINT_PARAMETERSas below , it didn't work.

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

mode = 'BATCH'

no_dialog = 'X'

  • ABAP_LIST = 'X'

IMPORTING

out_parameters = LS_printparam.

Regards,

Srikanth.

4 REPLIES 4
Read only

former_member226519
Active Contributor
0 Likes
2,192

you have to set the print parameters before list output:

NEW-PAGE PRINT ON PARAMETERS ls_printparam NO DIALOG.

...

NEW-PAGE PRINT OFF.

if you want it in batch mode only you could add

IF SY-BATCH = 'X'.

Read only

0 Likes
2,191

I tried this before submitting the job as well as before printing the parameters. It is still showing the SPOOL status as Waiting.

Regards,

Srikanth.

Read only

0 Likes
2,191

Try this code :

*&---------------------------------------------------------------------*
*&      Form  begin_spool
*&---------------------------------------------------------------------*
FORM begin_spool.

  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.

ENDFORM.                    " begin_spool

Edited by: K.Manas on Jan 5, 2011 9:28 AM

Read only

soumya_jose3
Active Contributor
0 Likes
2,191

Hi Srikant,

You might need to clean out your Spool Requests created. There are limitations on the number of spool requests and when this reaches a max limit, new spools go to waiting status.

Check the program RSPO1041 and see if u can delete the old spools.

Regards,

Soumya.