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: 

Schedule a program in Background job in RFC connected system

former_member357236
Participant
0 Kudos

Hi,

I have a requirement like, i need to run a program in system B from system A. I need to create a program in system A to execute program in system B by background job and save in a spool list.

Later i need to send the list to a email address. Kindly guide how can i approach this.

Thanks in advance.

Regards,

Gopi.

5 REPLIES 5

rajeevgoswami1
Participant
0 Kudos

Directly program cannot be executed by RFC. First you need to create a RFC function module in System B inside u can call the program using submit statement. In calling system A you can call this RFC FM in a program and schedule in background job.

Thanks,

Rajeev Goswami

0 Kudos

Thanks Rajeev,

So we don't have any other way to write a program only in System A to call program in System B.?

Regards,

Gopi

Former Member
0 Kudos

As Rajeev said, we need a RFC function module to communicate between one system to another. Direct program call in another system cannot be done by RFC.

ceedee666
Active Contributor
0 Kudos

Hi Gopi,

there are options to achieve what you try to do. See ,for example,  Execute code from a text file ... | SCN.

However, using the mentioned function modules are not recommanded from a security point of view.

Christian

raymond_giuseppi
Active Contributor

Solution 1


Build a RFC enabled FM, this FM will be called from program in system A with destination System B.


In this wrapper FM:

  • use classic FMs to create a JOB, reference: Programming with the Background Processing System (BC-CCM-BTC).
  • The JOB_CLOSE carries the RECIPIENT_OBJ parameter for The Mail Recipient of the Spool Lists (as transaction SM36) - alternative create a second step in the job to send mail if default mail doesn't fulfill your requirement.
  • Add a step with a SUBMIT of the called report with parameters mapped from FM parameters.

Solution 2

If you are not allowed to develop in system B, you cannot create the wrapper FM in target system, so in your program in system A you have to call some standard RFC enabled FM to do the same: for example BAPI_XBP_JOB_OPEN, BAPI_XBP_JOB_ADD_ABAP_STEP and BAPI_XBP_JOB_CLOSE.

Regards,

Raymond