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

Create background job using server name

Former Member
0 Likes
1,029

Hi all,

I need to create a background job using FM JOB_OPEN and JOB_Close.

My problem is that I need to define the Server name where this new job must be run, because I have 3 different server and only one can be use for my job. I create a report in this way :

call function 'JOB_OPEN'

exporting

jobname = name_rep

jobclass = 'A'

importing

jobcount = number

exceptions

cant_create_job = 1

invalid_job_data = 2

jobname_missing = 3

others = 4.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

check sy-subrc eq 0.

submit zmicperformance

via job name_rep number number

  • with debug ...

with enhanced eq enhanced

with i_tframe eq i_tframe

with i_tfyear eq i_tfyear

with p_buffer eq p_buffer

with rep1 eq rep1

with rep10 eq rep10

with rep2 eq rep2

with rep3 eq rep3

with rep4 eq rep4

with rep5 eq rep5

with rep6 eq rep6

with rep7 eq rep7

with rep8 eq rep8

with rep9 eq rep9

with standard eq standard

with uname eq uname-low

and return.

if sy-subrc eq 0.

call function 'JOB_CLOSE'

exporting

jobcount = number

jobname = name_rep

strtimmed = 'X'

exceptions

cant_start_immediate = 1

invalid_startdate = 2

jobname_missing = 3

job_close_failed = 4

job_nosteps = 5

job_notex = 6

lock_failed = 7

invalid_target = 8

others = 9.

can you help me ?

thanks in advance

Barbara

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
740

Hi ,

check for TARGETSERVER in FM JOB_CLOSE or see the documentation of this FM

Regards

Prabhu

2 REPLIES 2
Read only

Former Member
0 Likes
741

Hi ,

check for TARGETSERVER in FM JOB_CLOSE or see the documentation of this FM

Regards

Prabhu

Read only

0 Likes
740

thanks a lot

barbara