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.
Showing results for 
Search instead for 
Did you mean: 

Schedule a program in Background job in RFC connected system

0 Kudos


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.




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.


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.?



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.

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.


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.