Running a R/3 Job in BW Process Chain(整理SDN)

使用ABAP异步调度其他系统的JOB,也许会有用吧。原理类似于在BW端调度R3端的EVENT,

然后该EVENT会返回一个成功或者失败的状态给BW的PROCESS CHAIN。

下文中有详细的过程,源自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.

 

源文档 <http://forums.sdn.sap.com/thread.jspa?messageID=4057356>

 

 

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 SY-MSGV4.
    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.

 

源文档 <http://forums.sdn.sap.com/thread.jspa?messageID=4057356>

 

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.

 

源文档 <http://forums.sdn.sap.com/thread.jspa?messageID=4057356>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值