Application Development and Automation 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: 
Read only

How to execute programs on different hosts/ severs?

Former Member
0 Likes
1,213

HI all,

In my SAP 4.6C system, two instances are running.

I would like to execute programA on instance1 and programB on instance2.

How could this be achieved?

thanks in advance,

holger

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,164

What do you mean by 'execute'? Executing it online through a tcode or SE38/SA38? Or executing it through a job?

Executing it online, I don't think you can really control that. But if you are executing them using jobs, you can specify the server in there.

Srinivas

You can define the target server when you define a batch job in SM36.

Cheers

8 REPLIES 8
Read only

Former Member
0 Likes
1,165

What do you mean by 'execute'? Executing it online through a tcode or SE38/SA38? Or executing it through a job?

Executing it online, I don't think you can really control that. But if you are executing them using jobs, you can specify the server in there.

Srinivas

Read only

0 Likes
1,164

@Srinivas:

You can execute these two programs online. See how:

- Write a RFC FM that executes an given report

- Call this FM by coding


CALL FUNCTION 'FUNCTION1'
  DESTINATION dest
...

- this FM again calls another RFC FM:


CALL FUNCTION 'FUNCTION2'
  STARTING NEW TASK task
...

taking this way, both jobs will run 'online' (in dialog process).

Read only

0 Likes
1,164

Hi Mike,

By 'online' I meant 'with dialog' wherea user executes a report in SAP GUI. Writing a RFC or submitting through another program are all different options available, but if a user wants to execute an existing report without a background job, then the user doesn't have the option of choosing the server.

Sorry for the confusion.

Srinivas

Read only

0 Likes
1,164

OK, then refer to TXN SM51. Here you will see all connected (application) servers and the user has the option to login (Button REMOTE LOGON) in to each of these servers, no matter to which has logged in initially!

Read only

0 Likes
1,164

Are you sure normal end users will have the access to SM51 in production environments? That will be a serious security breach. Server allocation is normally done by the load balancing. If for some reason(typically it is system resource reqiurements), a program has to run on a certain server, then the tool available to an end user is to execute it in the background.

Read only

Former Member
0 Likes
1,164

You can define the target server when you define a batch job in SM36.

Cheers

Read only

andreas_mann3
Active Contributor
0 Likes
1,164

Hi Holger ,

try that in your program

1) fm job_open

2) submit Zprog1...

3) fm: job_close

call function 'JOB_CLOSE'

...

TARGETSYSTEM = 'SERVER01'

...

regards Andreas

Read only

Former Member
0 Likes
1,164

Hello Holger,

just check out the new Job Scheduling capabilities of SAP NetWeaver. You can find more information about this on SAP Service Marketplace under quick-link job-scheduling (http://service.sap.com/job-scheduling)

Kind regards,

Edwin Esser