Upload
dhibu
View
99
Download
3
Embed Size (px)
Citation preview
© SAP AG 2004
TADMBO Implementation&Operation II
THE BEST-RUN BUSINESSES RUN SAP
© SAP AG 2004
TBIT44Mapping, Adapters and BPM
SAP Exchange Infrastructure 3.0
TBIT44 Mapping/Adapters/BPM
© SAP AG 2004, TBIT44
Lecture topics
Topics
Mappings
Adapter
ccBPM
TBIT44: Mapping pattern
© SAP AG 2002, Title of Presentation, Speaker Name 2
Mapping Patterns
Mapping “patterns” are some of the common mapping requirements we found in the past which XSLT was used, because we did not think that Message Mapping provided the functionality
SummarizationSequence–Number GenerationDuplicating SubtreesTable / Value LookupsTree–Reversal
© SAP AG 2002, Title of Presentation, Speaker Name 3
Mapping Patterns – Summarization (I)
Summarization is when we try to consolidate detailed information into total/subtotals and counts.
The count and sum functions will act on the content of a context. Therefore, the context of the group to be summarized must be selected appropriately.
Example:
Source: Order details containing customer, order numbers and order amount
Target: Total and count the order by each customer and a summary of all orders
© SAP AG 2002, Title of Presentation, Speaker Name 4
Mapping Patterns – Summarization (II)
© SAP AG 2002, Title of Presentation, Speaker Name 5
Mapping Patterns – Summarization (III)
Mapping Result:
© SAP AG 2002, Title of Presentation, Speaker Name 6
Mapping Patterns – Sequence–Number Generation (I)
There are situations when sequence numbers had to be generated based on the number of occurrences of the source data. This is frequently used during mapping to SAP IDocs or BAPIs when item number, which is no available from the source, had to be entered.
Example:
Source: Order information.
Target: Two complex elements had to be populated from the source. Each one contains a sequence number which matches the position of the data in the source.
Sequence number to be generated.
© SAP AG 2002, Title of Presentation, Speaker Name 7
Mapping Patterns – Sequence–Number Generation (II)
There are two ways the sequence number can be generated.
1. Use Advanced User–Defined function to generate the sequence number all at once.
2. Use Simple User–Defined function to generate the sequence number for each occurrence separately, keeping track of the sequence number value previously generated.
© SAP AG 2002, Title of Presentation, Speaker Name 8
Mapping Patterns – Sequence–Number Generation (III)
1. Use Advanced User–Defined function to generate the sequence number all at once.
The java function creates the sequence number all at once based on the number of elements in the source.
The sequence numbers are written to the ResultList object.
© SAP AG 2002, Title of Presentation, Speaker Name 9
Mapping Patterns – Sequence–Number Generation (IV)
1. Use Advanced User–Defined function to generate the sequence number all at once.
© SAP AG 2002, Title of Presentation, Speaker Name 10
Mapping Patterns – Sequence–Number Generation (V)
1. Use Advanced User–Defined function to generate the sequence number all at once.
Test Results:
© SAP AG 2002, Title of Presentation, Speaker Name 11
Mapping Patterns – Sequence–Number Generation (VI)
2. Use Simple User–Defined function to generate the sequence number for each occurrence separately, keeping track of the sequence numbervalue previously generated.
The sequence number is stored in the container object. Each time it is retrieved, incremented and saved.
Note: There is no input required.
© SAP AG 2002, Title of Presentation, Speaker Name 12
Mapping Patterns – Sequence–Number Generation (VII)
2. Use Simple User–Defined function to generate the sequence number for each occurrence separately, keeping track of the sequence numbervalue previously generated.
We cannot display the queue to examine the result of the mapping.
© SAP AG 2002, Title of Presentation, Speaker Name 13
Mapping Patterns – Sequence–Number Generation (VIII)
2. Use Simple User–Defined function to generate the sequence number for each occurrence separately, keeping track of the sequence numbervalue previously generated.
© SAP AG 2002, Title of Presentation, Speaker Name 14
Mapping Patterns – Duplicating Subtrees (I)
Even if elements are shown to occur more than once in the XML instance according to XML Schema Definition, they are only displayed once in the structure overview.
To assign source field(s) to multiple positions of an element in the target structure, the element or the entire subree can be duplicated (copied) using the context menu in the target structure.
Example:
Source: Accounting information with adjustment type and amount.
Target: Two CurrencyAmt’s are to be created. One is to credit one account. The other is to debit another account. The amount will either be positive or negative depending on the ADJTYPE.
© SAP AG 2002, Title of Presentation, Speaker Name 15
Mapping Patterns – Duplicating Subtrees (II)
The subtree “CurrencyAmt” must be duplicated first. This will create 2 CurrencyAmt’s. One for credit, and one for debit.
© SAP AG 2002, Title of Presentation, Speaker Name 16
Mapping Patterns – Duplicating Subtrees (III)
© SAP AG 2002, Title of Presentation, Speaker Name 17
Mapping Patterns – Duplicating Subtrees (IV)
Mapping Results:
© SAP AG 2002, Title of Presentation, Speaker Name 18
Mapping Patterns – Table/Value Lookup (I)
During mapping, a lookup is necessary in a different subtree structure of the XML document. This lookup process is easily accomplished using XSLT, since we can navigate the XML document using absolute or relative “path” specification. In Message Mapping, there is no facility to navigate the XML document.
In Message Mapping, we have to use the context of the different elements required for the lookup. A Java function will be needed to perform the comparisons. And, the matched values will have to be written to ResultList.
Example:
Source: Contains credit card information, with 2 subtrees. One is account information (including account number, cost center, sub–account, card type, etc.) The 2nd subtree contains detailed billing information (including account number, date, billing amount, etc.)
Target: Contains only detailed billing information, but with each billing record, the cost center, sub–account and card type from the account info record must also be included. The account number in the detail is used to do the lookup of the account information records.
© SAP AG 2002, Title of Presentation, Speaker Name 19
Mapping Patterns – Table/Value Lookup (II)
Target:Source:
=
© SAP AG 2002, Title of Presentation, Speaker Name 20
Mapping Patterns – Table/Value Lookup (III)Java Function:
The lookup’d value must be written to the ResultList.
© SAP AG 2002, Title of Presentation, Speaker Name 21
Mapping Patterns – Table/Value Lookup (IV)
Contexts must be set a root level.
Mappings for all 3 elements are identical, except for the element names.
© SAP AG 2002, Title of Presentation, Speaker Name 22
Mapping Patterns – Table/Value Lookup (V)
Mapping Results:
© SAP AG 2002, Title of Presentation, Speaker Name 23
Mapping Patterns – Tree–Reversal (I) Below is a mapping scenario which reverses the parent and child nodes. A “reverse” summarizations is also performed.
Source document: Target document:
The products are to be sorted and totaled by prices with the ORDERID listed.
© SAP AG 2002, Title of Presentation, Speaker Name 24
Mapping Patterns – Tree–Reversal (II)
The source document is organized by ORDERID, ITEM and price. The same product can occur in more than 1 orders.
The target document is summarized by product with a total price and listed within each product all the ORDERIDs. The same ORDERIDs can occur in more than 1 products.
The mapping needs to reverse the organization of the source document.
Based on that, the following needs to be done using the contexts/queues used by Message Mapping:
1. Get a list of all the products. Since the same product can be in multiple orders, we must eliminate the duplicates, and, then, sort them.
2. Sum the prices by product and assign those totals to the products in their sorted order.
3. Examine all the ORDERIDs and determine which ORDERIDs contain each of the products in the sorted list. Then, assign those ORDERIDs to the products.
© SAP AG 2002, Title of Presentation, Speaker Name 25
Mapping Patterns – Tree–Reversal (III)
Three Java functions were written to:
1. Extract the products, eliminate duplicate names, and sort them in alphabetical order.
© SAP AG 2002, Title of Presentation, Speaker Name 26
Mapping Patterns – Tree–Reversal (IV)
2. Total the prices and assign the total to the appropriate products.
© SAP AG 2002, Title of Presentation, Speaker Name 27
Mapping Patterns – Tree–Reversal (V)
3. Retrieve all the orderids and assign them to the appropriate products.
Note:
“Cache Entire Queue” is checked.
When the product is being retrieved, the Context Change is skipped.
The Context Change is added to the ResultList.
© SAP AG 2002, Title of Presentation, Speaker Name 28
Mapping Patterns – Tree–Reversal (VI)
Mapping for ITEM: To create the number of elements.
© SAP AG 2002, Title of Presentation, Speaker Name 29
Mapping Patterns – Tree–Reversal (VII)
Mapping for the attribute NAME, which is the product name.
© SAP AG 2002, Title of Presentation, Speaker Name 30
Mapping Patterns – Tree–Reversal (VIII)Display Queue for determining NAME:
© SAP AG 2002, Title of Presentation, Speaker Name 31
Mapping Patterns – Tree–Reversal (IX)
Mapping to create the number of element for ORDERS_WHERE_ITEM_IS_FOUND.
© SAP AG 2002, Title of Presentation, Speaker Name 32
Mapping Patterns – Tree–Reversal (X)
Mapping for the attribute TotalSalesFOrThisItem, which totals the prices by product name.
© SAP AG 2002, Title of Presentation, Speaker Name 33
Mapping Patterns – Tree–Reversal (XI)
Display Queue for determining TotalSalesFOrThisItem:
© SAP AG 2002, Title of Presentation, Speaker Name 34
Mapping Patterns – Tree–Reversal (XII)
Mapping for the element ORDERID, which will be listed by product name.
© SAP AG 2002, Title of Presentation, Speaker Name 35
Mapping Patterns – Tree–Reversal (XIII)Display Queue for determining ORDERID:
© SAP AG 2002, Title of Presentation, Speaker Name 36
Mapping Patterns – Tree–Reversal (XIV)
Partial listing of the mapping results:
CPA Cache
© SAP AG 2004, TBIT44: Adapters: CPA Cache / 2
Learning Objectives
As a result of this unit, you will:
Understand the basics of CPA Cache, including:ConfigurationMonitoringTroubleshootingManual refresh
© SAP AG 2004, TBIT44: Adapters: CPA Cache / 3
Cache overview
Integration Server
IntegrationEngine
BusinessProcessEngineCache
TA: SXI_CACHE•Delta
•Full (only on request)
IntegrationDirectory
Integration Builder
IntegrationRepository
Central AdapterEngine
Run
time
Acc
ess
•Business Processes•Mappings•Adaptermetadata
Cac
he U
pdat
eC
ache
Upd
ate
CacheJ2EE: CPACache
•Delta•Full via URL
SLD CacheBusiness systems
SLD CacheSoftware
componentsversions “Based
On”
Business systemSLD Cache “Own Business system”•Activate Changelist
•Import•Request Cache update again
•Business Process Configuration•Routing Rules•Collaboration Agreements•Collaboration Profiles
Local Adapter Engine
Adapter Framework
CacheJ2EE: CPACache
•Delta•Full via URL
SLD Cache “Own Business system”
Repository Cache
Adapter Meta data
© SAP AG 2004, TBIT44: Adapters: CPA Cache / 4
CPA Cache in general
cache for Directory & Repository data (CPACache)
cache is filled during activation within directory(process described at the end of the document)
contains objects from directory
• services• parties• bindings (inbound/outbound; sender/receiver
agreements)• channels• adapter metadata• module configuration
used in adapter framework during runtime
© SAP AG 2004, TBIT44: Adapters: CPA Cache / 5
CPA Cache – display content
data can be seen in the CPACache Monitor
(not accessible per default)
http://<host>:<J2EEport>/CPACache
© SAP AG 2004, TBIT44: Adapters: CPA Cache / 6
CPA Cache – display content (2)
displays objects relevant for adapter framework during runtime
© SAP AG 2004, TBIT44: Adapters: CPA Cache / 7
CPA Cache: Registration/Push vs. Pull
Registration/Push Mode(automatically or manual)
PULL-Mode (Delta or Full Refresh)http://<host>:<port>/CPACache/refresh?mode=delta|full
© SAP AG 2004, TBIT44: Adapters: CPA Cache / 8
CPA Cache refresh
manual refresh via URL with user “XIDIRUSER”
http://<host>:<J2EEport>/CPACache/refresh?mode=full
© SAP AG 2004, TBIT44: Adapters: CPA Cache / 9
CPA Cache refresh – in detail
AdapterEngine
Notificationhandler Notif Directory
ObjectRepository
ObjectChangelist
handler
Updaterunning
Get object ids
Get Object
Get object from repository
OK / OK with errorsGeneralstatus
Notiferror
Error Statusof single objects
RuntimeCache
Update
XIAFuser XIDIRuser
Directory RepositoryAdapter Engine
© SAP AG 2004, TBIT44: Adapters: CPA Cache / 10
CPA Cache - Registration
SLD
AE CPA Cache
1
Change in XI ID
2 54
3
© SAP AG 2004, TBIT44: Adapters: CPA Cache / 11
CPA Cache: Schema Upload
Messaging system
© SAP AG 2003, Title of Presentation, Speaker Name / 2
Learning Objectives
As a result of this unit, you will:
Understand the basics of the messaging system, including:
Messaging System overviewMessage flowImplementation of different adapters
© SAP AG 2003, Title of Presentation, Speaker Name / 3
Messaging system overview
XIIS
Adapter Engine
Module Processor
exitStructure conversion Other...
DBIB Directory
Store
API
CPA Cache
Receive/Send Queue
Scheduler retry/EO
Sequencer for EOIO
CPA Cache
SPI
Cache updateXML
Technical adapters
File/JDBC/JMS/ Mail
Other adapters without protocol handlerRFC/SOAP/3rd party
Adapter with protocol handler
RNIF/BC/CDIX
XI message
Protocol handler
ListenerBean
exit
MML/BC …message
XI message
XI message
XI message
XI “adapter”
Protocol handler
XI message
Configuration Configuration
PCK
AFW ListenerBean•Read agreements•Read channels
XI message
SPI
servletservlet
ConvertBean
(Adapter specific)
MML/BC …message
URL URL
Send via HTTP Send via HTTP
© SAP AG 2003, Title of Presentation, Speaker Name / 4
Message status in MDT - Prerequisites
Open Runtime Workbench (RWB)Select Message Monitoringselect adapter engine
© SAP AG 2003, Title of Presentation, Speaker Name / 5
Example
you can use a simple file sender / receiver scenario to test the display of status
Start (activate) the sender and receiver channel
Start (activate) only the sender channel, deactivate receiver channel
Start (activate) the receiver channel againpress button after selecting the message in “wait” mode
© SAP AG 2003, Title of Presentation, Speaker Name / 6
Status overview of messages in MDT
NDLVD
TBDL
HOLD
DLNG
WAIT
DLVD
FAIL
Delivery exception
Worker thread
Scheduler/ Admin action
successful
Recoverable exception
Max. retries exceeded
EOIO, wait for other message
Admin action
TBIT44: BPM
Exercise 2:Sales Order Processing
© SAP AG 2004, SAP NetWeaver Henrik Stotz 2
Use Case
ERP
Dealer Management System Supplier 1
CRM/Catalog
OrderFulfillment
Dealer Management System Supplier 3
ERPDealer
XI/BPM
CRM
Dea
ler M
anag
emen
t Sys
tem
Sup
plie
r2
Catalog
OrderSystem
OrderSystem
OtherSystem
OtherSystem
OtherSystem
OtherSystem
OtherSystem
EBP+„No-name“
Catalog
No-nameSupplier1
No-nameSupplier2
No-nameSupplier3
CRM
OtherSystem
© SAP AG 2004, SAP NetWeaver Henrik Stotz 3
ERP
Dealer Management System Supplier 1
Catalog/CRM
OrderFulfillment
ERPDealer
XI/BPM
© SAP AG 2004, SAP NetWeaver Henrik Stotz 4
OverviewCRM System AirlineGroup1
AirlineGroup2Travel AgencySummer
Integration Process
Send items 1. Receive orderitems
2. Preparations
3. Create materialsif necessary
Create materials
4. Create purchase and sales order
Create purchase and sales order
5. Send purchase order to supplierand receive confirmation
Receive ordersend confirmation
Preparations
© SAP AG 2004, SAP NetWeaver Henrik Stotz 5
Integration Process
1 2 3
4 5
© SAP AG 2004, SAP NetWeaver Henrik Stotz 6
Web Dynpro User Interface
© SAP AG 2004, SAP NetWeaver Henrik Stotz 7
Exercise 1: Receive Spare Part Items
Collect pattern:Items correlated by CustomerNoEnd condition:
after sending 3 items
Asynchronous Web Dynpro - XI Communication using SOAP Adapter
© SAP AG 2004, SAP NetWeaver Henrik Stotz 8
Exercise 2: Preparations
Transformation step
Synchronous send step
catches application and
system exceptions
Returns a list of materials that have
to be created
Application exception
© SAP AG 2004, SAP NetWeaver Henrik Stotz 9
Exercise 3: Create Materials
Material1
Material2
System1System2
System1System2
© SAP AG 2004, SAP NetWeaver Henrik Stotz 10
Exercise 4: Create Purchase and Sales Order
• Fork for parallel processing• Transport and application acknowledgments• Using send contexts• Correlation• Container operations• Switch• “Manual Exception Handling”
© SAP AG 2004, SAP NetWeaver Henrik Stotz 11
Exercise 4: Create Purchase and Sales Order
Purchase order errorcan be correctedin a given timeframeby starting the reportmanually
Report executed in time. Message sent to the process indicating the that purchase order is ok. The process PurchaseOrder status is updated.
“manual compensation”
© SAP AG 2004, SAP NetWeaver Henrik Stotz 12
Exercise 4: Create Purchase and Sales Order
If an error in the purchase order is not compensated “manually” (see last slide), the Purchase Order Status flag keeps the status ERROR for the process. If the timeout occurs, the process continues and runs into “automatic compensation”.
If either the purchase order OR the sales order run into an error, the “automatic compensation” branch cancels BOTH Orders, raises an alert, and then cancels the whole process
“Automatic compensation”
© SAP AG 2004, SAP NetWeaver Henrik Stotz 13
Exercise 5: Send Purchase Order
• Purchase order is sent• Order confirmation is received• Order confirmation is acknowledged
© SAP AG 2004, SAP NetWeaver Henrik Stotz 14
Runtime Example: SXMB_MONI
© SAP AG 2004, SAP NetWeaver Henrik Stotz 15
Runtime Example: Workflow Log
© SAP AG 2004, SAP NetWeaver Henrik Stotz 16
Runtime Example: Graphical Workflow Log