Search This Blog

Monday, November 28, 2011

New functions in the Graphical Mapping Tool XI 3.0 SP13


The graphical mapping provides some useful functions with starting with XI 3.0 SP13:
- The node functions mapWithDefaultformatByExamplesort and sortByKey
- The statistic function index

The function mapWithDefault

This function provides a default value, whenever the source element is not available. This is useful function, when you want to use the content conversion of the file adapter. Look at this example:
image
Before SP13 we had to use a combination of the functions exists and if, now we need only one function:
 image

The function formatByExample

This function allows grouping of values of a tag according to values of another tag. Look at this example:
 image
We can achieve this with our new function:
 image
The other nodes are mapped with help of the node functions splitByValue and collapseContexts like follows:
 image
Make sure, that the context of the node ID is set to ORDERLIST in all cases.

The functions sort and sortByKey

Of course these functions are used to sort elements. Let us look at this example:
image
The elements in tag PRODUCT shall be sorted the same way as the elements in tag ID. As the functions sort and sortByKey only sort the elements within the same context, we have to use the function removeContexts before sort. After sort we have to restore the original contexts. We do this with the node function splitByValue The mapping now looks like follows:
image

The function index

This function works like the function counter. The difference is that the function index repeats counting for each context. Let us look at an example:
image
We want the tag No to count the positions in an order. For this reason we have to provide the correct contexts. This can be done by the node functionsplitByValue. After creating of the correct index numbers, the values have to be separated to different contexts. This can be achieved as well with the node function splitByValue.
image
I hope this blog will help you to understand the use of the new mapping functions.

Message Mapping Simplified – Part II

 There was a delay in blogging the Part II due to my project schedules. I still remember my school days where I always loved to solve the most difficult and confusing problems encountered in my favorite subject “Maths”. The same used to happen with me in computers while in graduation. I never scored excellent percentages in my report cards but I used to be the first one to raise a hand with a solution whenever my teacher declares the problem is not easily solvable. I don’t sleep until that is solved and have been successful till date.
The most irritating part in the message mapping is to understand the node functions. So I will try to explain about it, which might be useful for any new XI developers to play around. I can’t assure that explanation is 100% correct as I am trying to explain the way I understand. I am able to solve any complex message mapping that is encountered so far and thought of putting across my understanding to sdn. Experienced professionals can excuse if the understanding is already there!

Types of useful node functions:
1.removeContexts
2. SplitByValue
3. collapseContexts
4.copyValue (not a node function)
5.createIf
6.exists
7.useOneAsMany
Here I tried explain all the node function with one real time example .This kind of scenario is very frequent when dealing with idocs and flat files.
Brief about Transformation Logic : Material Master Idoc is sent with one header and multiple items which has to be written to a target file containing combination of header and line item details. I didnot use the actual idoc structure for better clarity.
Source and Target XSD
Notice the occurrence field in both the source and target format. I have to generate target header nodes equal to the number of occurrences of item in the source node. So I map it as shown below.
RootMapping
I chose the transformation logic such that all the node functions are used.
1.removeContexts- “There is absolutely no difference between my children or grand children or great grand children”. Material Group is sent in the item node of the source idoc but I want it in the header node of the target idoc. So I need to fool the mapping runtime that Material Group is coming in the header node of the source. removeContext exactly does that.
removeContext
We are making the grand child “Material Group” as a child of the header node and fooling the mapping runtime to parse accordingly.
2.SplitByValue- “I need a different parent for every instance of me”
I will try to explain the function with the same mapping as readers can correlate well. Each instance of Itemno in the source structure should generate a target itemNo and item under a different instance of the header node in the target.
As we can observe that occurrences of item in the source and target structure are different we cannot map the elements of the item node directly. We use splitbyValue to achieve the same.
splitByValue
splitbyValue generates Itemno in the target for every value of itemNo in the source under a different target instance of item node which in turn belongs to a different header node.
3.collapseContexts- “ There is just a slight difference between my children or grand children or great grand children”. Similar to removeContext but context change is replaced with “”. If we need to create empty tags in the target for every context change in the source we can use it. I did not find it useful so I don’t like to explain in detail.
4.copyValue-“How many ever times I occur I am copied just once”. This is not a node function but I am explaining it as it is used very frequently in real-time.
Let us take an instance of material group, which can occur as many times as the item node. But since we are mapping it to the header in the target node I just want to copy the first occurrence of material group and map it to the header node. copyValue exactly does that.
copyValue
5.createif-“I have a criteria for existing”. It is used when you want to create target node or element based on some condition.
createIf
We need to generate the material type tag in the target xml for only pencil material. This can be done using createIf.
6. exists- “Do I exist?”
This is the most frequently needed when mapping idoc structure to file structure. Lot of times we come across a scenario where the fields (occurrence=0) are not mandatory in the idocs are not populated in the source xml and they are required in the target xml (occurrence =1) which gives a mapping run time exception that target element cannot be created. We can handle the error by checking whether the source tag exists and if it does not we can pass an empty value, which generates the required target field.
exists
Material Plant is optional in the source structure but the target field expects a blank if idoc does not populate the material group field. exists takes the head ache.
7.useOneAsMany- ”I occur only once but have to be replicated as many times as my siblings or nephews occur”.
This is really a nice function, which will be used very often. As shown in the figure above the maximum occurrence of the header node in the source is 1 and the target is unbounded. So we have only one occurrence of material description, which has to be replicated for every line item. Bingo! useOneAsMany exactly does that! Check it out.
useOneAsMany 
I assume that this information is up to the expectations of the readers who are eagerly waiting for the part-II .I provided a real time example to elucidate the concepts in a better fashion.

Message Mapping Simplified - Part I


It was initially very hard for me to understand the message mapping when we are trained on SAP XI.I browsed help.sap.com and ended up getting more confused. After working with SAP XI for some time however the intuition is changed. I will try to simplify the message mapping by elucidating the concepts in the nutshell. Blog does not cover the message mapping in detail but just gives the basic understanding for any new XI developers. Part 1 of the blog provides a base for conceptual understanding of message mapping with suitable examples.

As we know XI produces the XML documents at the inbound/outbound of the integration pipeline, there is a need for us to map the source XML doc to the target XML doc. Message Mapping editor is a built in feature, which helps to map the source and target XML messages graphically. In this blog we discuss various terms related to it.

Definition: Message Mapping
Firstly, let me define the message mapping in the way I look at it: <CITE>"Message Mapping is nothing but a set of rules for producing target XML from the source XML.These rules are nothing but relations between the source XML tags and target XML tags". </CITE> These rules keep varying according to the business requirements on the source and target XML documents.

Sample Rule :
Sample Mapping
Definition: Occurrence:
One example of such rule is that every occurrence of source XML tags <name> should produce that many occurrences of target XML tags <name>. This example pricks me to define occurrence: <CITE>"Occcurence is just a counter to track the number of times the given XML tag can occur in the XML file generated at the integration engine pipe line" .</CITE> We define the minimum and maximum occurrences of a tag in the data type editor of XI. If we define the minimum occurrence of a tag <X> as n means that there should be at least n <X> tags in the XML file generated at the integration pipeline. It will give a mapping error incase the XML file does not contain at least n <X> tags in the XML file at the runtime.

Illustration of Occurence:
Occurence
Illustration of Mapping Error:
Mapping Error
Definition: Representation:
Before we proceed further it is better if we have a clear understanding of the 3 terms:
1. Element: Simple XML tag.
2. Attribute: Property of XML tag.
3. Node: Logical grouping of set of XML tags.
In XI it is represented as shown below:

XML representation in XI:
XML tag representatin in XI
Additionally there is color indicator for the target XML messages:
1.Red Color indicates that target nodes/elements/attributes are mandatory and has to be definetly mapped.
2.Green Color with a red circle at the bottom indicates that there is a minimum occurrence specified for the tag which has to be met in the mapping.
3.Green color indicates that we can map the nodes/elements/attributes according to the requirements.

Color Indication in the Mapping Editor:
Color Indicator in XI Mapping Editor 
Contexts in Message Mapping:
Once the above concepts are clear we can proceed to the most confusing part of message mapping called “Context Handling”. Initially when I was browsing through the training materials and mapping patterns it was really hard for me to exactly figure out what the term “Context” means. (Forget about context handling and context changing).

Definition: Context
After working out few examples I figured out that: <CITE>"Context of an element is nothing but just the level (with reference to its parent node) where the XML tag appears in the given XML document".</CITE> Level of any element is set to the immediate parent node by default.

Definition: Context Changing
Once the definition of context is very clear the rest of the terms are automatically clarified.<CITE>"Context Changing is just changing the level of XML tag (element level in the XSD) in the XML document or It is just the flexibility provided by XI for changing the XSD of the XML document at the runtime".</CITE> Example given below might make you to understand it better. I added a <CITE>Qualifications</CITE> node and <CITE>Description</CITE> element in the source data type and one<CITE> Qual_Desc</CITE> element in the target data type.

Default Context

The context of the <CITE>Description</CITE> tag is automatically set to the <CITE>Qualification</CITE> by default in XI which means that always <CITE>Description</CITE> XML tag occurs under <CITE>Qualification</CITE> XML tag as shown below.

Source XML message interpretation by the Mapping runtime before context change:
XML before Context Change

I changed the context of the <CITE>Description</CITE> tag to the root <CITE>MT_SRC</CITE> XML tag as shown below.

Changing Context in XI

Source XML message interpretation by the Mapping runtime after context change:
XML after Context Change

Definition: Context Handling
Contexts in XI can be handled by various ways like node functions, advanced functions, which will be, illustrated more in detail in the next blog. We also have queuing mechanisms for handling complex Context Changing in advanced user functions.

Once the above concepts are clear , working with the message mapping and trouble shooting any errors that occurred became relatively very easy for me. Part II will provide some more good examples for playing around with message mapping feature provided by XI.

Important Question and Answers - 1


1.What is Business System?
Business systems are logical systems, which function as senders or receivers within PI. Business systems can be SAP systems or third-party systems.
Depending on the associated technical system, the following types of business systems are defined in the SLD:
·        Web AS ABAP
·        Web AS Java
·        Third-party
·        Standalone
·        Business Partner

2.What is Product?
A collection of all versions of a product. A product is a unit that is delivered, visible to the customer, and is installable and renewable. In an SAP environment, a product corresponds to an SAP technical component.

3.What is  Product version?
A particular version of a product.

4.What is Software component?
A collection of all versions of a software component. Software components represent the reusable modules of a product. You can upgrade them or install patches on them.

5.What is Software component version?
A particular version of a software component.

6.What is Software unit?
A particular aspect of the product functions. It is a logical link between the product version and the software component version.

7. What is Adapter Framework?
Part of the Adapter Engine, which provides interfaces for configuring, managing, and monitoring adapters.

8. What is Software Catalog?
Product and Product Versions
Software Unit
Software Component and its versions

9. What is System Catalog?
Technical Systems
Business Systems

10. What is Message Mapping?
Message Mapping is nothing but a set of rules for producing target XML from the source XML.These rules are nothing but relations between the source XML tags and target XML tags.These rules keep varying according to the business requirements on the source and target XML documents.

11. What is Occurrence and Representation?
Occcurence: is just a counter to track the number of times the given XML tag can occur in the XML file generated at the integration engine pipe line.
Representation: 1. Element: Simple XML tag.
     2. Attribute: Property of XML tag.
     3. Node: Logical grouping of set of XML tags.
Example:
<Node Attribute_Node="">
<Element />
</Node>


12. What is Color Indicator?
      ( Red Color ) indicates that target nodes/elements/attributes are mandatory and has to be definetly mapped.
      ( Green Color with a red circle ) at the bottom indicates that there is a minimum occurrence specified for the tag which has to be met in the mapping.
      ( Green color ) indicates that we can map the nodes/elements/attributes according to the requirements.

13. What is Contest?
Context of an element is nothing but just the level (with reference to its parent node) where the XML tag appears in the given XML document.

Context Changing : Context Changing is just changing the level of XML tag (element level in the XSD) in the XML document or It is just the flexibility provided by XI for changing the XSD of the XML document at the runtime

Context Handling: Contexts in XI can be handled by various ways like node functions, advanced functions.

Thursday, November 17, 2011

SAP PI Content


SAP PI (Process Integration) 7.0 & 7.1

    Introduction EAI Tools
  • Middleware Technology Tools other than XI

  • SAP XI / PI Vs Other Technologies in the same category

  • Merits and Demerits of XI.

  • Introduction to SAP Net Weaver 7.0

  • Modules of SAP Net Weaver 7.0

  • Overview SAP Process Integration 7.0

  • Architecture of SAP PI 7.0

    • System Landscape Directory
      Software Catalog
  • Product and Product Versions

  • Software Unit

  • Software Component and its versions

    • System Catalog
  • Technical Systems

  • Business Systems

    • Integration Builder:
      Integration Repository
      Importing Software Component Versions
      Integration Scenario & Integration Process
  • Integration Scenario

  • Actions

  • Integration Process

    • Interface Objects
  • Message Interface (ABAP and Java Proxies)

  • Message Type

  • Data Type

  • Data Type Enhancement

  • Context Object

  • External Definition

    • Mapping Objects
  • Message Mapping (Graphical Mapping including UDFs)

  • ABAP Mapping

  • JAVA Mapping

  • XSLT Mapping

  • Interface Mapping

  • Mapping Template

  • Imported Archives

    • Adapter Objects
  • Adapter Metadata

  • Communication Channel Template

    • Imported Objects
  • RFCs

  • IDOCs

    • Integration Builder:
      Integration Directory
      Creating Configuration Scenario
      Party
      Service without Party
  • Business System

  • Communication Channel

  • Business Service

  • Integration Process

    • Receiver Determination
      Interface Determination
      Sender Agreements
      Receiver Agreements 
      Adapter Communication
  • Introduction to Adapters

  • Need of Adapters

  • Types and elaboration on various Adapters

  • FILE, SOAP, JDBC, IDOC, RFC, XI (Proxy Communication), HTTP, Mail, CIDX, RNIF, BC, Market Place

    • Cross Component Business Process Management (ccBPM)
  • Introduction to BPM

  • Different types of steps in BPM.

  • Synchronous and Asynchronous Bridge in BPM.

    • Monitoring Tools
  • ABAP stack monitoring

  • JAVA stack Monitoring

  • Runtime Workbench

    • Complete End to End Scenarios to be handled in our Training Program
      Non SAP to Non SAP Systems Integrations
  • FILE TO FILE

  • FILE TO JDBC

  • FILE TO SOAP

  • JDBC TO FILE

  • SOAP TO FILE

    • SAP to Non SAP Systems Integrations
  • IDOC TO FILE

  • RFC TO FILE

  • PROXY TO FILE

    • Non SAP to SAP Systems Integrations
  • FILE TO IDOC

  • FILE TO RFC

  • FILE TO PROXY

    • Non SAP to Non SAP Systems Integration using BPM
  • FILE TO FILE using BPM.
      Non SAP to SAP to Non SAP Systems Integration using BPM

  • FILE TO RFC TO FILE using BPM

    • New features in SAP PI (Process Integration) 7.1
  • Enterprise service repository

  • Service Bus

  • Service Registry

  • Web Service Publishing

  • Service Interface

  • Folders in the Integration Builder

  • Advanced Adapter Engine

  • Reusable UDFs in Function Library

  • RFC and JDBC Lookup using graphical methods

  • Importing of Database SQL Structures

  • Service Runtime for Web Services

  • Graphical Variables

  • WS Adapter and MDM Adapter

  • Integrated Configuration

  • Direct Connection Methods

  • Stepgroup and User Decision step in BPM

  • eSOA Manager Architecture

  • PI 7.1 Components and its features


    Hi, I would like to give an overview of PI 7.1 Components and its features over XI 2.0/XI 3.0/PI 7.0.

    The SAP NetWeaver Process Integration (SAP NetWeaver PI) offering provides open integration technologies that enable process-centric collaboration among SAP and non-SAP business applications, both within and beyond the enterprise. By providing customers with seamless integration at sustainable costs, SAP NetWeaver PI removes the barriers associated with true integration. 
     

                                                                                               Fig1- Components of Process Integration PI 7.1
                                         
    The Various Components of Process Integration PI 7.1 are

    a) SAP Solution Manager
    SAP Solution Manager is used to manage the entire SAP solution landscape which seems to be a challenging task. Companies can minimize risk and increase the reliability of their IT solutions. SAP Solution Manager helps reduce TCO throughout the solution life cycle.

    b) Enterprise Service Repository
    ESR is a central repository of information that contains all the services. ESR is a container, stores all the underlying Meta data of application objects like service interfaces and descriptions. The global data types, interfaces and business processes maintained in Enterprise service repository which can be reuse where needed

    c) Service Registry(SR)
    Service Registry is a common pool available in SOA platform where the services of an enterprise are shared. Providers publish the services in the registry and Consumers discovers the services that need to be consumed. Service Registry is the UDDI part of the Enterprise Service Repository (ESR) which enables service consumers to find services.

    d) Integration Directory(ID)
    The Integration Directory is the central tool for configuring the processing of messages, such as the systems and external communication partners that are involved in the process, the routing rules that govern the message flow between these entities, as well as the settings for communication incl. security. 
    e) Integration Server
    The Integration Server is the runtime environment to provide secure, standards-based, reliable, and scalable communication between provider and consumer applications

    f) Advanced Adapter Engine (AAE)
    The Advanced Adapter Engine AAE provides built-in mediation capabilities to reconcile incompatible protocols, structural maps, schema, and data formats between provider and consumer applications which eliminate the need for ABAP Stack during the process.

    e)SAP NetWeaver Administrator (SAP NWA)
    The SAP NWA safeguard the deployment and operations of the processes in order to ensure runtime governance, security with access control, authentication, auditing, enforcement of compliance to policies, and monitoring of the service execution.
    It handles End to End Monitoring, Performance Monitoring, Message Monitoring, Component Monitoring, Alert Monitoring, Adapter Monitoring, Cache Monitoring, Sequence monitoring and Logging and tracing.

    f) System Landscape Directory(SLD)

    The System Landscape Directory of SAP NetWeaver (SLD) serves as a central information repository for your system landscape. A system landscape consists of a number of hardware and software components that depend on each other with regard to installation, software updates, and demands on interfaces.

    Features of XI 3.0 over XI 2.0
    1. Business process objects (CCBPM) are introduced to design a stateful cross component business process.
    2. Context Objects are introduced to increase readability of routing rules instead of having XPATH expressions.
    3. Channel Template is introduced that can be instantiated to Directory
    4. WSDL,XSD,DTD can be imported to interface objects in External Definition & XSLT, Java are imported to Mapping Objects in Imported Archives
    5. Message exchange between ABAP Proxies is introduced to improve performance by having no services of Integration Server.
    6. Mapping Templates are introduced to have reuse of mappings, and to split and merge messages for BPM.
    7. Support of packages of a Software component version can be used in versioning all Repository objects.
    8. Data type enhancements can be introduced to for customer specific fields.
    9. Party is introduced to facilitate B2B functions and Service generalizes business systems, Business service & business process.
    10. Receiver determination rules are introduced to determine which receiver a certain message has to be sent to at runtime.
    11. Sender agreement and receiver agreement are introduced for inbound and outbound processing.
       
    Features of PI 7.0 over XI 3.0
    1. Simple Overview of all messages is introduced in Message Monitoring with the help of Message status overview.
    2. Mass restart of messages is possible
    3. Critical alerts can be raised for all adapters. (e.g. - if JDBC adapter can't connect to database)
    4. Adapter Modules are introduced in channel templates
    5. Improved usability of adapters is possible by introduction of tabs (Information is classified and distributed across tabs)
    6. Archived messages can be displayed in Message Monitoring
    7. Maximum concurrency can be defined in receiver adapters (FILE, JDBC).
    8. Optimizing thread usage is possible in JMS adapter by reusing the spare threads from SAP J2EE Engine
    9. Extended SOAP adapter usage is possible by AXIS Framework and Encryption methods for SOAP 1.2
    10. Maximum File size can be determined in File Adapter to limit the memory usage 

    Features of PI 7.1 over PI 7.0


    a) Repository Objects
    1. Integration Repository(IR) is renamed as Enterprise Service Repository (ESR)
    2. Message Interface (MI) is renamed as Service Interface (SI).
    3. Service Registry (SR) is to support publishing, classifying, discovering services.
    4. Service Interfaces (SI) may contain several operations where each operation describes one communications (Synchronous / Asynchronous). The various attributes are Category (I/O/A), Mode(S/A), Interface Pattern & Operation Pattern
    5. Interface patterns is a new attribute of a service interface that describes the type of communication that is to be executed on the message (Stateless/ Stateless Xi 3.0 Compatible / TU&C/C and Stateful)
    6. Operation Patterns depends on Interface patterns (Normal / Commit/ Rollback / Confirm/Tentative Update/Compensate)
    7. SAP Global Data type (GDT) is introduced to have business semantics in order to replace SAP Core DT
    8. Interface Mapping is renamed as Operation Mapping.
    9. Folders are introduced to organize projects and interfaces which have access authorizations
    10. We can use either XML toolkit / JDK 1.5 toolkit for JAVA and XSLT Mapping.

    b) Mapping Enhancements
    1. We can set Failure Behavior in FIX values and value mapping (Return initial value/Default/Exception)
    2. Output of fields and functions can be used for Multiple target fields for Reusable / Better Runtime Performance
    3. Tool support to adjust the mappings after the structure changes to avoid structural inconsistencies.
    4. Storing intermediate Results in a variable can be possible and can be reused.
    5. Complete copy of XML sub trees is possible
    6. Parameterized mapping is useful for Channel Lookup and Reuse of multiple mapping in Interface Determinations and to transfer content of Container in UDF.
    7. Function Libraries is useful for Reuse of UDF and enhanced portability of UDF.
    8. Graphical Support of RFC Lookup and JDBC Lookup is available.
    9. Importing SQL Tables Meta Data is possible

    c) CCBPM
    1. Step Groups- Set of steps that can be reused by embedded in Integration Process across SWCV. Step Parameters can also be used in step groups.
    2. Configurable Parameters- Defined in Integration process and the values can be used assigned in ID. Here Agents, Communication channel and simple data type can be used as parameters.
    3. User Interaction - User Decision Step in IP with an agent configured in ID is used to get the workflow message to make a decision

    d) Configuration Objects
    1. Web Service Reliable Messaging WS-RM for Asynchronous messaging is configured in Sender Agreement and Communication Channel for a considerable level of reliability and security.
    2. Principal Propagation based on Security Assertion Markup Language (SAML 1.1) can be configured in WS adapter. It means user is securely propagated from a sender system to receiver systems. An authorization check in receiving system based on original user.
    3. Advanced Adapter Engine (AAE) is used to increase the performance of message processing by eliminating the need for ABAP stack during the process.
    4. Reusable Receiver Rules for logical routing can be used in different Receiver Determination.
    5. Cache Notification function is enhanced to analyze the possible error.
    6. XML Payload validation is possible in sender and Receiver agreement.
    7. Publish the sender agreement in Service Registry (SR) for WS Client and Provider connected to IS.
    8. Centralized administration and monitoring is done by SAP NetWeaver Administrator.
    9. Message Packing enables processing bulk messages in one service call and reduce context switches