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 in Background using spool number

Former Member
0 Likes
630

Hi all,

I have a schedule job which retreives the spool number and should release the spool to print in background.

At present iam using the FM RSPO_OUTPUT_SPOOL_REQUEST, but does'nt work in background. is there any FM which can do the print jop using the spool number.

Thanks,

Rajesh..

Message was edited by:

Rajesh Kumar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
557

You can create a background job by using the following function module and schedule them to print.

1. job_open

2. job_submit

3.job_close.

Hi all,

I have a schedule job which retreives the spool number and should release the spool to print in background.

At present iam using the FM RSPO_OUTPUT_SPOOL_REQUEST, but does'nt work in background. is there any FM which can do the print jop using the spool number.

Thanks,

Rajesh..

Message was edited by:

Rajesh Kumar

2 REPLIES 2
Read only

Former Member
0 Likes
558

You can create a background job by using the following function module and schedule them to print.

1. job_open

2. job_submit

3.job_close.

Read only

0 Likes
557

Refer the following code:

report  y_job                                   .


parameters : job like btcevtjob-jobname.

data: count like btcevtjob-jobcount.



call function 'JOB_OPEN'
  exporting

    jobname                = job

  importing

   jobcount               = count.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.

write : / sy-subrc.

call function 'JOB_SUBMIT'
  exporting
    authcknam                         = sy-uname


    jobcount                          = count
    jobname                           = job
    report                            = 'YMPRPR_COMPRE11'
    variant                           = 'TEST1'
    language                          = sy-langu.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.



write :/ sy-subrc.

call function 'JOB_CLOSE'
  exporting

    jobcount                          = count
    jobname                           = job.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.

write : / sy-subrc.