Sei sulla pagina 1di 6

BAPI : Business Application Programming Interface

RFC: Remote Function Call.


q.what are the different types of RFC we have ?
sol:
1. synchronous RFC - SNC
2. Asynchronous
-ASNC
3.Transactional RFC -tRFC
4. Queue RFC
-Qrfc
5. Parallel RFC
- Prfc
RFC is a protocol (communicatioon linkl) which can be used to connect different
R/3 or non R/3 systems remotely
To make an RFC connect to non SAP system then it has to be coneverted to a BAPI.
RFC is a functional mdoule created using SE37
when ever you have a business logic written in one routine like servlets in java
or function module in ABAP , then the business application has to call the API
logic to get the data.
API will act like a gateway between different business applications.
requirement;
Get the material details of 810 client remotely from 800.
800: callin program
810 : called program
RFC you have to create in 810
This RFC will be called remotel;y from 800 by using RFC destination.
Note: To call any function module remotely we require destionation
SM59: To create RFC destination
q. what are the different function nmodules we have in SAP?
sol:we have 3 different types of FM
Normal FM, RFC FM, Update FM
imoprt: material
export: mat_description
exception: INVALID_MATERIAL_NUMBER
NO_DATA_FOUND
Reference parameters are not allowed with RFC:
q. what is the default rfc?
sol: synchronous
syncronous RFC:
The function in calling program will wait for the reponse from the called progra
m.
If the business is intrested with the status of called program then we have to c
hoose syncronous rfc.
The calling program will wait till it receives any response from called program.
disadvantage:
1. Time execution can be more coz the calling system has to wait for the respons
e frrom called system.
2. If the connectivity is lost data is lost i.e we need to have a dedicated conn
ectivity between client(calling program) and RFC server(called program).

adv:
1.based on the status we can really perform other operations
2.memory consuption is very less in syncronous calls.
Asyncronous RFC:
if the calling rpogram is not intrested in called program response then always u
se asyncronous rfc.
adv:
1.This is faster than syn rfc as the calling program wont wait for response from
called program
disadv:
1.memeory consumption is more as the RFC server will be loaded with so many rfc
calls.
2. If the connectivity is lost data is lost
transactional RFC
Thelimitations of asyn rfc can be overcome in trfc.
trfc is also similar to asyn rfc.
we can set the time intervals like number of attempts in 30 minutes .
thus if RFC server is down it will try to reconnect every twice in every 30 minu
tes
qRFC:
This is also similar to tRFC but it queues the Trfc .
To make an rfc as qrfc we need to pass the queue name to function module
TRFC_SET_QUEUE_NAME
smq1 : outbound queues
smq2 : inbound queues
parallel rfc :
this is specific to local system only. we can run multiple rfcs on reserved work
processors. This also has load balancing which is not there with other rfcs.
multiple po's in same system .
q. how you connect any rfc remotely from a program?
sol: by calling the rfc and pasing the DESTINATION which was created in SM59
syntax:
call <rfc
fm> DESTINATION <destination name>.
How to create a custom BAPI?
sol:
1. create an rfc enabled function module using se37 and release it.
2. make sure you have a return parameter of type BAPIRET2 either in the export o
r tables paramter
(Note: This return paramter will be used to hold the exceptions ,error messages)
3.Create a business object using SWO1
4. make the rfc function module as an API method of business object
i.e here the functio module paramters are mapped into method paramters
5. implement the business object componenets first followed by business object t
ype
(i.e Bottom to top approach )
6. Release the business object type first followed by business obejct componenet

s
(i.e TOP TO BOTTOM Approach ).
7. Finally Generate the business object and test it
BO is like a class . i.,e its a template with different componenets like methods
, events, interface, attributes etc etc.
BAPI->

Potrebbero piacerti anche