SAP Tutorial Beginner

Embed Size (px)

Citation preview

  • 7/24/2019 SAP Tutorial Beginner

    1/14

    Objective

    The objective of this tutorial is to make you understand - what is SAP Process Integration? We will not go into

    the nitty-gritty of the subject but we will discuss about the architecture and dierent features of SAP PI! We will

    cover the basic features only and will avoid discussing all features in this tutorial!

    "e#t there are a set of case studies which will give you an idea about the industry level utili$ation of SAP PI!%nce you get more ac&uainted with the subject' you should try to solve them! The test cases are (re(ared in a

    manner so that it will take you down into the subject from sim(le to more com(le#es with each lesson and will

    give you an overall idea of the subject!

    SAP "etWeaver Process Integration )SAP PI* is SAP enter(rise a((lication integration )+AI* software' a

    com(onent of the "etWeaver (roduct grou( used to facilitate the e#change of information among a com(any,s

    internal software and systems and those of e#ternal (arties!

    Legacy System

    While im(lementing the SAP +P in a large business establishment' it is found that not all sections can be

    brought under the SAP +P! .any of the business sections may have their own (ro(rietary tools which arehighly com(le# and may not be (ossible to be re(laced! They run (arallel to the SAP System! They are called

    the /egacy Systems! Then it becomes necessary to integrate between the SAP Systems and such (re-e#isting

    non-SAP System! This is where the SAP PI comes into (lay!

    Why do we need SAP PI A(art from /egacy

    Systems' in a large business establishment' SAP +P does not consist of a single system but several integrated

    systems i!e! 0.' S. and 1I0% etc! To handle with such com(le#ities SAP introduced Process Integration a

    (latform to (rovide a single (oint of integration for all systems without touching e#isting com(le# network of

    legacy systems! This is a (owerful middleware by SAP to (rovide seamless end to end integration between SAP

    and non-SAP a((lications inside and outside the cor(orate boundary! SAP PI su((orts 232 as well as A3A

    e#changes' su((orts synchronous and asynchronous message e#change and includes built in engine for

    designing and e#ecuting Integration Processes!

    Architecture of SAP PI

  • 7/24/2019 SAP Tutorial Beginner

    2/14

    The SAP PI consists of a hub and s(oke structure4 the s(okes connect with e#ternal systems while the hub

    e#change messages between them! The source system is known as the sender system and the target system is

    known as the receiver system! The PI is not a single com(onent' but rather a collection of com(onents that

    work together 5e#ibly to im(lement integration scenarios! The architecture includes com(onents to be used at

    design time' at con6guration time and at run time!

    We can divide the SAP PI into several areas

    7! Integration Server

    3! Integration 2uilder

    8! System /andsca(e

    9! 0on6guration and .onitoring

    Integration Server is the central (rocessing engine of the SAP PI! All messages are (rocessed here in a

    consistent way! It consists of three se(arate engines

    Integration +ngine

    Ada(ter +ngine

    2usiness Process +ngine

    Integration engine can be considered to be the hub and the Ada(ter engine the s(oke! egarding the

    2usiness Process +ngine' I will e#(lain it later!

    Integration 2uilder is a client-server framework for accessing and editing integration objects and it consists

    of two related tools:

    7! +nter(rise Service e(ository ; to design and develo( objects to be used in scenarios

    3! Integration

  • 7/24/2019 SAP Tutorial Beginner

    3/14

    AAP Stack !ava Stack

    Integration +ngine2usiness Process +ngine

    Integration 2uilder

    +nter(rise Service e(ository

    Integration

  • 7/24/2019 SAP Tutorial Beginner

    4/14

    8! .essage S(lit - if more than one receiver are found' PI will instantiate new message for each receiver!

    9! .essage .a((ing - ma((ing to transform the source message to destination message format!

    ! Technical outing - bind a s(eci6c destination and (rotocol to the message!

    B! 0all Ada(ter - send the transformed message to the ada(ter or a (ro#y!

    Ada#ter "ngine

    Cou must have noticed earlier that the integration engine handles messages in ./-S%AP (rotocol only! 2ut

    what if we have a sender and a receiver business system where the data is not in the same format! We use the

    various ada(ters in the Ada(ter +ngine to convert ./- and DTTP-based messages to the s(eci6c (rotocol and

    format re&uired by these systems' and vice versa!

    As

    we have discussed earlier' SAP PI is a hub and s(oke structure where the Ada(ter +ngine can be considered as

    s(oke! We use the Ada(ter +ngine to connect the Integration +ngine )Dub* to the e#ternal systems! The Ada(ter

    1ramework is the basis of the Ada(ter +ngine! The Ada(ter 1ramework is based on the SAP =3++ +ngine )as (art

    of the SAP Web A((lication Server* and the =3++ 0onnector Architecture )=0A*! The Ada(ter 1ramework (rovides

    interfaces for con6guration' management' and monitoring of ada(ters!

    In a dual stack system' most of the ada(ters where based on the =ava stack barring two ada(ters which are

    based on the A2AP stack!

    =ava Stack

    10 ada(ter' SAP 2usiness 0onnector ada(ter' 6leE1TP ada(ter' =

  • 7/24/2019 SAP Tutorial Beginner

    5/14

    2P. stands for cross-com(onent 2usiness Process .anagement or cc2P. and is also called Integration (rocess!

    An integration (rocess is an e#ecutable' cross-system (rocess for (rocessing messages! In an integration

    (rocess you de6ne all the (rocess ste(s that are to be e#ecuted and the (arameters relevant for controlling the

    (rocess! 2usiness Process .anagement (rovides SAP +#change Infrastructure with the following functions:

    7! State-full message (rocessing: The status of an integration (rocess is (ersisted on the IntegrationServer!

    3! Cou can also use correlations to establish semantic relationshi(s between messages!

    8! Cou im(lement integration (rocesses when you want to de6ne' control' and monitor com(le#

    integration (rocesses that e#tend across enter(rise and a((lication boundaries i!e! collectE.erge' S(lit'

    .ulticast

    At runtime' the 2usiness Process +ngine e#ecutes the integration (rocesses! The integration (rocess can send

    and receive messages using abstract interfaces only!

    uild a scenario in SAP PI

    We start from the Dome (age if we have to build a scenario in PI!

    The home (age will look similar to as given below:

    1igure B ; Dome Page for SAP PI =ava Stack

    The Dome (age has hy(erlinks to the following 9 working areas

    7! +nter(rise Services e(ository )+S*

    3! Integration

  • 7/24/2019 SAP Tutorial Beginner

    6/14

    "nter#rise Services $e#ository

    Dere we design and create objects to be used in the making of an integration scenario! The data 5ow in PI will

    look similar to as shown below:

    We

    6nd the o(tion to design the following

    7! Interface objects ; Service Interface' .essage Ty(e'

  • 7/24/2019 SAP Tutorial Beginner

    7/14

  • 7/24/2019 SAP Tutorial Beginner

    8/14

    Sender Agreement is similar to (rimary key in table! There cannot be the two similar sender agreements in

    one landsca(e!

    eceiver Agreement de6nes how the message is to be transformed so that it can be (rocessed by a receiver! It

    consists of

    7! Sender 0om(onent3! eceiver 0om(onent

    8! eceiver Interface

    9! eceiver 0ommunication channel

    Cou use a receiver determination to s(ecify which receivers a message is to be sent to! Cou have the o(tion of

    de6ning conditions for forwarding the message to the receivers! It consists of

    7! Sender 0om(onent

    3! Sender Interface

    8! eceiver 0om(onent

    eceiver

  • 7/24/2019 SAP Tutorial Beginner

    9/14

    1igure 77 ; System /andsca(e

    Products and 0om(onents are commonly called the 0om(onent Information

    Technical System and 2usiness System are commonly called the /andsca(e

  • 7/24/2019 SAP Tutorial Beginner

    10/14

    It is the central entry (oint for monitoring (ur(oses! This gives you the o(tion of navigating to the monitoring

    functions of the Integration +ngine' as well as integration with the 0om(uting 0enter .anagement System

    )00.S*' and the Process .onitoring Infrastructure )P.I* of SAP!

    The 0on6guration and .onitoring will look similar to as given below:

    1igure 78 ; 0on6guration and .onitoring

    With the 0on6guration and .onitoring the following monitoring functions are su((orted:

    7! 0om(onent monitoring - monitoring the dierent SAP PI com(onents )=ava and A2AP (arts*!

    3! .essage monitoring - tracking the message (rocessing status within an SAP PI com(onent and on

    error detection and analysis!

    8! +nd-to-end monitoring - monitoring of a message lifecycle from the SAP PI (oint of view!

    9! Performance monitoring - statistics about dierent (erformance as(ects of SAP PI can be accessed

    through the W2! Dere' you can select and aggregate (erformance data' for e#am(le' by com(onent' time

    range' or message attributes!

    ! Inde# administration - by administering and monitoring the inde#ing of messages (er SAP PIcom(onent' you enable an inde#-based message search that you can use in message monitoring! This kind of

    message search oers you enhanced selection criteria including ada(ter-s(eci6c message attributes and terms

    or (hrases from the message (ayload!

    B! Alert con6guration - by using the Alert 1ramework' central monitoring in PI can be (rovided with all

    errors re(orted during message (rocessing in A2AP and =ava! This enables an im(roved reaction to such errors

    in both the A2AP runtime and the =ava-based Ada(ter +ngine! 1or this (ur(ose' the Alert 1ramework is (rovided

    with rules based on certain events and on information from the header of the PI message (rotocol! These rules

    determine whether alerts are send or not! If an alert is sent' it can be used for error analysis!

    ! Alert inbo# - the alert inbo# is user-s(eci6c and dis(lays all the alerts for each alert server that has

    been generated based on the alert con6guration!

    J! 0ache monitoring - cache monitoring dis(lays objects that are currently in the runtime cache!

  • 7/24/2019 SAP Tutorial Beginner

    11/14

    Su((ose there are two systems ; A and 2! All communication between A and 2 is via a method call and thus

    they are synchronous! We introduce a third system between A and 2 and called it the Intermediate system ; I!

    The communication between A and I is via method call and similarly between I and 2 is also via method call!

    2ut the communication between A and 2 can be called asynchronous as A does not have to wait for the

    res(onse from 2!

    T

    his is the basis of asynchronous communication and what is this intermediate system? That is the Kueue! A is

    called the sender and 2 is called the receiver! .essage from A is 6rst added to the Kueue and then it is again

    (ulled from the Kueue and send to 2! The res(onse from 2 reaches A in a similar fashion! In certain situation'

    the business re&uirement needs the messages to be delivered to 2 in the same order as they are triggered from

    A! In such case we follow a 6rst-in and 6rst-out (olicy! If there are no such re&uirements then messages are

    sending from the &ueue to 2 in any order!

    With asynchronous communication' we achieve guaranteed delivery i!e! System 2 is not available when System

    A sends the message! The message is added to the &ueue and remains there as long as 2 is not available! %nce

    2 is available' the message is (ulled from the &ueue and sends to 2!

    So we can classify our message communication in three ways:

    7! Synchronous

    3! Asynchronous with order not maintained

    8! Asynchronous with order maintained

    In PI' we identify them as: Synchronous ; 2+ )2est +ort*' Asynchronous with order not maintained ; +%

    )+#actly %nce*' Asynchronous with order maintained ; +%I% )+#actly %nce in %rder*!

    Acknowledgment

    Acknowledgment is the root of asynchronous communication! Why?

    1or synchronous communication' System A calls system 2 and if 2 fails to send the res(onse the (rocess failed!

    2ut in an asynchronous communication' System A calls System I and System I calls System 2! So su((ose the

    communication between A and I is successful but between I and 2' it fails! Dow should A reali$e that the

    delivery to 2 has failed? This is reali$ed by an acknowledgment which is send back to A by 2 via the same route

    as the message from A took to 2! If the acknowledgment from 2 fails to arrive to A then A consider that the

    (rocess has failed and will send the message again!

    While we discussed about asynchronous communication in PI' we have used the term ; L+#actly %nceM for both

    +% and +%I%! +#actly %nce means a message delivered once cannot be delivered again! To achieve this' there

    is an acknowledgment for every message send from A to 2! It is the ada(ters which lie at the end of thecommunication! So the ada(ters must su((ort acknowledgment!

  • 7/24/2019 SAP Tutorial Beginner

    12/14

    All ada(tersM (rovide system-acknowledgment i!e! delivery acknowledgment! Those ada(ters which su((ort

    synchronous communication su((ort a((lication-acknowledgment in addition to the system acknowledgment!

    So in PI' following are the ty(e of acknowledgment

    7! System Acknowledgment - System acknowledgments used by the runtime environment to con6rm thatan asynchronous message has reached the receiver!

    3! A((lication Acknowledgment - A((lication acknowledgments used to con6rm that the asynchronous

    message has been successfully (rocessed at the receiver!

    $emote )unction %all

    While working in PI' you will come across the term - 10! What are they? To establish communication between

    two SAP systems i!e! an E8 and PI' we create the 10 !

    Lesson*+

    Pre(are a scenario to read one single 6le i!e! 6le cvF7!#ml from the source directory and write it to the

    target directory! The target 6le name should also be cvF7!#ml with the time-stam( a((end to the

    name!

    Lesson*,

  • 7/24/2019 SAP Tutorial Beginner

    13/14

    Pre(are a scenario to read all the 6les from the source directory and write them to the target directory!

    Similarly the target 6les should also be named as cvF7' 3 !!#ml with the time-stam( a((end to each of

    them!

    Lesson*-

    The instructor then asks you all to add the following validation to the data!

    7! The mobile-number should have 7N numeric digits ; if the mobile number is not of 7Ndigit then re(lace it with LerrorM

    3! The email should have one LRM character and one L!M character ; if the email is not

    having the LRM or L!M character' then re(lace it with LerrorM

    2efore you run the scenario' in some of the source 6les' modify the mobile and the email so that they

    are in error as (er the logic given above!

    Lesson*.

    Pre(are a scenario to read all the source 6les and classify them according to their gender! The 6les for

    the men will be written in one directory and for the ladies to another directory! Two directories are

    created for the above (ur(ose:

    Target directory for men: c:ibmsa(trainingtargetmenTarget directory for women: c:ibmsa(trainingtargetwomen

    Su((ose there are B men and 9 women in the class' then if all the source 6les are read successfully

    then the target directory for men should have B 6les and the target directory for women should have 9

    6les!

    %ase Studies * ,

    The instructor then asks you all to (re(are one single 6le with the (ersonal details of each student in se(arate

    segments!

    Lesson*/Write a scenario which will read this 6le and (roduces 7N target 6les where each 6le should corres(ond

    to the (ersonal data of each em(loyee! The target 6les should be named as

    cvFQem(FIFQtimestam(>

    Lesson*0

    .odify the above scenario so that it (roduces 3 target 6les instead of 7N where one target 6le for men

    and another target 6le for the ladies! The target 6le for men should have B segments for B men and

    the target 6le for ladies should have 9 segments for 9 women!

    The target 6les should be named as

    1or men ; menFQtime-stam(>

    1or /adies ; womenFQtimeFstam(>

    %ase Study *-

    Same as case study ; 7' the instructor ask each student to (re(are hisEher the (ersonal details and save them

    in an ./ 6le! There will be 7N 6les! The 6les are saved in the source directory!

    Lesson*1

    Pre(are a scenario to read all the source 6les from the source directory and to create one single 6le in

    the target directory! The name of the target 6le will be out(ut!#ml with the time stam( a((end to the

    6le-name! The target 6le will have all the details of each source 6le as sub-segment!

  • 7/24/2019 SAP Tutorial Beginner

    14/14

    Lesson*2

    Pre(are a scenario to read the entire source 6les from the source directory and create two 6les in the

    target directory ; one for the men and the other for the ladies! 1or B men' the men 6le should have si#

    segments having each manMs details and for 9 women' similarly there should be 9 segments with each

    ladyMs details!

    %ase Study * .

    The instructor now asks each of the students to (re(are another set of details which will consist of hisEher the

    following academic details:

    7! Student I