Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Triggering a background job of class 'A' from within the ABAP program

Dear All,

We are implementing SAP ECC 6.0 on IBM System i, i5/OS V5R4, SAP kernel 7.00, kernel patch level 173.

Is there a way to control that when a background job is triggered from within an ABAP program using the : CALL FUNCTION 'JOB_OPEN' statement, the background job is of class A ?

I know that through transaction SM37, the job class for a background job can be changed manually, but the situation is an outsource company did for us some changes in the native SAP ABAP programs related to some SAP native transactions, and those programs trigger at their end some background jobs, each job running with the name of user running the transaction.

Through SM37, I can't find a template background job, to be changed to have class 'A'

The following is an excerpt from the ABAP code, bearing the CALL FUNCTION 'JOB_OPEN' statement :

FUNCTION z_cs_technical_completion.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(AUFNR) TYPE VBRP-AUFNR

*"----


DATA jobcount TYPE tbtcjob-jobcount.

CALL FUNCTION 'JOB_OPEN'

EXPORTING

jobname = 'CS_TECH_COMPLETE'

  • SDLSTRTDT = NO_DATE

  • SDLSTRTTM = NO_TIME

  • JOBCLASS =

IMPORTING

jobcount = jobcount

  • CHANGING

  • RET =

EXCEPTIONS

cant_create_job = 1

invalid_job_data = 2

jobname_missing = 3

OTHERS = 4

.

SUBMIT zcs_technical_completion

WITH p_aufnr EQ aufnr

AND RETURN

VIA JOB 'CS_TECH_COMPLETE'

NUMBER jobcount.

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

jobcount = jobcount

jobname = 'CS_TECH_COMPLETE'

strtimmed = 'X'

EXCEPTIONS

cant_start_immediate = 1

invalid_startdate = 2

jobname_missing = 3

job_close_failed = 4

job_nosteps = 5

job_notex = 6

lock_failed = 7

invalid_target = 8

OTHERS = 9.

ENDFUNCTION.

Thank you in advance for your cooperation.

Best regards.

Reda Khalifa

Tags:
Former Member replied

Hi,

You'd have to read the job details from TBTCO & TBTCP tables, bearing in mind that the data in these tables probably gets cleared after 8 days or so.

Regards,

Darren

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question