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: 

Scheduling jobs in different app server

RafaelVieira
Active Participant
0 Kudos

Hi all,

Does anyone knows how to schedule a background job in a specific app server, by using FM JOB_SUBMIT / JOB_CLOSE?

I've analysed SAP documentation for these FMs and it says that the parameter EXTPGM_SYSTEM can be used to inform the app server in which the program will be ran. However, it seems to be for external programs and my requirement is just to set a abap report to run in a specific app server.

SAP documentation says:

EXTPGM_SYSTEM Parameter

Name of the host system on which an external program is to be run. You must supply a value for this parameter.

Note: You must specify both the name of an external program and the name of the system on which it is to be executed.

As I don't have an external program, just the abap report, I'm not sure I can use such parameter to schedule the job at the desired app server.

Please advise.

Thanks,

Rafael.

1 ACCEPTED SOLUTION

bryan_cain
Contributor
0 Kudos

JOB_CLOSE has a parameter called "TARGETSERVER" that is probably what you're looking for.

8 REPLIES 8

bryan_cain
Contributor
0 Kudos

JOB_CLOSE has a parameter called "TARGETSERVER" that is probably what you're looking for.

0 Kudos

I understand that in JOB_CLOSE we should inform TARGETSERVER = <app_server> to close something previously opened on JOB_OPEN.

If so, the closing task is clear to me.

My question is, how to open it, how to create/define the background job in that specific app server.

0 Kudos

just curious, why do you want to restrict the job to be executed in a particular app server?

0 Kudos

The wording of the names of those function modules is a little funny. JOB_CLOSE is what will actually trigger execution of the job. Since target app sever is an attribute of the job execution, you specify it in the JOB_CLOSE FM.

0 Kudos

Kartik,

there is another program which people uses to read the generated files. As per the server load balancing, some output files are being created in server A, and some in server B. With this parameter, the output files would be generated only in server A.

So, Bryan, that does make sense.

So, you mean I should consider only JOB_CLOSE in order to inform target system? Should I ignore the external program parameters in JOB_OPEN?

0 Kudos

Yes. External program correlates with the external program options when defining a step in SM36.

0 Kudos

Also - the external program options are in JOB_SUBMIT, not JOB_OPEN.

Now that I"m getting back into this, I believe the FMs work like so:

JOB_OPEN - creates the job.

JOB_SUBMIT - adds a step to the job

JOB_CLOSE - schedules / releases, etc the job.

0 Kudos

You're right, I meat JOB_SUBMIT.

It's solved by informing the specific server in the parameter TARGETSERVER of FM JOB_CLOSE.

Tks!

Rafael.