Running a R/3 job in BW process chain (finishing SDN)

Source: Internet
Author: User
Tags rfc

It may be useful to use ABAP to schedule jobs in other systems asynchronously. The principle is similar to scheduling event on R3 on BW side,

The event returns a successful or failed status to the BW process chain.

The detailed process in the following section is derived from Sdn.

 

 

You can create a job in R/3 to be triggered "after event". Then in your process chain, you create an ABAP process:

Call mode: asynchronous

Called from: Destination (your R/3 system)

Scheduled Program: (put in R/3 event name)

 

The trick is that in R/3, you will need to create an ABAP program that executes function module rspc_abap_finish (with parm of the name of the ABAP process in the process chain ). this signals the process chain, that the ABAP process is complete (for asynchronous
ABAP processes, the process chain will wait for user intervention before going to the next step in the process chain ). when you save the ABAP process in the process chain, you will receive a warning saying that you must call the rspc_abap_finish function module
To tell process chain that the ABAP process finished.

 

Source Document

 

 

In R/3 create an event (let's call it zstartjob). sm62

 

In BW, in your process chain, create an ABAP process with the following parameters:

Call mode: asynchronous

Called from: Destination (your R/3 system)

Scheduled Program: zstartjob

 

In R/3, create an ABAP program which will signal your process chain in BW, that your ABAP process has finished. Your code can look like this:

Report zrspc_abap_finish.
 
*"----------------------------------------------------------------------
* "*" Lokale schnittstelle: detination BW
* "Importing
* "Value (I _variant) type rspc_variant
* "Exceptions
* "Already_finished
*"----------------------------------------------------------------------
 
Parameter: p_rfc like rfcdes-rfcdest,
P_var (30) type C.
 
Call function 'rspc _ abap_finish'
Destination p_rfc
Exporting
I _variant = p_var
Exceptions
Already_finished = 1
Others = 2
.
If SY-SUBRC 0.
* Message ID SY-MSGID type SY-MSGTY number SY-MSGNO
* With SY-MSGV1 SY-MSGV2 SY-MSGV3.
Endif.

This program will prompt for RFC destination (which will be your BW system) and a variant (which will be the name of the ABAP process variant in your process chain ). so create a variant for this ABAP program to save these values (Lets call the variant (r3_finish ).
This will allow you to call this program in a background job. So ....

 

Now create your background job in R/3. Schedule it to execute "after event" zstartjob. The last step in this job is to call zrspc_abap_finish with the variant r3_finish. sm36

 

The result will be when you execute your process chain, the ABAP process in BW will trigger the event in R/3 which will start your R/3 job. when your R/3 job finishes and executes the zrspc_abap_finish program, the ABAP process in your process chain will
Be set to "green" and your process chain will continue to the next process.

 

Source Document

 

Zrpsc_abap_finish is an ABAP program (not a function module) which you need to create. the function module is rspc_abap_finish and exists in BW. you are executing the function module from R/3 which is why you need to specify an RFC destination in your R/3
Program.

 

Source Document

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.