Posted: Wed Oct 24, 2007 10:52 pm Post subject: Basic Principles of the SAP Connector
Basic Principles of the SAP Connector
Core Engine of the SAP provider is the SAP RFC processor, which executes a XML coded function call on the back end via the SAP Java connector (JCO). The results of the RFC call is transformed to a XML coded payload.
Necessary information to connect to the back end (e.g. Server address, user data, etc) are defined in a Datasource, which can be configured via properties of the SAP connector. All these structures are embedded into Mule via the corresponding interfaces.
Implementation notes
The Java class BAPIConnector implements the core module of the SAP provider and extends AbstractServiceEnabledConnector.It encapsulates the SAP DataSource. The RFC call is implemented in the class BAPIMessageReceiver which inherits the Mule standard class PollingMessageReceiver.Its method poll() triggers periodically parses the XML script via SAX and fills up necessary JCO structures in the class RFCContentHandler. In its method endDocument() finally, the RFC is executed based on JCO.
The processing of the results - please note, that exception handling still is rudimentary - is done via RFCResultAsXMLImpl. Its structure is identical to the SE37 notation.
For the BAPI RFC_READ_TABLE additional classes were implemented to enable the access to SAP tables (nearly) without writing any Java code.
The class TableTransformer allows the transformation of the XML stream of RFC_READ_TABLE into either a simple value object via reflection or into a collection of HashMaps, where each HashMap represents a single line of the SAP table.
Currently no exception handling is implemented.
The SAP Connector
The following properties are defined on the com.comino.mule.providers.sapr3.BAPIConnector class.
Property
Description
Required
Polling
Polling frequency in ms
Yes
Property Map
Name
Login
Provides connection data for the back end connection
Property
Description
Required
Client
SAP client number
Yes
User
RFC User
Yes
Password
RFC User password
Yes
Language
Log on Language of the established back end connection
While <frc_function> describes the RFC enabled function module in SAP, the file <rfc_config> provides all necessary parameters of the functions module according to SE37.
The example account.xml describes all parameters for the function module:
Container for export elements (used for return values only)
-
tables
Container for tables
-
structure
Container for fields
@name: Name of the structure (optional)
table
Container for rows
@name: Name of the table (required)
Row
Container for structures or fields
@id: Row number of the table row (optional)
Field
Data field
@name: SAP name of the field (required)
Static parameters can be replaced by system variables, e.g. for common parameters like period/year, etc. Additionally parameters can be passed to the RFC via the endpoint definition.
Plain java value class. The setter/getter of this class must match the data-element name of the SAP table. Only matching columns are transformed.
No
If no property is specified, the transformer returns a collection of HashMaps, where a HashMap represents a single entry of the SAP table. Column values can be accessed via the data-element name of the SAP table.
If a Java class is defined as value object, the transformer returns a collection of filled value objects.
The CollectionBridge Component
The purpose of the com.comino.mule.components.CollectionBridgeComponent component is to split a collection into single mule events for further processing.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.