Demonstrates the sap-qidoc-destination component running in a spring boot camel runtime.
Author: William Collins - Fuse Team
Level: Beginner
Technologies: SAP, Camel, Spring
Summary: This quickstart demonstrates how to configure and use the sap-qidoc-destination component in a Spring Boot Camel environment to send Intermediate Documents (IDocs) to SAP. This component sends documents to SAP using the Queued RFC (qRFC) protocol.
Target Product: Fuse
Source: http://github.com/punkhorn/sap-quickstarts/
This quick start shows how to integrate Apache Camel with SAP using the JBoss Fuse SAP Queued IDoc Destination Camel component. This component and its endpoints should be used in cases where a camel route is required to send Intermediate documents (IDocs) to an SAP system and ensure that the documents are processed in the SAP system in the same order that they were sent.
This quick start contains a route with an initial timer endpoint which triggers and executes that route once. The route uses processor beans to build FLCUSTOMER_CREATEFROMDATA01
type IDoc documents to create Customer records in SAP. These documents are routed to sap-qidoc-destination
endpoints which use the qRFC protocol to send these documents to the inbound queue QUICKSTARTQUEUE
in SAP. When this queue is triggered, the documents are delivered in order to the ALE subsystem in SAP which creates the Customer records. The route logs to the console the serialized contents of the documents it sends.
In studying this quick start you will learn:
- How to configure the Camel runtime environment in order to deploy the JBoss Fuse SAP Queued IDoc Destination Camel component.
- How to define a Camel route containing the JBoss Fuse SAP Queued IDoc Destination Camel component using the Spring XML syntax.
- How to use the JBoss Fuse SAP Queued IDoc Destination Camel component to send IDocs to SAP.
- How to configure connections used by the component.
For more information see:
- https://access.redhat.com/documentation/en-us/red_hat_fuse/7.0/html-single/apache_camel_component_reference/#SAP for more information about the JBoss Fuse SAP Camel components
- https://access.redhat.com/products/red-hat-fuse for more information about using JBoss Fuse
Before building and running this quick start you will need:
- Maven 3.1.1 or higher
- JDK 1.8
- JBoss Fuse 7.0.0
- SAP JCo3 and IDoc3 libraries (sapjco3.jar, sapidoc3.jar and JCo native library for your OS platform)
- SAP instance with Flight Data Application setup.
To send IDocs from the quick start's route to your SAP system, you must first configure the Application Linking Enabling (ALE) subsystem in your SAP system:
-
Using the SAP GUI, run transaction
SALE
, the ALE Implementation Guide. -
Ensure that Logical Systems for the quick start and your SAP client have been defined:
a. Run theDefine Logical System
step (Basic Systems > Logical Systems > Define Logical System).
b. ClickNew Entries
and create and save the following logical systems:| Log.System | System | | ---------- | ---------- | | QUICKSTART | QUICKSTART | | QUICKCLNT | QUICKCLNT |
c. Return to the
SALE
transaction main screen (Goto > Back). -
Ensure the
QUICKCLNT
logical system has been assigned to you SAP client:
a. Run theAssign Logical System to Client
step (Basic Settings > Logical Systems > Assign Logical System to Client).
b. Select theQUICKCLNT
for your client'sLogical system
and save your changes.
c. Return to theSALE
transaction main screen (Goto > Back). -
Ensure the destination
QUICKSTART
has been defined:
a. Run theCreate RFC Connections
step (Communication > Create RFC Connections).
b. Create a new destination (Edit > Create):
1. RFC Destination :QUICKSTART
.
2. Connection Type :T
.
3. Technical Settings :
i. Activation Type :Registered Server Program
.
ii.Program ID :QUICKSTART
.
4. Unicode:
i. Communication Type with Target System :Unicode
c. Return to theSALE
transaction main screen (Goto > Back). -
Ensure that a Model View for the message flow from the quick start to your SAP system has been defined:
a. Run theMaintain Distribution Model and Distribute Views
step (Modelling and Implementing Business Processes > Maintain Distribution Model and Distribute Views).
b. Ensure aQUICKSTART
model view has been created with the technical nameQUICKSTART
(Edit > Model view > Create).
c. Ensure theQUICKSTART
model view has a BAPI call configured (Edit > Add BAPI):- Sender/client :
QUICKSTART
. - Reciever/server :
QUICKCLNT
. - Obj.name/interface :
FlightCustomer
. - Method :
CreateFromData
.
d. EnsurePartner Profiles
have been generated for the quick start and your SAP client (Environment > Generate Partner Profiles).
- Sender/client :
To configure the quick start for your environment:
- Deploy the JCo3 library jar and native library (for your platform) and IDoc3 library jar to the
lib
folder of the project. - Ensure that the SAP Instance Configuration Configuration Parameters in the parent pom.xml file (
../../.pom.xml
) of quick starts project has been set to match the connection configuration for your SAP instance.
To build and run the quick start:
- Change your working directory to the
sap-qidoc-destination-spring-boot
directory.
- Run
mvn clean install
to build the quick start. - Run
mvn spring-boot:run
to start the Camel runtime. - In the console observe the contents of the IDoc processed by the route.
- Execute the queued IDocs waiting in the inbound queue
QUICKSTARTQUEUE
. Using the SAP GUI, run transactionSMQ2
, the Inbound Queue qRFC Monitor:
a. Select theQUICKSTARTQUEUE
queue.
b. Display the queue contents (Edit > Display Selection).
c. Select the entry for your Client connection and activate the queue (Edit > Activate). - Using the SAP GUI, run transaction
SE16
, Data Browser, and display the contents of the tableSCUSTOM
. - Search the table (Edit > Find..) for the newly created Customer records:
Fred Flintstone
,Wilma Flintstone
,Barney Rubble
, andBetty Rubble
.
To stop the camel run-time:
- Enter Ctrl-c in the console.