Integration Repository: Business Scenario
1. Create Context Object 2. Use Context Object in Message Interface
Context Object
Pointer to a specific element (field) within the message, for future reference
Encapsulate access to data that is contained in the payload or in the header (technical context objects) of a message
Example: in CREMAS03 (Vendor master) IDoc:
zipcode = CREMAS03/IDOC/E1LFA1M/PSTLZ
It is sometimes necessary to reference the contents of a particular message element at runtime – for instance, for a conditional Receiver Identification.
This is done with XPATH at runtime. If the XPATH statement would be complex to enter at design/configuration time, then it is easier to encapsulate the path to the data in a Context Object.
In the navigation tree of the Integration Repository the new object “Context Object“ can be found under Software Component -> Software Component Version -> Namespace -> Interface objects -> Context Objects
Details of Step 1 – Create Context Object:
Name/ namespace/ software component version (like all other repository objects)
Type (xsd:string/ xsd:int/ xsd:date/ xsd:time) – determines the “comparison type“
(lexicographically, number, date, time)
Details of Step 2 – Use Context Object in Message Interface:
Context objects are assigned to a certain position in the message interface.
©SAP AG 2004, TBIT40 03 Integration Repository 22
Agenda
Integration Repository
XI 3.0 Integration Repository Overview and concepts
Software components and namespaces Interface objects
Proxy generation Mapping objects
Business Process objects Miscellaneous
©SAP AG TBIT40 3 - 23
©SAP AG 2004, TBIT40 03 Integration Repository 23
Application System
Proxy Generation – Overview
Business Function Proxy
Integration Engine
Separation of Business Application logic from XI connectivity
Outside-in development approach
Adapter-less, out-of-the-box integration
For applications based on SAP Web AS 6.20 or above (ABAP and Java)
The Proxy Framework hides technical details from application developer
Transform language-specific data structures into XML and vice-versa
Ensure technical connectivity with the Integration Engine, guaranteed delivery
The proxy model represents a new programming paradigm for SAP systems, and is an important element of the Enterprise Services Architecture. Proxies allow you to expose arbitrary application functionality via web interfaces.
Proxies separate Business Application Logic from the Integration logic of the Exchange Infrastructure.
Proxies are generated from the WSDL description of the interface objects.
©SAP AG 2004, TBIT40 03 Integration Repository 24
Proxy Generation
Message interfaces are the basis for proxy generation
Proxy will have the same attributes as the message interface:
Inbound, outbound
Synchronous, asynchronous
Same concept for ABAP and Java, but different procedure
J2EE proxies are generated from the IR as .JAR files
ABAP proxies are generated from the application client, based on the WSDL representation of the message interface
Some rules and restrictions are in effect for the conversion of XSD Data types into Java or ABAP types, respectively
See the documentation for more details
Proxy generation converts non-language-specific interface descriptions in WSDL into executable interfaces known as Proxies. Proxies are executable interfaces in the application system. You can only create them in the system from message interfaces using the proxy generation functions. There are ABAP and Java proxies.
Java proxies are generated from the WSDL description of the interface in the Integration Repository, and the result is a .jar file containing generated java classes corresponding to the integration objects.
ABAP proxies are generated on the application server with transaction
©SAP AG TBIT40 3 - 25
©SAP AG 2004, TBIT40 03 Integration Repository 25
Create ABAP Proxies (Transaction SPROXY)
1
2
3
ABAP proxies are created in transaction SPROXY. This is executed on the Application system (not the integration server).
As part of the configuration of the Web Application Server, an HTTP
destination to the Integration Server is maintained in SM59. This allows the Application system to retrieve the WSDL description of the interface as the basis of proxy generation.
Select an interface from the list on the navigation frame, right-click, and choose Create.
You will be asked for a package (as with all ABAP development), and a prefix. In the Integration Repository, namespaces are used to avoid naming conflicts; since we have no namespaces in ABAP, we apply a prefix to our objects to generate unique names.
If there are any naming conflicts, or if the names in the Integration
Repository are too long for the ABAP objects, we will see a list of fixes in the generated objects.
©SAP AG 2004, TBIT40 03 Integration Repository 26
Generated ABAP Objects
Message interfaces can have the mode synchronous or asynchronous.
Furthermore, the type of the message interface determines what type of proxy is generated.
The counterparts to outbound message interfaces in application systems are client proxies. They are called to send a message to an inbound interface. An outbound message interface is mapped to an ABAP object class (prefix CO_).
The counterparts to inbound message interfaces in application systems are server proxies. The proxy generation functions generate an ABAP object interface (prefix II_) for an inbound message interface; you must implement this interface using an ABAP object class to make this service available.
Example: Client proxy (class) generated from Outbound Message Interface
The system generates methods with the following names, depending on the type of communication:
In the case of synchronous interfaces, the method is called EXECUTE_SYNCHRONOUS
In the case of asynchronous interfaces, the method is called EXECUTE_ASYNCHRONOUS
The following can be established for both outbound and inbound message interfaces:
The output message type becomes a parameter with the name OUTPUT. The input
message type becomes a parameter with the name INPUT. OUTPUT refers to an outbound message, INPUT to an inbound message. Both parameters are structures of the respective message type with a field for the data component of the message.
©SAP AG TBIT40 3 - 27
©SAP AG 2004, TBIT40 03 Integration Repository 27
Java Proxy Wizard
To generate proxies for java applications, right-click on the interface in the Integration Repository and choose Java Proxy Generation. This launches a wizard to start the generation process
Specify if this is a new proxy or a regenerated proxy; if the interface is changed after a proxy has been generated, you must regenerate the proxy and recompile the generated java classes.
Select the software component version that contains the interfaces to use as the basis of proxy generation.
Select the message interfaces to use as the basis of proxy generation.
Verify that the selected data are correct. If they are, you can choose Finish to generate the java classes, or Cancel to exit the wizard.
©SAP AG 2004, TBIT40 03 Integration Repository 28
Agenda
Integration Repository
XI 3.0 Integration Repository Overview and concepts
Software components and namespaces Interface objects
Proxy generation Mapping objects
Business Process objects Miscellaneous
©SAP AG TBIT40 3 - 29
©SAP AG 2004, TBIT40 03 Integration Repository 29
<hh:book-flight xmlns:hh="...">
Transformation From One Message Structure To Another
Transformation Rules Defined By Mapping Program
Structure Mapping Value Mapping
When different interfaces are used in an integration scenario, we must provide a mapping to transform the structures of the interfaces.
©SAP AG 2004, TBIT40 03 Integration Repository 30
Mapping Techniques In XI
Message mapping
Graphical design and test environment
Queue-based model allows handling of very large documents
Extensible via Java user-defined functions
XSLT
Open standard
Portable
Extensible via Java user-defined functions
Memory overhead for very large documents
Java
Flexibility of Java programming language
Java mapping program is responsible for parsing/rendering XML
ABAP
Leverage existing ABAP base
ABAP mapping program is responsible for parsing/rendering XML
Different mapping techniques are available in the XI:
The Integration Repository includes a graphical mapping editor. It includes built-in functions for value transformations and queue and context handling. There is an interface for writing user-defined functions as well.
XSLT mappings can be imported into the Integration Repository; java methods can be called from within the XSLT stylesheet.
If the transformation is very complex, it may be easiest to leverage the power of Java for mapping.
ABAP mapping programs can also be written to transform the message structures.
©SAP AG TBIT40 3 - 31
©SAP AG 2004, TBIT40 03 Integration Repository 31
Mapping Objects: Message Mapping
Graphical mapping tool
Graphically define mapping rules between source and target message types
Queue-based model allows for handling of extremely large documents
Drag-and-drop
Generates internal Java code
Built-in and user-defined functions (in Java)
Integrated testing tool
N:M mapping possible – for use with BPM only!
SAP XI provides a graphical mapping tool (see next slide) that generates a java mapping to be called at runtime.
©SAP AG 2004, TBIT40 03 Integration Repository 32
Message Mapping: Mapping Editor
Data-Flow Editor Structure Overview
Source Structure Target Structure
Target Field Mapping
The source message appears on the left-hand side of the screen, and the target message appears on the right. Associations between fields in the source and fields in the target can be easily created by dragging the mouse cursor from one to the other.
Functional transformations can be made using a library of built-in functions, including String, Arithmetic, Statistical, Node, Conversion, etc., functions.
There is also a function editor that lets you write user-defined Java functions.
All required fields in the target structure are flagged red; the mapping editor insures that the finished mapping program constructs a valid instance of the
©SAP AG TBIT40 3 - 33
©SAP AG 2004, TBIT40 03 Integration Repository 33
Mapping Objects: Interface Mapping
Representation of the mapping at the interface level
Assign mapping program(s) between source and target message types:
Message mapping
XSLT mapping
Custom Java mapping
ABAP mapping
Mapping programs can be combined in a sequence
N:M interface mapping possible (for use with BPM only!)
For synchronous interfaces, a request and response mapping can be provided
An interface mapping registers a pair of interfaces for use in a scenario, and specifies the message mapping(s) to be used.
Mapping programs can be called sequentially
©SAP AG 2004, TBIT40 03 Integration Repository 34
Mapping Objects: Imported Archives
The object type ‘imported archive’ is for importing externally defined programs into the Integration Repository:
XSLT stylesheets
Java mappings
Java extensions to XSLT mappings
Java classes to be imported in a user-defined function for message mapping
All files to be imported must be archived (JAR format)
The archive is uploaded from user workstation.
Integration Repository can serve as central maintenance location for imported objects
XSLT and text files can be edited directly from IR.
Java CLASS files must be edited and recompiled locally, then re-imported.
If a mapping is too complex, it may simpler to effect a mapping in a Java program, or an XSLT stylesheet; or you may have previously built such mappings (for instance, using XSLT in the SAP Business Connector). In this case, the mappings can be imported into the Integration Repository.
The mapping programs (Java or XSLT) must be zipped into a .jar file before being imported.
XSLT stylesheets must have a .xsl extension in the jar file.
©SAP AG TBIT40 3 - 35
©SAP AG 2004, TBIT40 03 Integration Repository 35
Agenda
Integration Repository
XI 3.0 Integration Repository Overview and concepts
Software components and namespaces Interface objects
Proxy generation Mapping objects
Business Process objects Miscellaneous
©SAP AG 2004, TBIT40 03 Integration Repository 36
describes a complete collaborative process from the XI point of view
main focus on the complete message exchange
describes only the public part of the process
An Action
describes a function (a process) within one component that is involved in the message exchange
refers to the interfaces that can be used to perform that function
may be used by one or more business scenarios
Business Scenarios describe the choreography of interfaces and connections between actors in a message exchange.
Software Products play roles in Business Scenarios, and are assigned to
“swim lanes” in the Business Scenario editor.
Within each Software Product, Actions represent concrete actions of the scenario and refer to Message Interfaces in the Integration Repository.
The connections between actions represent the actual exchange of
messages, and relate to the mappings created in the Integration Repository.
©SAP AG TBIT40 3 - 37
©SAP AG 2004, TBIT40 03 Integration Repository 37