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: 

How to identify different batch job name based on main program

former_member244346
Participant
0 Kudos

Hi Experts,

I am using two business scenario from one main program,

Scenario-1 vendor posting

Scenario - 2 gl posting

for above two different scenario two function module is using and based on selection screen input those function modules will call. So this report is using background and i need restrict some functionality for one business. i want to find batch job based on main program name but challenging is how i can filter the batch job for scenario vise.

I tried with table TBTCP status field but there i cannot filter the batch job name.

Please suggest it will be very helpful.

Thanks,

5 REPLIES 5

DoanManhQuynh
Active Contributor
0 Kudos

from what you said i think you can create variant for each scenario then create job for that program with correct variant.

former_member244346
Participant
0 Kudos

Thanks Quynh, I got something but from table TBTCP i can filter with program name and variant but suppose i run program with variant TEST02 in table TBTCP-VARIANT its storing like &0000000000043 this, Can you please help me here.

Thanks,

raymond_giuseppi
Active Contributor
0 Kudos

If you schedule with a transaction such as SM36 the background job will carry the input variant name. But when you schedule background execution from transaction the system generates a temporary variant with the current values from the selection-screen and not the variant you selected (sy-slset) as user could have changed some values.

Could you reformulate your exact requirement, when do you want to 'restrict some functionality' during the scheduled report execution, before scheduling (during the original transaction execution) or in some admin background job. And 'what' do you exactly intend to do?

0 Kudos

Hi Raymond,

I am looking to set flag for when program run in background against batch job and variant and if run in foreground against program and with variant.

Hope this is enough for your understanding.

Thanks,

0 Kudos

In your code you can use sy-batch to segregate transaction and background job.

In case background job flag is set , you can also get some information on current job with a FM such as GET_JOB_RUNTIME_INFO. A scheduled 'regular' background job will be executed with a permanent variant name, when a 'user' scheduled one will get a temporary one (&+counter) you get variant name either from sy-slset or reading TBTCP (with information from previously mentioned FM)