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 job- getting printed automatically

Former Member
0 Likes
897

In my BDC Program i have submitted Session for Background Processing using

Submit RSBDCSUB..........

my code is also given below..The problem is after the user executes the program, background job is automatically going to his Local printer and getting printed. HOw to avoid this?

CALL FUNCTION 'JOB_OPEN'

EXPORTING

jobname = gf_jobname

IMPORTING

jobcount = gf_jobcount

EXCEPTIONS

cant_create_job = 1

invalid_job_data = 2

jobname_missing = 3

OTHERS = 4.

*-Submit the selected sales orders for changes.

SUBMIT rsbdcsub AND RETURN

WITH mappe = v_sess

WITH von = sy-datum

WITH bis = sy-datum

WITH z_verarb = 'X'

WITH fehler = space

WITH batchsys = space

WITH logall = space

USER sy-uname VIA JOB gf_jobname NUMBER gf_jobcount.

IF sy-subrc NE 0.

MESSAGE i999 WITH text-013.

EXIT.

ENDIF.

*-Close job and start immediately.

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

jobcount = gf_jobcount

jobname = gf_jobname

strtimmed = 'X'

IMPORTING

job_was_released = gf_release

EXCEPTIONS

cant_start_immediate = 1

invalid_startdate = 2

jobname_missing = 3

job_close_failed = 4

job_nosteps = 5

job_notex = 6

lock_failed = 7

OTHERS = 8.

1 ACCEPTED SOLUTION
Read only

david_escofettrenado
Participant
0 Likes
755

On SUBMIT use

SUBMIT zxxxxxx TO SAP-SPOOL

WITHOUT SPOOL DYNPRO

IMMEDIATELY ' '

KEEP IN SPOOL 'X'

DESTINATION printer

NUMBER number

AND RETURN

In my BDC Program i have submitted Session for Background Processing using

Submit RSBDCSUB..........

my code is also given below..The problem is after the user executes the program, background job is automatically going to his Local printer and getting printed. HOw to avoid this?

CALL FUNCTION 'JOB_OPEN'

EXPORTING

jobname = gf_jobname

IMPORTING

jobcount = gf_jobcount

EXCEPTIONS

cant_create_job = 1

invalid_job_data = 2

jobname_missing = 3

OTHERS = 4.

*-Submit the selected sales orders for changes.

SUBMIT rsbdcsub AND RETURN

WITH mappe = v_sess

WITH von = sy-datum

WITH bis = sy-datum

WITH z_verarb = 'X'

WITH fehler = space

WITH batchsys = space

WITH logall = space

USER sy-uname VIA JOB gf_jobname NUMBER gf_jobcount.

IF sy-subrc NE 0.

MESSAGE i999 WITH text-013.

EXIT.

ENDIF.

*-Close job and start immediately.

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

jobcount = gf_jobcount

jobname = gf_jobname

strtimmed = 'X'

IMPORTING

job_was_released = gf_release

EXCEPTIONS

cant_start_immediate = 1

invalid_startdate = 2

jobname_missing = 3

job_close_failed = 4

job_nosteps = 5

job_notex = 6

lock_failed = 7

OTHERS = 8.

2 REPLIES 2
Read only

david_escofettrenado
Participant
0 Likes
756

On SUBMIT use

SUBMIT zxxxxxx TO SAP-SPOOL

WITHOUT SPOOL DYNPRO

IMMEDIATELY ' '

KEEP IN SPOOL 'X'

DESTINATION printer

NUMBER number

AND RETURN

Read only

Former Member
0 Likes
755

One work-around could be to remove print immediately from the User's Own Data who is executing the report. It will work.

Else you could write the code as suggested above which would be a better fix.