Web Methods Integration Workshop Day4

40
July 2005 webMethods workshop – Day 4 Ravindran V ,Badrinath P EAI and Middleware

Transcript of Web Methods Integration Workshop Day4

Page 1: Web Methods Integration Workshop Day4

July 2005

webMethods workshop – Day 4

Ravindran V ,Badrinath PEAI and Middleware

Page 2: Web Methods Integration Workshop Day4

2

EAI and Middleware

Course Agenda – Day 4 EDI Processing

- What is EDI?

- EDI B2B Landscape

- Sample EDI

- EDI Structural details

- webMethods EDI Components

- EDI Implementation Case Study

• Inbound Scenario

• Outbound Scenario

SAP Adapter- What is SAP?

• Core SAP functionalities• SAP Connectivity (RFC/BAPI and IDOC interfaces)

- Understanding webMethods SAP Adapter • Feature points• Architecture Overview• Installing SAP Adapter

- Implementation Process

• Choice of Implementation BAPI/RFC over IDOC/ALE

• Implementation Advantage using BAPI over RFC• Sample Scenario- Purchase Order Creation

Assignment

Page 3: Web Methods Integration Workshop Day4

July 2005

EDI

Ravindran.V

Page 4: Web Methods Integration Workshop Day4

4

EAI and Middleware

Electronic Data Interchange (EDI) EDI - Standard for electronic document exchange between partners EDI Standards :

- ANSI X12 – US Standard

- UN/EDIFACT – International Standard

- EANCOM,

- TRADACOM

ANSIX12 AND UN/EDIFACT are the popular ones. Each EDI standard has multiple versions with in them. E.g ANSI has 20 version starting from 2000 to 4060 being the latest

Page 5: Web Methods Integration Workshop Day4

5

EAI and Middleware

EDI Landscape

Page 6: Web Methods Integration Workshop Day4

6

EAI and Middleware

VAN

VAN (Value Added Network): Acts as a intermediary service provider to facilitate:

• Routing of EDI data between partners

• Provides store and forward facility, Vendor systems are not required to be online always, Vendor systems can retrieve the EDI data addressed to them from their respective mailboxes

• Provides daily summary reports of the EDI data transactions

Page 7: Web Methods Integration Workshop Day4

7

EAI and Middleware

Sample EDI Structure

ISA*00* *00* *08*9251750000 *08*1234567890 *030627*1304*U*00401*000001403*0*P*>~

GS*PO*8019721193*1234567890*20030627*1304*1403*X*004010VICS~

ST*850*01403001~

BEG*00*SA*548177**20030627~

REF*AN*547794~

PER*BD*JOHN JONES*TE*5552225555~

FOB*PB~

DTM*002*20030705~

DTM*118*20030704~

PKG******01~

TD5****H*OUR CR/T~

N9*AH*548177~

MSG*THIS PURCHASE ORDER IS SUBJECT TO THE SAME TERMS AND~

MSG*CONDITIONS AS SAFEWAY PURCHASE ORDER FORM 1030~

MSG*PICK-UP NO. 12345~

N1*ST*SAFEWAY INC*9*0091372092527~

N2*Tracy Produce~

N3*16900 West Schulte Road~

N4*Tracy*CA*95376~

N1*BT*SAFEWAY INC*9*0091372091700~

N2*NATIONAL SERVICES CENTER~

N3*P.O. BOX 29093~

N4*PHOENIX*AZ*85038~

N1*VN*BEST SUPPLIER INC.*9*1234567890000~

N3*P.O. BOX 11111~

N4*LOS ALAMITOS*CA*90001~

PO1**10*CA*12.5**UA*042040304101*IN*20403041*VN*22222~

CTP*RS*FCP*12.5~

PID*F*08***ITEM DESCRIPTION 1/10 LB~

SAC*A*B280***20.00***2.00****02~

CTT*1**120*LB~

SE*30*01403001~

GE*1*1403~

IEA*1*000001403~

Page 8: Web Methods Integration Workshop Day4

8

EAI and Middleware

EDI X12 (Structure & Semantics)

Page 9: Web Methods Integration Workshop Day4

9

EAI and Middleware

EDI X12 (Structure & Semantics)

Page 10: Web Methods Integration Workshop Day4

10

EAI and Middleware

WebMethods EDI Components

Page 11: Web Methods Integration Workshop Day4

11

EAI and Middleware

Case study- Purchase Order processing

Requirement 1: Implement the interface in the Vendor System to receive and load the EDI data to the Vendor Oracle database.

Mapping Requirements: X12850004010.pdf

VAN (Value Added Network): Acts as a intermediary service provider to facilitate:

Routing of EDI data between partners

Provides store and forward facility, Vendor systems are not required to be online always, Vendor systems can retrieve the EDI data addressed to them from their respective mailboxes

Provides daily summary reports of the EDI data transactions

Page 12: Web Methods Integration Workshop Day4

12

EAI and Middleware

Mappings - EDI 850 4010 SegmentsEDI Segment description for Purchase order

Header Section

BEG PO Beginning segment

REF Reference Identification

PER Administrative Communication contact

FOB F.O.B related instructions

DTM Date / Time reference

PKG Marking. Packaging, Loading

TD5 Carrier Details

Loop ID - N9  

N9 Reference Identification, Identifies using the purchase order id used as placeholder for providing the purchase order description

MSG Message Text. Contains the Purchase order description

Loop ID - N1 Holds the Information about the Buyer, Seller and Vendor

N1 Name

N2 Address Name information

N3 Address Information

N4 Geographic Location

Detail Section

PO1 Base Item Data

CTP Pricing information

PID Product item description

SAC Service Promotion allowance or charge information

Summary Section

CTT Transaction Totals

Page 13: Web Methods Integration Workshop Day4

13

EAI and Middleware

Mappings - EDI 850 4010 Sample data

Header Mapping Details

BEG*00*SA*548177**20030627 [Mapping to Order id and PO date]

REF*AN*547794

PER*BD*JOHN JONES*TE*5552225555 [Mapping to Buyer Name and Telephone Number]

FOB*PB [Mapping to Delivery Type field PB- Customer Pickup / PP – Pre Paid freight]

DTM*118*20030704 [Mapping to Delivery Date CCYYMMDD]

PKG******01 [Mapping to Packaging Type ]

TD5****H*OUR CR/T [Mapping to Transport Type and Transport Description]

N9*AH*548177 [Mapping reference for enclosing the Purchase Order description has ref to order id]

MSG*THIS PURCHASE ORDER IS SUBJECT TO THE SAME TERMS AND

MSG*CONDITIONS AS SAFEWAY PURCHASE ORDER FORM 1030

MSG*PICKUP NO. E450562

Mapping : Concat all

MSG01 for PO Description

Page 14: Web Methods Integration Workshop Day4

14

EAI and Middleware

Mappings - EDI 850 4010 Sample data

Header Mapping Details ….(Cont…) Mapping Buyer, Seller and Vendor

N1*ST*SAFEWAY INC*9*0091372092527 [Mapping to : Seller Details (ST), name, Identification code]

N2*Tracy Produce [Mapping to : Additional Identification Name]

N3*16900 West Schulte Road [Mapping to: Address]

N4*Tracy*CA*95376 [Mapping to City, State , Zip code]

Similar mapping for Buyer and Vendor.

Buyer (BT) : N1*BT*SAFEWAY INC*9*0091372091700

Vendor (VT): N1*VN*BEST SUPPLIER INC.*9*1234567890000

Page 15: Web Methods Integration Workshop Day4

15

EAI and Middleware

Mappings - EDI 850 4010 Sample data

Details Section – Line Items Mapping

PO1 repeats for every line item in the purchase order

PO1**10*CA*12.5**UA*042040304101*IN*20403041*VN*22222 [Mapping to : Quantity, UOM, Unit price, UPC case code, Safeway item no, Vendor Item no]

CTP*RS*FCP*12.5 [Mapping to : Trade Type RS- Resale]

PID*F*08***ITEM DESCRIPTION 1/10 LB [Mapping to : Item Description]

SAC*A*B280***20.00***2.00****02 – [Mapping : Allowance Details Not mapped]

Page 16: Web Methods Integration Workshop Day4

16

EAI and Middleware

Mappings - EDI 850 4010 Sample data

Summary Section – Mapping

Consolidates the data from all the line items PO1 segment

CTT*1**120*LB [Mapping : Total Number of line items , Total weight of the order, Unit of measurement]

Page 17: Web Methods Integration Workshop Day4

17

EAI and Middleware

Interface Implementation design

Partner -1

Safeway System -2

Partner -3

EDI Parser/Translator

Vendor System

Map to PO Canonical Model

Target system -1 Target system -2 Target system -3

Publish

VAN Enabler

Page 18: Web Methods Integration Workshop Day4

18

EAI and Middleware

Arriving at a Generic Canonical Model

Details Section - Line Items

Header Section Address Details

Page 19: Web Methods Integration Workshop Day4

19

EAI and Middleware

Suggestive Mapping approach Map EDI data based on the segments

- E.g. mapPO1 takes in PO1 as input and provides line_item as output. Advantage : Mapping are simple and easy to understand as they are atomic and very flexible for future

changes.

Page 20: Web Methods Integration Workshop Day4

20

EAI and Middleware

Demo Scenario Implemented in webMethods

EDI submission console. (Safeway submitting PO 850 EDI to Vendor)

- http://localhost:5555/WmEDIforTN/submitEDI.html

Vendor Back end System (Receiver- Processes the Edi and logs the PO to Oracle DB)

- http://localhost:5555/SW_POOutbound/POMGMT.dsp

Page 21: Web Methods Integration Workshop Day4

21

EAI and Middleware

Implementing Functional Acknowledgments

Functional Acknowledgment

- Report of the syntactic analysis of the transaction set, indicates if the EDI transaction has been Accepted, Accepted with errors or Rejected

FA are implemented using EDI transaction set 997

FA are usually automated process handled by the EDI Translator/ handler

FA can be generated at various levels

- Group level (Default)

• AK1 and AK9

- Transaction set level –AK5

• AK1, AK2, AK5, AK9

- Segment level – AK3

• AK1, AK2, AK3, AK5 and AK9

- Element Level –AK4

• AK1, AK2, AK3, AK4 and AK9

Page 22: Web Methods Integration Workshop Day4

22

EAI and Middleware

EDIINT

EDIINT Electronic Data Interchange-Internet Integration,” or “EDI over the Internet.”

Defines a protocol for using the Internet to securely exchange business documents (EDI,

- EDIINT AS1 (EDIINT Applicability Statement 1) uses SMTP (e-mail) to transport documents

- EDIINT AS2 (EDIINT Applicability Statement 2) uses HTTP (or HTTP/S) to transport documents

- EDIINT AS3 (EDIINT Applicability Statement 3) uses FTPS (FTP over SSL) to transport documents

Page 23: Web Methods Integration Workshop Day4

July 2005

SAP Adapter

Badrinath.P

Page 24: Web Methods Integration Workshop Day4

24

EAI and Middleware

– SAP R/3 - ERP package intended as a total software solution for running large businesses.• PP – Production Planning

• MM – Materials Management

• SD – Sales and Distribution

• FI – Financial Accounting

• CO -- Controlling

• AM – Fixed Assets Management

• PS – Project Systems

• WF -- Work Flow

• IS – Industry Solutions

• HR – Human Resources

• PM -- Plant Maintenance

• QM – Quality Management

What is SAP ?

SAP50%

SIEBEL17%

ORACLE

15%

PEOPLESOFT13%

JDEDWARDS5%

Page 25: Web Methods Integration Workshop Day4

25

EAI and Middleware

SAP Connectivity RFC – Remote Function call are used to synchronously communicate between

• Two SAP Systems or • For communication between a SAP system and an external application

BAPI (Business API) : Programming interface/Methods for working with and manipulating SAP Business Objects.

BAPI is implemented as Functional Module internally so every BAP has an equivalent internally named Function Module behind.

Subset of the RFC enabled function module officially released by SAP as a part of the Business Object repository – BOR to be called from external programs.

Page 26: Web Methods Integration Workshop Day4

26

EAI and Middleware

SAP Connectivity RFC/BAPI External programs SAP : External programs can directly call any of the

Function Module in SAP that is RFC enabled.

SAP systems External : SAP systems can call external systems a gateway proxy (Registering an external RFC server in the SAP system as a SAP RFC Listener)

RFC

SAP Server

BAPI

External Application

RFC Client

RFC

SAP Server

RFC

External Application

RFC Client

RFC Server

(Listener)RFC

Note:

RFC Client : One which makes the request

RFC Server: One which receives the request

Page 27: Web Methods Integration Workshop Day4

27

EAI and Middleware

SAP Connectivity

IDOC – Intermediate Document : Standard SAP Data format for exchange of document between different R3 Systems and External Systems.

IDOC contains Header and data segments and similar in structure to EDI formats. Transaction based on tRFC (Transactional RFC)

ALE – Application Link Enabling Proprietary message based routing and transport mechanism.

Ability to represent logical system both SAP and External system Define routing rules for sellers /buyers and message types

Note: RFC/BAPI use Synchronous ModeIDOC/ALE use Asynchronous mode.

Page 28: Web Methods Integration Workshop Day4

28

EAI and Middleware

SAP Connectivity

SAP Server

ALE Routing

IDOC

External Application

RFC Server

(Listener)tRFC

ALE/IDOC Communication

Page 29: Web Methods Integration Workshop Day4

29

EAI and Middleware

Understanding webMethods SAP Adapter 4.6

Features Executes SAP’s Independent BAPI Methods as specified in BOR(Business Object

Repository).

Executes SAP’s remote Function Calls (RFC) irrespective of the SAP Datatypes.

Call SAP adapter services from SAP System.

Route Business Documents(IDOC) based on routing rules using partner Manager.

Real-time Integration.

High level Services to process SAP IDOC’s & BAPI’s.

Page 30: Web Methods Integration Workshop Day4

30

EAI and Middleware

webMethods SAP Adapter – Components

Invoking Business Logic

- RFC Server (Listener)- Listens to incoming request from SAP Server

- RFC Client- Sends request to execute BAPI/RFC.

- tRFC – transport mechanism for IDOC

Message Routing Logic

- Partner Manager : receives & routes messages using routing rules defined

- Message Store : Used by Transactional manager to track IDOCs(tRFC) routed to & from the SAP system.

Page 31: Web Methods Integration Workshop Day4

31

EAI and Middleware

webMethods SAP Adapter -Architecture OverView

Page 32: Web Methods Integration Workshop Day4

32

EAI and Middleware

webMethods SAP Adapter- Extended Partner Integration Architecture

Page 33: Web Methods Integration Workshop Day4

33

EAI and Middleware

webMethods SAP Adapter Installation Tips Install wm SAP Adapter as per installation Guide.

Copy librfc.dll from lib folder of the SAP Adapter to the <winnt>/system32 folder for windows installation.

The different platforms use the following libraries: - • Windows uses librfc32.dll

- • Solaris uses librfccm.so

- • AIX uses librfccm.o

- • HPUX uses librfccm.sl

The lib file versions should be the same as in the SAP adapter package.

SAP Adapter uses SAP JCO Java Connector.

Page 34: Web Methods Integration Workshop Day4

34

EAI and Middleware

Implementation Process

Choice of Implementation BAPI/RFC over IDOC/ALE

BAPI/RFC IDOC/ALE

Synchronous/Real Time Mode Asynchronous/Batch Mode

NA Built-in queue & queue manager function

Smaller Transactions. Large transaction Volumes( Background processing)

No mechanism to ensure exact once processing

The tRFC ensures specific transaction exactly once in RFC Server System.

Customizing is easier Custom IDOC most difficult.

Monitoring function not available Simple Error handling & monitoring function

NA If SAP uses EDI Gateway, iDOC integration is preferred.

Page 35: Web Methods Integration Workshop Day4

35

EAI and Middleware

Implementation Process

Implementation Advantage using BAPI over RFC

• Provides a stable and object oriented view of the R3/applications

• Stay consistent over various R/3 releases

• Can be accessed using standard program languages C++ and Java

• No ABAP programming knowledge required.

Note: When a BAPI is available , BAPI should be used and not the Function Module

Page 36: Web Methods Integration Workshop Day4

36

EAI and Middleware

Implementation Process Prime Requirement

- SAP System Administrator.

- Functional Analyst

- Developer

SAP Users- Dialog User: SAP GUI user.

- Background User: SAP Backgroud job, no access to GUI.

- CPIC User: Communicate with SAP using CPIC.

webMethods SAP Adapter can operate both as Dialog user(RFC logging)/ CPIC user based on requirement.

Ports Used by SAP

32xx - Dialog port

33xx- Gateway port

36xx- Message port xx- SAP SystemsNumber - Inbound RFC Ports used - 32xx

- Outbound RFC Ports Used - 32xx & 33xx

- In Addition for load balancing 32xx & 36xx will be used.

Page 37: Web Methods Integration Workshop Day4

37

EAI and Middleware

Implementation Process

SAP Transactions

SAP Txn Description

SM59 Maintain RFC destination. SM59 allows you to create/display/change/delete the RFC destination information.

SM58 tRFC monitoring – SAP persists all tRFC transactions. SM58 is used to monitor the tRFC status and re-execute the failed transactions.

SU53 Authorization Check –Run SU53 after to determine exactly which authorization object the transaction failed on.

WE02 IDoc Monitor – Monitors all inbound/outbound IDoc status.IDoc status is ‘03’ – ‘Deliver to port ok’, use SM58 to check if the IDoc has reached its destination.

ST11 View SAP log files

WE60 Generates a DTD from an IDOC (including extensions) – Select the IDoc type.

Page 38: Web Methods Integration Workshop Day4

38

EAI and Middleware

Implementation Scenario for Inbound process to SAP

Purchase Order Creation

Scenario Description: Purchase Orders are created in Ariba and the same are to be synchronized in SAP system by invoking the BAPI

Steps in the implementing the Purchase Order Creation Interface

1. SAP Settings/Configurations:

1.1. Create SAP server

1.2. Look up BAPI using Function Module and create the Outbound Map (Outbound WebMethods to SAP) SAP BC calling SAP.

2. Create a service and the corresponding trigger to subscribes to the PO Canonical

3. Create Outbound Map Invoke the BAPI : Z_BAPI_PO_CREATE from the flow service using the service specified in configuration step

Page 39: Web Methods Integration Workshop Day4

39

EAI and Middleware

Implementation Scenario for Outbound process from SAP Goods Receipt

Scenario Description: Goods receipt are generated in SAP system as IDOCS which are to be processed and sent out as XML to the receiving External System

ZMMBID

webMethodswebMethods

processGoodsReceipt

Integration Server

Partner Manager

SAP R/3 SAP R/3

RP1100PR

Sender Port

WMPRP2P1

(RFC Dest.

WMPR120P2P1)

Message Type

Message Store

External SystemExternal System

Steps in the implementing the Goods Receipt Interface

1. SAP Settings/Configurations:

1.1. Partner manager is used for routing the SAP IDOCs to the B2B service

1.2. Create SAP server and the SAP Listener

1.3. Create the Routing rule for the ZMMBID message type

1.3.1. Specify the Sender, Receiver and Message type

1.3.2. Specify transport (e.g. B2B Service)

1.3.3. Specify the flow service to be invoked

2. Flow service (processGoodsReceipt) receives the IDOC and converts to XML and sent to external system

Page 40: Web Methods Integration Workshop Day4

40

EAI and Middleware

Assignment – Day 4 Implement the EDI 850 Inbound processing

- Refer the reference package : POProcessing Package

EDI Outbound processing for reference. (SW_POOutbound Package) EDI Sample Standard Guide for 850 Refer X12850004010.pdf EDI Test Data.zip for the EDI test data

EDI OutboundEDI Inbound SQL Tables EDI Test Data