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: 

Getting Job ID within job.

Former Member
0 Kudos

I am trying to solve an isue we are havin when a job is run in the background. The problem is that we are running five of the same job in the background. The job consists of one program which does some calcultions and then calls another program. The two programs pass information to one another using memmory. This works fine when only one of the pogram is run, but when multiples are run we are finding that the data from one job is bing pulled into the other jobs.

What we would like to do is to assign the memory names with some sort of addition that would be unique to a particular job. IE. memorylocA_102848 wouldbe for job 102848 and then we could read memoryA_102848 in the called program and thus eliminate the problem of reading the same memory location.

The biggest issue is how to retrive the unique job ID number from within the program is runnung. Does anybody know how to do this?

Thanks!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello,

You may want to try function module GET_JOB_RUNTIME_INFO

which will return a jobcount which sems to be a job id of sorts.

Regards

Greg Kern

4 REPLIES 4

former_member156446
Active Contributor
0 Kudos

Hi John

we have a system varialble sy-spono

with this you might get the job id... give a try

Former Member
0 Kudos

I have looked through the SYST structure and have not found a field that has the job ID. SY-SPONO is the print ID. I need the job ID for a background job.

The job IDs are stored in table TBTCO, but I have not determined a way to retreive it from within the job.

Thanks!

Former Member
0 Kudos

Hello,

You may want to try function module GET_JOB_RUNTIME_INFO

which will return a jobcount which sems to be a job id of sorts.

Regards

Greg Kern

Former Member
0 Kudos

That function is exactly what I needed. Thanks!