2011 Jan 05 7:33 AM
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.
2011 Jan 05 7:51 AM
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.
2011 Jan 05 7:51 AM
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'.
2011 Jan 05 8:00 AM
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.
2011 Jan 05 8:27 AM
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_spoolEdited by: K.Manas on Jan 5, 2011 9:28 AM
2011 Jan 05 12:26 PM
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.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |