‎2008 Apr 25 7:58 AM
HI all,
I have some questations on BAPI function modue creation,
1. After creating bapi function module we have to release the
function module. why should we release the Function
module ?
2. Creating BAPI object,
What is API Method ?
Why should we create the API Method ?
What is the use of API ?
3. Here also we are doing like
Object Type Component -> To Implemented.
Object Type Component -> To Released.
Object Type -> To Implemented.
Object Type -> To Released.
What is the use of this ?
Thanks,
Nagaraju.
‎2008 Apr 25 8:17 AM
1)After creating bapi function module we have to release the
function module. why should we release the Function
module ?
Relesing means we transport copy of our object to quality for testing purpose..
2)Creating BAPI object,
What is API Method ?
Why should we create the API Method ?
What is the use of API ?
Creating BAPI object using SWO1 tcode is possible.
API defined application programming interface which is used to acess data from other application.
In BAPI we cannot directly send the functionmodule instead we assigned that function module to one API method ..now other applications acess this method using ABAP objects.
3)Here also we are doing like
Object Type Component -> To Implemented.
Object Type Component -> To Released.
Object Type -> To Implemented.
Object Type -> To Released.
What is the use of this ?
this means just we registered that function modules as API methods and when we release these will be store in BAPI tcode..for further processing.
Regards.
Dara.
‎2008 Apr 25 8:02 AM
Hi,
1. As the BAPI what we are creating is an RFC FM, we need to release the FM to get stored in BOR, so that the external system can easily identify it.
2. API method is reponsible to communicate with the external system and imports the values and exports the data. We need to release this inorder to reflect in the BOR.
Regards
Kannaiah
‎2008 Apr 25 8:14 AM
Thanks,
Can you explain in detail about BOR.
Where should we find the BOR ? Is there any transaction ?
Nagaraju.
‎2008 Apr 25 8:05 AM
Hi,
1.RFC is Remote Function Call - a function module, which can be called remotely from outside
BAPI is also a Remote enabled function module but the difference between BAPI and RFC is in BAPI there is a bussiness object attached to it which calls SAP application internally.
**********************************************
can you explain RFC and BAPI???
The difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.
RFC is the protocol used to call functions in an R/3 system by a caller external to R/3 or to call programs external to R/3 from an R/3 system. Functions can only be called via RFC, if they are tagged as RFC functions in the SAP development workbench. They are then called RFC function modules. BAPIs are complete sets of (BAPI) function modules that model a business application.
RFC is the protocol used by SAP for remote communication, that is, for communications between remote independent systems.RFC is used for communications between two independent SAP systems, or for communications between an SAP system and a non-SAP system, such as an external application. It can also be used for communications between modules on the same system.Using the RFC interfaces you can extend the functionality of R/3 applications from an external program.
An R/3 system also contains Business Application Programming Interfaces (also called Business APIs, or BAPIs), which provide a programming interface to business objects. BAPIs are a set of methods for working with and manipulating SAP business objects.Internally, BAPIs are implemented as function modules stored in the R/3 Function Builder. Each BAPI has an equivalent internally-named function module. However, you should use the BAPI and not the function module behind it, because the BAPI provides a stable, object-oriented view of R/3 applications and data. The internal function modules or even the fact that the BAPIs are implemented as function modules are not guaranteed to remain the same in future releases of R/3.
BAPI stands for Business Application Programming Interface.
It is a library of functions that are released to the public
as an interface into an existing SAP system from an external
system.
RFC is the protocol used to call functions in an R/3 system
by a caller external to R/3 or to call programs external to
R/3 from an R/3 system.
Functions can only be called via RFC, if they are tagged as
RFC functions in the SAP development workbench. They are
then called RFC function modules. BAPIs are complete sets of
(BAPI) function modules that model a business application.
When you are familiar with web developments: RFC can be
compared to HTTP and BAPIs are CGI applications.
In other words: A BAPI function is a function module that
can be called remotely using the RFC technology.
*****************************************************************************
RFC and BAPIs are remote enabled function modules. They are practicly the same. A BAPI is one step further as it usually is a self contained business function, such as "Create Purchase Order", or "Change Sales Document". BAPIs interface is very well defined and documented. BAPIs can be found in the BAPI browser via transaction BAPI. RFCs are just remote enabled function modules.
BAPI stands for Business Application Programming Interface. It is a library of functions that are released to the public as an interface into an existing SAP system from an external system.
RFC is the protocol used to call functions in an R/3 system by a caller external to R/3 or to call programs external to R/3 from an R/3 system. Functions can only be called via RFC, if they are tagged as RFC functions in the SAP development workbench.
*******************************************************************************
BAPIs are RFCs, the only difference is that BAPIs usually encapulate some complete business object. For example, creating a sales order, the BAPI would do all of the steps required to create a sales order.
**************************************************************************************
2.Create the API Method Using the BAPI WIZARD
The BAPI wizard is used toTo expose the remote function module as a BAPI. The wizard will generate some additional code, so the function module is a valid method of the BOR. This allows the BAPi to be called as a workflow method in addition to be called by an outside program.
Note: Each function module corresponds to a method in the BOR
Go to the Business Object Builder SWO1.
You can either create the new Object type as a subtype of an existing business object or create a new business object from scratch. In this example it would be obvious to create the Object type as a subtype of BUS2005 Production order. However, to illustrate how to create a new Object type from scratch, we will do this.
In the Object/Interface type field write the name of the new Business Object: ZORDERSTAT. Press enter and fill in the additional fields necessary to create the object type.
Supertype: Not relevant because we are creating our object from scratch
Program. This is the name of the program where the wizard generates code for the Object type, NOT the function module we created earlier. The program name must not be the name of an existing program.
Create the API Method Using the BAPI WIZARD
The BAPI wizard is used toTo expose the remote function module as a BAPI. The wizard will generate some additional code, so the function module is a valid method of the BOR. This allows the BAPi to be called as a workflow method in addition to be called by an outside program.
Note: Each function module corresponds to a method in the BOR
Go to the Business Object Builder SWO1.
You can either create the new Object type as a subtype of an existing business object or create a new business object from scratch. In this example it would be obvious to create the Object type as a subtype of BUS2005 Production order. However, to illustrate how to create a new Object type from scratch, we will do this.
In the Object/Interface type field write the name of the new Business Object: ZORDERSTAT. Press enter and fill in the additional fields necessary to create the object type.
Supertype: Not relevant because we are creating our object from scratch
Program. This is the name of the program where the wizard generates code for the Object type, NOT the function module we created earlier. The program name must not be the name of an existing program.
Create the API Method Using the BAPI WIZARD
The BAPI wizard is used toTo expose the remote function module as a BAPI. The wizard will generate some additional code, so the function module is a valid method of the BOR. This allows the BAPi to be called as a workflow method in addition to be called by an outside program.
Note: Each function module corresponds to a method in the BOR
Go to the Business Object Builder SWO1.
You can either create the new Object type as a subtype of an existing business object or create a new business object from scratch. In this example it would be obvious to create the Object type as a subtype of BUS2005 Production order. However, to illustrate how to create a new Object type from scratch, we will do this.
In the Object/Interface type field write the name of the new Business Object: ZORDERSTAT. Press enter and fill in the additional fields necessary to create the object type.
Supertype: Not relevant because we are creating our object from scratch
Program. This is the name of the program where the wizard generates code for the Object type, NOT the function module we created earlier. The program name must not be the name of an existing program.
After you have finished the wizard, you will notice that the ZGetOrderStatus has been added to the business object:
You can double-click on the method to see its properties. To use the business object you must change the Object type status to Implemented. Use menu Edit->Change releases status->Object type->To implemented. No you can test the object (Press F8).
Note that the BAPI wizard has added a wrapper class for the function module so it can be sued as method in the business object. Choose menu Goto->Program to display the program:
Implementation of object type ZORDERSTAT *****
INCLUDE <OBJECT>.
BEGIN_DATA OBJECT. " Do not change.. DATA is generated
only private members may be inserted into structure private
DATA:
" begin of private,
" to declare private attributes remove comments and
" insert private attributes here ...
" end of private,
KEY LIKE SWOTOBJID-OBJKEY.
END_DATA OBJECT. " Do not change.. DATA is generated
BEGIN_METHOD ZGETORDERSTATUS CHANGING CONTAINER.
DATA:
BAPIORDERSTATUSIMPORT LIKE ZBAPI_ORDER_STATUS_IMPORT,
RETURN LIKE BAPIRETURN,
TBAPISTAT LIKE ZBAPISTAT OCCURS 0.
SWC_GET_ELEMENT CONTAINER 'BapiOrderStatusImport'
BAPIORDERSTATUSIMPORT.
SWC_GET_TABLE CONTAINER 'TBapistat' TBAPISTAT.
CALL FUNCTION 'Z_BAPI_GET_ORDER_STATUS'
EXPORTING
BAPI_ORDER_STATUS_IMPORT = BAPIORDERSTATUSIMPORT
IMPORTING
RETURN = RETURN
TABLES
T_BAPISTAT = TBAPISTAT
EXCEPTIONS
OTHERS = 01.
CASE SY-SUBRC.
WHEN 0. " OK
WHEN OTHERS. " to be implemented
ENDCASE.
SWC_SET_ELEMENT CONTAINER 'Return' RETURN.
SWC_SET_TABLE CONTAINER 'TBapistat' TBAPISTAT.
END_METHOD.
Please check this link.
http://help.sap.com/saphelp_utilities472/helpdata/en/c6/4dce68eafc11d18a030000e829fbbd/frameset.htm
Use this its perfect for you
Regards,
Shiva.
‎2008 Apr 25 8:06 AM
Hi,
Check the following help on BAPI
http://help.sap.com/saphelp_nw70/helpdata/EN/7e/5e141a4a1611d1894c0000e829fbbd/frameset.htm
http://help.sap.com/erp2005_ehp_03/helpdata/EN/18/e2b23789e95378e10000009b38f8cf/frameset.htm
Reward if useful
Regards
Shiva
‎2008 Apr 25 8:17 AM
1)After creating bapi function module we have to release the
function module. why should we release the Function
module ?
Relesing means we transport copy of our object to quality for testing purpose..
2)Creating BAPI object,
What is API Method ?
Why should we create the API Method ?
What is the use of API ?
Creating BAPI object using SWO1 tcode is possible.
API defined application programming interface which is used to acess data from other application.
In BAPI we cannot directly send the functionmodule instead we assigned that function module to one API method ..now other applications acess this method using ABAP objects.
3)Here also we are doing like
Object Type Component -> To Implemented.
Object Type Component -> To Released.
Object Type -> To Implemented.
Object Type -> To Released.
What is the use of this ?
this means just we registered that function modules as API methods and when we release these will be store in BAPI tcode..for further processing.
Regards.
Dara.
‎2008 Apr 25 8:23 AM
‎2008 Apr 25 8:27 AM
BOR
The Business Object Repository (BOR) is the object-oriented repository in the R/3 System. It contains the SAP business object types and SAP interface types as well as their components, such as methods, attributes and events.
BAPIs are defined as methods of SAP business object types (or SAP interface types) in the BOR. Thus defined, the BAPIs become standard with full stability guarantees as regards their content and interface.
The BOR has the following functions for SAP business object types and their BAPIs:
Provides an object oriented view of R/3 System data and processes.
R/3 application functions are accessed using methods (BAPIs) of SAP Business Objects. Implementation information is encapsulated; only the interface functionality of the method is visible to the user.
Arranges the various interfaces in accordance with the component hierarchy, enabling functions to be searched and retrieved quickly and simply.
This finds the functionality searched for quickly and simply.
Manages BAPIs in release updates.
BAPI interface enhancements made by adding parameters are recorded in the BOR. Previous interface versions can thus be reconstructed at any time. When a BAPI is created the release version of the new BAPI is recorded in the BOR. The same applies when any interface parameter is created.
The version control of the function module that a BAPI is based on is managed in the Function Builder.
Ensures interface stability.
Any interface changes that are carried out in the BOR, are automatically checked for syntax compatibility against the associated development objects in the ABAP Dictionary.
Integration
A BAPI is implemented as a function module, that is stored and described in the Function Builder. You should only define a BAPI as a method of an SAP business object type in the BOR, if the function module that the BAPI is based on has been fully implemented.
Access to the BOR is restricted at SAP.
Please have a look at below link:
[Defining Methods in the BOR Using the BOR/BAPI Wizard |http://help.sap.com/saphelp_46c/helpdata/en/a5/3ec9734ac011d1894e0000e829fbbd/frameset.htm]
I hope it helps.
Thanks,
Vibha
Please mark all the useful answers