Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.此内容没有您所选择的语言版本。
127.9. Example 2: Writing Data to SAP
Overview 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
This example demonstrates a route which creates a
FlightTrip
business object instance in SAP. The route invokes the FlightTrip
BAPI method, BAPI_FLTRIP_CREATE
, using a destination endpoint to create the object.
Java DSL for route 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
The Java DSL for the example route is as follows:
from("direct:createFlightTrip") .to("bean:createFlightTripRequest") .to("sap-srfc-destination:nplDest:BAPI_FLTRIP_GETLIST?transacted=true") .to("bean:returnFlightTripResponse");
from("direct:createFlightTrip")
.to("bean:createFlightTripRequest")
.to("sap-srfc-destination:nplDest:BAPI_FLTRIP_GETLIST?transacted=true")
.to("bean:returnFlightTripResponse");
XML DSL for route 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
And the Spring DSL for the same route is as follows:
Transaction support 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Note that the URL for the SAP endpoint has the
transacted
option set to true
. As discussed in Section 127.5, “Transaction Support”, when this option is enabled the endpoint ensures that an SAP transaction session has been initiated before invoking the RFC call. Because this endpoint’s RFC creates new data in SAP, this options is necessary to make the route's changes permanent in SAP.
Populating request parameters 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
The
createFlightTripRequest
and returnFlightTripResponse
beans are responsible for populating request parameters into the SAP request and extracting response parameters from the SAP response respectively following the same sequence of operations as demonstrated in the previous example.