19 Ağustos 2010 Perşembe

Remote Function Calls and BAPIs

SAP systems use the following interface technologies that are listed in the above


graphic:

• ALE: Application Link Enabling

• BAPI: Business Application Programming Interface

• CPI-C: Common Program Interface Communication

• EDI: Electronic Data Interchange

• HTTP: HyperText Transfer Protocol

• LU 6.2: Logical Unit Type 6.2

• RFC: Remote Function Call

• OLE: Object Linking and Embedding

• SMTP: Simple Mail Transfer Protocol

• SOAP: Simple Object Access Protocol

• TCP/IP: Transmission Control Protocol / Internet Protocol

• XML: Extensible Markup Language

Remote Function Call

The Remote Function Call interface is an SAP interface protocol based on CPI-C

and TCP/IP. It simplifies the programming of communication processes between

different systems. RFCs enable you to call and execute predefined functions in a

remote system – or within the same system. RFCs manage the communication

process, parameter transfer and error handling.

RFC describes an interface, not the programming language in which the function


runs. You can also use RFCs to call functions in non-SAP systems. The procedure

for RFC communication between two SAP systems is that the calling system uses

an RFC definition in the system called to access a specific function.

This function is normally a remote-enabled function module. You can also,

depending on the release, use RFC to call functions in SAP R/2 systems.
If you want to start external programs remotely, you need an RFC interface outside


the SAP system. This could be, for example, a simple Dynamic Link Library

(DLL). Every RFC interface is bidirectional, so external programs can also use

RFC to access functions in SAP systems.

Note: All function modules (including those that are remote-enabled)

are created, together with their import and export parameters, using the

Function Builder. You can call the Function Builder using Tools → ABAP

Workbench → Development → Function Builder or using transaction

code SE37.

To call an RFC module from an SAP system, you need to know the import

and export parameters (defined in the Function Builder), and there must be a

technical connection between the two systems. This connection is called an RFC

connection or an RFC destination.
You can manage your RFC connections using Tools → Administration →


Administration → Network → RFC Destinations or using transaction SM59.
In the above graphic you can see, on the left side, the calling system, in which


an RFC destination named DEST has been created. An RFC destination in

transaction SM59 should not be confused with an SAP system, since an RFC

connection can only point to one specific client in an SAP system. These are

therefore also referred to as connections between logical systems; this term is

used, above all, in the ALE environment.

This also means that you can have at least as many RFC connections between two

systems as there are clients in the target system. Since you can specify a logon

user for the destination in each RFC connection, you can therefore also access

clients in the target system several times, for example, with a different logon user

each time. If you need a bidirectional RFC connection between two systems, that

is, that the system called can also execute RFC modules in the calling system, then

you need to set up an equivalent second RFC connection in the system called.

Hint: When you are defining RFC destinations, RFC connections are

• Addressed to one client, when they are pointing at an SAP system

• Accessible from all clients in the system

In ABAP, you use RFCs to call a function module in another system as follows:

CALL FUNCTION

DESTINATION

EXPORTING ...

IMPORTING ...


The function to be executed in the target system is named. The name of the target

must refer to one of the RFC connections available. When you are creating an

RFC connection, you can specify logon data for the target system; if you do not do

this, you need to enter logon parameters when you start the RFC. Exporting

and Importing are used to pass parameters to the target function and to receive

the returned parameters. The function called in the target system is executed using

the user ID entered for the connection.

Note: You can also create RFC connections for which the user of the user

making the call is used in the target system. That means different users

can use the same connection in the target system. This procedure is also

called Trusted RFC. It is, of course, a prerequisite that identical users are

created in the source and target systems. Trusted RFC is explained in the

course ADM960 - Security in SAP System Environments.

The RFC has become the most important interface in the SAP environment. Some

special RFC modules, which follow certain conventions, are also known as BAPIs

(Business Application Programming Interfaces).

BOR and BAPIs

A Business Application Programming Interface (BAPI) is a standardized

programming interface that facilitates internal and external access to business

processes and data in SAP systems. BAPIs are defined in the Business Object

Repository as methods of SAP business objects and enable an object-oriented

view of business data in an SAP system. Functions that can be called using BAPIs

are normally implemented and stored in the ABAP Workbench Function Builder

as RFC-enabled function modules. You can display an overview of available

BAPIs in the BOR, for example, using the Business Object Repository pushbutton

in the Business Object Builder (Tools → ABAP Workbench → Development →

Business Object Builder), transaction SWO1. You can access the BOR directly

using transaction code BAPI.

BAPIs, which represent methods for business objects in an SAP system, are used


in a variety of contexts. Here are some possible uses for BAPIs:

• To link business processes across system boundaries (for example, when

using ALE)

• Used by SAP to integrate various solutions in the framework of mySAP

Business Suite

• To connect an SAP system to the Internet

• Used in conjunction with SAP Business Workflow

• To connect to external programs

Note: BAPIs are created and tested in exactly the same way as other

function modules, using the Function Builder, transaction SE37, and are

then defined as BAPIs in the BOR.

Hiç yorum yok:

Yorum Gönder