Why BPM Scheduling
Suppose you have a business case to transfer bulky data from your legacy database to ERP system at 6am daily. Unfortunately, JDBC sender channel does not promise when exactly this activity will be triggered every day (hopefully in the future patches it will do). For this, another approach, which combines the use of client proxy and BPM, has been discussed in Siva Maranani’s post. As you will see, this approach looks a bit tedious but does help me to meet the scheduling requirement.
A big picture
As depicted, this approach comproises the following steps:
- Use SM36 Job scheduling mechanism to schedule a report which sends a trigger message to BPM via client proxy. For this, you need to create another client (I call it ABAP proxy client) within the XI server, since IS client can not send a message to itself.
- From BPM, the integration process is triggered and starts processing the JDBC requests and subsequently send the results to ERP system.
The realization of this approach requires some basis configuration, ABAP coding, as well as BPM development. The following is the end-to-end implementation story in my project.
Prepare an ABAP proxy client
- Suppose your Intergration Server runs on client 001. Let us call it IS client.
- In SCC4, create a new client (say client 002) via client copy with Customizing option. This client acts like an Application System to generate ABAP proxy calls to IS client.
- In BD54, create a logical system (say XGSCLNT002) to assign to client 002.
- Log on to client 002 with SAP_ALL dialog user.
- In SM59, create a type H destination with the host name (localhost) and the HTTP port of the Integration Server. Note that the HTTP port refers to ICM port, instead of J2EE port, in this case.
- Under Technical Settings tab, enter “/sap/xi/engine/?type=entry” as the Path Prefix.
- Under Logon & Security tab, select “SAP Standard” as authentication method. The logon user must exist in your IS client as an Application Service user.
- When you try to save this destination, the system will prompt a warning message indicating “Query String not allowed”. Simply press enter to ignore this warning, and save the destination again.
- Perform connection test. The following screen indicates a successful test result.
- Now you are going to configure the local Integration Engine in client 002. Go to SXMB_ADM -> Integration Engine Configuratin.
- Specify “Application System” as the role of business system.
- For “Corresponding Intg. Server”, enter “dest://INTEGRATIONSERVER” to point to the HTTP destination we just created.
- Application Server utilizes sender queues (XBTS*) to communicate with Integration Server. Therefore, go to SXMB_ADM -> Manage Queue, and register the sender queues.
- In SLD, create a Business System representing client 002
- Under “Installed Products” tab, include the necessary SWCVs for your implementation scenario.
Implement a simple scenario
This simple BPM example serves as your appetizer only. You can extend your own Integration Process to handle JDBC or file pulling. 🙂
Configuration in Integration Repository
- As shown, the Integration Process (ip_abap_proxy_test_msg_sent_xgs_02) contains only a Receive step to accomodate the trigger message.
- Define a message type for your trigger message.
- Define an abstract message interface (mi_proxy_test_abs_async) to be used in your Integration Process.
- Likewise, define the corresponding outbound message interface (mi_proxy_test)
- Category: Outbound
- Mode: A synchronous
- Message Type: mt_proxy_test
Configuration in Integration Directory
- Import the business system representing the ABAP Proxy client from SLD. You need it to define Receiver/Interface determination later.
- Flip to the Sender tab and you should be able to locate the outbound message interface we created in IR.
- Define Receiver/Interface Determination like the following:
- Sender service: XGSCLNT002
- Sender interface: mi_proxy_test
- Receiver server: ip_abap_proxy_test_msg_sent_xgs_02
- Receiver interface: mi_proxy_test_abs_async
- Mapping program: not required
- Receiver agreement: not required
- Log on your IS client (client 001).
- Go to SPROXY. Drill down to the corresponding outbound message interface (mi_proxy_test). In the context menu, click on “Change/Regenerate” to generate the ABAP classe for the client proxy.
- Likewise, generate ABAP structures from your message type and data type.
- Test your proxy interface from menu Proxy->Test Interface. The following screen depicts a successful result.
Write a report to send an async message via client proxy
- Basically the report instantiates the client proxy, and triggers an aynchronous message by calling its execute_asynchonous method.
- To debug and test your report, log on to your ABAP proxy client, instead of IS client.
Schedule your report from ABAP proxy client
- Log on to client 002.
- In SM36, define a background job.
- Create a step for the ABAP report ZBLOG_ABAP_PROXY.
- Specify start date/time and recurring period.
Verify your scenario
- Log on to IS client (client 001)
- In SXI_MONITOR, locate a corresponding process ID. The following screen indicates the successfully completion of a scheduled job.
- Siva Maranani’s blog – How to Schedule your BPM
- SAP library – ABAP Proxy Runtime
- SAP library – Sending a Message (via client proxy)
Last but not least, special thanks to Mr. Li Huai Liang, Liu Bing and Joh for helping me in various ways to make this story complete.