使用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>