Application Development 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: 

SAP Jobs: Control programatically

former_member203070
Participant
0 Kudos

I need a quick suggestion.

I need to control the below parameters for a particular background job -

  • Job Name
  • Job Class
  • Status
  • Exec. Target
  • User
  • ABAP Program Name
  • Variant
  • Scheduled Start Date
  • Scheduled Start Time
  • Status

I know we can leverage of tables TBTCO, TBTCP.

But is there any FM (function module) or BAPI to handle the background job through our custom program???

Prompt reply will be highly appreciated and rewarded.

Thanks

Partha S Goswami

5 REPLIES 5

Former Member
0 Kudos

Hi Partha!

Yes we have so many FM's ( BAPI_XBP*) to control the Job sechduling! do let me know what exactly you want to control through the custom program!

Do you want to get the Job log information or schedule the job!

0 Kudos

Hi Kiran,

Thanks for your reply.

I need to schedule the job for one case and need to change the status of the job for some other case.

When scheduling the job we need to specify the mentioned parameters -

  • Job Name
  • Job Class
  • Status
  • Exec. Target
  • User
  • ABAP Program Name
  • Variant
  • Scheduled Start Date
  • Scheduled Start Time

as in SM36.

Thanks

Partha S Goswmai

0 Kudos

Hi Partha,

You can use theFM  BP_JOB_CREATE

call function 'JOB_SUBMIT'


BP_JOB_STATUS_GET

TUJOB_UPDATE_STATUS


finally just check  if required

Object type  XBPJOB   Externally controllable background (an interface)

Former Member
0 Kudos

Hi Partha

Please see if the following links are helpful for your scenario

Scheduling background job by triggering an event - ABAP Development - SCN Wiki

Also this thread speaks about similar requirement

Thanks

Rishi

Former Member
0 Kudos

Hi,

You can use the following BAPIs for scheduling a job in background

BAPI_XBP_JOB_OPEN - This BAPI solves the first step in scheduling a job in the R/3 background processing system. You can create the job with this method.

Using additional BAPI calls BAPI_XBP_JOB_ADD_ABAP_STEP and BAPI_XBP_JOB_ADD_EXT_STEP, you can add job steps to the job.