You are on page 1of 23

ALE / BAPI Messaging

Cay Rademann
SAP AG
SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 1

Topics
Communication
Synchronous BAPIs
Asynchronous BAPIs
Replication
Summary

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 2

Page 1

There are 2 Ways of Communication


Asynchronous

Synchronous
Hello Jane, I want to
order 50 piece of xxxx,
20 piece of yyyyy and
100 piece of zz. Can
you deliver this?

FAX
Order
xxxx
yyy

Order:
xxxx 50
yyyyy 20
zz 100

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 3

Synchronous Communication

z
z

Client calls Server


Server can return information directly
How many
do you want?

I want to
order ...

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 4

Page 2

Server Availability

Client cant finish transaction if server is not available

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 5

Transaction Handling: Database LUW

State of data changes insert, update, delete

Intermediate state

Consistent
state 1

Consistent
state 2
A

COMMIT
ROLLBACK

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 6

Page 3

Distributed LUWs
System A
A

synchronous
2-Phase-Commit
required
System B
B

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 7

Synchronous Links

Only for uncritical transactions


T Unsuitable synchronous link:

Posting a goods receipt in a logistics system should not


depend on the financial system being available

T Suitable links:

Checking existence of objects in an infrequently used


transaction;

Displaying data on follow-on documents created in the other

system

Exception: tightly coupled systems


T If two systems are to be so tightly coupled that they can be
treated as a single system, then synchronous links are OK

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 8

Page 4

Asynchronous Communication

z
z
z

Decoupling of transactions on client and server


No direct feedback from server
Special mechanisms for monitoring / error handling
FAX
Order
xxxx
yyy
FAX

Order:
xxxx 50
yyyyy 20
zz 100

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 9

Message Queuing

z
z
z
z
z
z
z

Automatic retry if the client is not available


Guaranteed once-only delivery
Serialization (delivery in the correct order)
Parallel processing (for enhanced throughput)
Monitoring tools
Data logging for auditing and/or recovery
Timing control: when to send data, when to process
data at receiver

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 10

Page 5

Error Handling

z
z
z

Client does not automatically notice errors on server


For high volume traffic, can only afford a very low
error rate
If an error occurs at server, manual intervention in the
server system is typically needed
T the transaction has already been posted by the client, and

typically cannot be easily undone.

User(s) in the server system should be automatically


notified of errors

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 11

Data Replication

z
z
z

Replicas of data objects are available to local systems


T Local access ensures high performance
T Communication failure not critical

Which information is replicated and which information


is maintained locally?
Ownership of data needs to be clearly defined

Copy
Copy

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 12

Page 6

System Coupling

z
z

A system must continue to operate when others are


not available
This means:
T Critical data needs to be replicated
T Asynchronous communication:

Message Queuing
Error handling

T Synchronous links only for non-critical transactions

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 13

Topics
Communication
Synchronous BAPIs
Asynchronous BAPIs
Replication
Summary

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 14

Page 7

BAPIs - Stable, Standardized


Access to SAPs Business Objects
SAP Business Objects (BO) cover
a broad range of R/3 business data
and processes. They can be accessed
at the business process level using

BAPIs
Business Application
Programming Interface
Application n

BAPI
BAPI

Invoice
BAPI
BAPI

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 15

Synchronous BAPIs
BAPI invocation by ALE

Query distribution model

local?

no

yes

BAPI

BAPI

Business Component n

Business Component 1

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 16

Page 8

Customer Distribution Model


New York

Chicago
Chicago

Inventory
Inventory
control
control

Inventory
Inventory
control
control

01
01
20
20

Division
Division

Dallas
Dallas

Mat. Group
Mat. Group

INVCON

Inventory
Inventory
management
management

Seattle

INVCON

Inventory
Inventory
management
management

London
London

INVCON

Inventory
Inventory
management
management

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 17

The Application Queries the Model

z
z
z
z

The application queries the ALE distribution model


T Has the BAPI to be called on a different system?
T Which system is the server?
T Standard function modules / BAPIs available

Depending on the result:


T The BAPI is called on a different system
T The function is processed locally

The model directly controls distribution


BAPI: DistributionModel.GetInfo

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 18

Page 9

R/3 Middleware Connectivity


SAP@Web
SAP@Web
Studio
Studio

te
In
ABAP
ABAP
Workbench
Workbench

et
rn

Business
Connector

CO
M

Messaging

Visual
Visual
Studio, VB
Studio, VB

BAPI

BAPI
BAPI

SAPGUI

DIAG

DCOM
Component
Connector

Delphi
Delphi
Connect
Connect
for SAP
for SAP

SAP
Component
BAPI

Ja
va

Access
Builder

BOR

BA
OR
C

BAPI

CB
Connector

Visual Age
Visual Age
for Java
for Java

SAP AG 1998

Object
Bridge

BAPI

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 19

BAPI Proxies in Non-SAP Environments

Invoke BAPIs from


outside R/3
z Process control outside
z Export BAPIs into
development
environments
z Leverage skills in Java,
VB, C++, ...
z Extend R/3, e.g. by new
front-end

Non-SAP Environment
Non-SAP Environment
Process
Control

Obj.

Proxy

BAPIProxies

BAPI

Obj.
Proxy

Obj.

Other
Objects

BAPI

Business Object
Repository

R/3 Business Backbone


R/3 Business Backbone
SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 20

Page 10

BAPIs in Visual Basic 98

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 21

BAPIs in IBM VisualAge for Java

z
z
z
z
z

Access Builder for SAP R/3


is shipping
Based on SAPs Java-enabled
BAPIs
No difference between native
JavaBeans and Java BAPIs
Applications can be used in
any Java VM
100%-pure Java

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 22

Page 11

BAPIs in Inprise Delphi/Connect

z
z

SAP AG 1998

Delphi/Connect for SAP


is shipping
JBuilder/Connect for SAP
will also be BAPI powered

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 23

SAP Business Connector

z
z
z
z
z
z
z
z

SAP`s open 2-way interface to business partners in


the internet on application level (R/3 to R/3, R/3 to
non R/3)
Communication in the internet via transmission of
BAPI-XML-documents
Build upon SAP`s BAPI- and ALE technology
Adds special business services to BAPI and ALE
Integration with SAPs Internet Transaction Server (ITS)
Access from within R/3 via ABAP, ABAP-OO, workflow
Build in authorization, security and encryption services
Available for R/3 version 3.1 and higher

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 24

Page 12

BAPIs in R/3

z
z
z
SAP AG 1998

BAPI Information in
BAPI Browser (Transaction
BAPI)
Receiver Determination
BAPI Call via RFC

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 25

Receiver Determination for Synchronous BAPIs


in R/3

Function ale_sync_bapi_get_receiver
T Importing

OBJECT
METHOD

T Tables

RECEIVER_INPUT (optional)
RECEIVERS
FILTEROBJECT_VALUES

T Exceptions

Output: RECEIVERS
T Logical System
T RFC destination

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 26

Page 13

Determination of Filter Objects in R/3

A function module exist which tells the application


which filters are relevant for a BAPI
T ale_bapi_get_filterobjects

IMPORTING

z OBJECT
z METHOD
TABLES
z RECEIVER_INPUT
z FILTEROBJECTS
EXCEPTIONS ...

(OPTIONAL)

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 27

Receiver Determination for Synchronous


BAPIs / Unique Receiver

Function ale_sync_bapi_get_unique_receiver
T Importing

OBJECT
METHOD

T Exporting

Receiver

T Tables

FILTEROBJECTS_VALUES

T Exceptions

Output: RECEIVER
T Logical System
T RFC destination

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 28

Page 14

BAPI Call via RFC

z
z
z

Call Function <name of function module>


destination <RFC-destination>
<name of function module> : see BAPI Browser
(transaction BAPI) to get information from
Business Object Repository
<RFC-destination> : return parameter of receiver
determination

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 29

Topics
Communication
Synchronous BAPIs
Asynchronous BAPIs
Replication
Summary

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 30

Page 15

Asynchronous BAPIs
BAPI invocation by ALE

Query distribution model


ALE Error Handling
ALE Error Handling
ALE
ALE
no BAPI to IDoc
BAPI to IDoc outlocal?
outconversion
conversion bound
bound

IDoc

ALE
ALE IDoc to BAPI
IDoc to BAPI
inbound conversion
inbound conversion

yes

yes

BAPI

error?

BAPI

no
ALE Links

Business Component 1

Business Component n

generated coding
SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 31

ALE Async. Output Processing


Application

ALE layer

Need to send
a message?

BAPI to IDoc
conversion

Comm. layer

Customer
Distribution Model

Receiver determination
Segment filter
Field value conversion
Version change

Database

Links

Dispatch
control

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 32

Page 16

Communication
Comm. layer
sender

Comm. layer
receiver

tRFC
Middleware
TCP/IP
File-Transfer
....

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 33

ALE Async. Input Processing


Comm. layer

ALE layer

Application

C
Version change
Segment filter
Field value conversion
Input
control

A
IDoc to BAPI
conversion

Simultaneously update
IDoc's status

Database

BAPI

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 34

Page 17

Receiver Determination for Asynchronous


BAPIs

Function ale_async_bapi_get_receiver
T Importing

OBJECT
METHOD

T Tables

RECEIVER_INPUT (optional)
RECEIVERS
FILTEROBJECT_VALUES

T Exceptions

Output: RECEIVERS
T Logical System

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 35

Integration BAPI/IDoc

z
z

Asynchronous BAPIs use IDoc technology


There are special requirements for asynchronous
BAPIs
T A COMMIT WORK must not be executed in the BAPI
T The RETURN parameter of the BAPI must use the reference

z
z

structure BAPIRETURN1 or BAPIRET2


T All other EXPORT parameters of the BAPI are ignored

The required objects can be generated


This can also be used for the communication with
non-R/3-systems

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 36

Page 18

Generating IDoc Interface for Asynchronous


BAPIs

For an asynchronous BAPI, specified by business


object and method, the following objects can be
generated:
T
T
T
T

Segments of the IDoc


IDoc structure
Message type
Function module that writes the BAPI parameters into an IDoc
on the outbound side and distributes the IDoc
T Function module that reads the BAPI parameters out of the IDoc
on the inbound side and calls the BAPI

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 37

Using the Generated Objects in R/3

z
z
z
z

The application only has to call the generated


outbound function module
This function module has the same interface as the
BAPI plus an additional parameter for the receivers of
the IDoc
After the call of the generated function module the
application has to do a COMMIT WORK. Otherwise the
IDoc would be created but not sent
Everything else runs automatically in the background

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 38

Page 19

Topics
Communication
Synchronous BAPIs
Asynchronous BAPIs
Replication
Summary

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 39

ALE Master Data Replication

z
z
z
z

Replicas of master data records must be available to


local systems
In a distributed environment, not all views of a master
data object (e.g. material) need to be maintained
centrally
You can specify which fields of a data object will be
replicated
A special ALE service is used for the replication

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 40

Page 20

DBMS-Replication vs. R/3-ALE


Replication

DBMS

ALE

Pull/Push

Yes

Yes

Log-based

Yes

Yes

Horizontal/vertical data partitioning

Yes

Yes

Synchronous

Yes

No

Asynchronous

Yes

Yes

Filtering (rule-based)

Yes

Yes

Field conversions

No

Yes

Version conversion

No

Yes

Administration Tools

Yes

Yes

Automatic

Yes

Yes

Manual

Yes

Yes

DBMS dependend

Yes

No

ALE is an application-driven data replication independend on


the underlaying DBMS !
DB-Replication is a proprietary database technology
of the DBMS vendor !
SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 41

ALE Master Data Replication: Change pointers


Application
posting

Change document
service

ALE layer
Distribution
Model

Create/change
master data

Create change
document

Standard ALE
output

ALE relevant?
Write pointers

Batch job / manual

Create IDOCs

Master data

Change docs.

Change pointers

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 42

Page 21

ALE Configuration Data Replication

Distribution of customizing objects can be modeled in


the distribution model
T This defines the reference system for a given object
T Maintenance of these objects is automatically disabled in other

z
z

systems

Distribution between R/3 systems is effected via CTS


(Correction and Transport System)
Information about configuration data changes can be
distributed to non SAP systems

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 43

Topics
Communication
Synchronous BAPIs
Asynchronous BAPIs
Replication
Summary

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 44

Page 22

Summary

z
z
z

Communication can be synchronous or asynchronous


There are different processes for synchronous and
asynchronous communication available in R/3
ALE provides special services for data replication

SAP AG 1998

<J7> SAPTechEd 98, Karlsruhe (Rademann) / 45

Page 23

You might also like