During my current project, I had to schedule a business process. The process should run periodically (might be once in every 30 min/ 1 hr/ Everyday/ Every Weekend depending upon the requirement in various scenario’s).
Note: Refer to prerequisites mentioned at the end of the blog
Integration process cannot be scheduled to start at a certain time or date. An integration process can be started only by means of a corresponding message. So a dummy message can be used to start the process. But where will this message come from…?
The message can be delivered to the BPM by any external application by configuring the adapter channel properly. For example, a File adapter can be configured to poll a File Service/ System and dummy file can be delivered to XI (in turn to BPM). The BPM can even be started on receive of Dummy message from a DB System. In such cases the process (scheduling of the process) is dependent upon the polling interval of the channel used to trigger the BPM.
What if the external application goes down due to network problems or is shutdown for maintenance? Also how can you handle the process if it should not be executed on holidays and Sundays..? You have no control on adapter processing’s. You cannot restrict the adapter from sending the message to BPM on holidays or Sundays…? So look for alternative where you do not need to rely upon external systems to trigger your BPM and at the same time have full control on the process.
Usage of SAP’s Job scheduling mechanism is an appropriate solution for this business requirement. ABAP Proxies come in handy to realizing the solution. An ABAP Report is scheduled by SAP’s Job Scheduling mechanism to trigger the Client Proxy (generated for the Out bound Interface of Receive step in BPM). This ABAP Report will send a dummy message to XI (which in turn is sent to BPM) to start the Integration process.
Sequence of Steps:
- Create a Dummy Message Interface (Outbound Interface & Abstract Interface) and the corresponding Data Types, Message Types for it.
- Use this Dummy Message Interface (Abstract type) in BPM (in Receive step) that starts the Integration process.
- Use SPROXY (Tcode) to generate Client Proxy for the Dummy Message Interface (Outbound Interface).
Note:Refer to “Links of help” at the end to “Generate Client Proxies”
- Save and Activate your Proxy Objects
- Write an ABAP Report (Go to SE38 to write the ABAP Report) to trigger the Client Proxy.
- Go to a Client 105 (Other than IS) and execute the ABAP Program. Go to sxmb_moni and see if the process has been successful.
- Go to sm36, and use Job Wizard to schedule the ABAP Program
Note:Refer to “Links of help” at the end to “know more about Scheduling of ABAP Program”
- Use sm37 to monitor the scheduled process.
Scheduling of ABAP Program:
This is also a practical application of ABAP Proxies in integration world.
Client copy has to be created and necessary configurations should have been made to point to integration server.