Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI

Former Member
0 Likes
659

hi all ,

can any body tell me the use of BAPI ? how and why we use bapi in program?

i m new for BAPI ... .. can u plz. tell me with example ?

regards saurabh .

7 REPLIES 7
Read only

Former Member
0 Likes
629

Check this link for BAPI Step by Step Example

http://www.erpgenie.com/abap/bapi/example.htm

Regards,

Maha

Read only

Former Member
0 Likes
629

hi,

BAPI in a program is nothins but a function module.So you can it by calling a function.

Go to pattern give the BAPI name in Function module's name and press Enter.

or press Ctrl + F6 to do the same.

Gaurav

Read only

Former Member
0 Likes
629

Hi saurabh

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 craeted

earlier. The program name must not be the name of an existing program

Press enter and create the new business object. Note that when you create the business object a standard interface, an attribute ObjectType and the methods ExistenceCheck and Display are automatically generated. These cannot be changed !

The next step is to add the Z_BAPI_GET_ORDER_STATUS method to the business object Select Utillities -> API methods -> Add method and write the name of the functionmodule in the dialogbox. Next the dialogbox show below will be shown.

This is the start screen of the BAPI wizard. Proceed with wizard by pressing the button.

After you have finished the wizard, tyou will notice that the ZGetOrderStatus has been added to

the business object

You can doubleclick 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 thge 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.

Read only

Former Member
0 Likes
629

Hi,

BAPI is a remote function module and by using BAPI u can transfer data from nonsap sysytem to sap system, and it is user to insert the data in the required tables in the sap system.

http://www.erpgenie.com/abap/bapi/example.htm

plzz reward points if it helps.

Message was edited by:

manjari kotta

Read only

0 Likes
629

hi manjari....

as u told BAPI is used for transfering data from Non SAP system to SAP system

then what is diff between BAPI , BDC & LSMW ??

can u plz. tell me in detail ?

saurabh.

Read only

Former Member
0 Likes
629

Hi Sir ,

Plz have a look below .Hope it is suitable answer for your question.

Plz reward if useful.

LINK---->http://help.sap.com/saphelp_nw04/helpdata/en/5c/f3f0371bc15d73e10000009b38f8cf/frameset.htm

Thankx.

General Introduction to BAPIs (CA-BFA)

Purpose

BAPIs (Business Application Programming Interfaces) are the standard SAP interfaces. They play an important role in the technical integration and in the exchange of business data between SAP components, and between SAP and non-SAP components. BAPIs enable you to integrate these components and are therefore an important part of developing integration scenarios where multiple components are connected to each other, either on a local network or on the Internet.

BAPIs allow integration at the business level, not the technical level. This provides for greater stability of the linkage and independence from the underlying communication technology.

Integration

BAPIs can be used for the following types of integration:

Connecting SAP Systems to the Internet using the SAP Business Connector or Internet Application Components (IACs)

The standard SAP interfaces and all BAPIs are published centrally in the XML-based Interface Repository (IFR). They are stored as XML schema, which means that they are directly available for use in integration scenarios where multiple components communicate with one another using the Internet. You can access the Interface Repository in the Internet using the following address: http://ifr.sap.com.

Creating true component software, by enabling standardized communication between SAP components. The aim is to encapsulate the functions of the SAP system in independent business components that are integrated through a common interface (the BAPIs).

Connections to third-party software and legacy systems

Implementing distributed scenarios with asynchronous connections using Application Link Enabling (ALE)

Using PC programs as frontends to SAP Systems. These can be developed with Visual Basic (Microsoft), for example, or with Visual Age for Java (IBM)

Workflow applications that extend beyond system boundaries

Workflow applications that communicate with one another using the Internet

Customers? and partners? own developments

The diagram below shows how BAPI interfaces enable different types of applications to be linked with the SAP system.

Object-oriented technologies have become standard for communication between different software products. For this reason SAP has introduced business object types that structure the data and processes according to business criteria. Business object types are used to break the SAP system down into smaller, disjunctive units, improving its structure and reducing its complexity.

BAPIs are defined as methods for the business object types. As a result, both the object-oriented structures in SAP Systems and the opportunity for object-oriented access are offered. These object-oriented interfaces allow other components to directly access the application layer of an SAP system without having to know the specific implementation details.

The introduction of business object types and their BAPIs enable object orientation to be used in central information processing in companies. For example, you can reuse existing functions and data, achieve trouble-free technical interoperability, and implement non-SAP components.

The resulting architecture is illustrated in the graphic below. The main parts are:

Business components

SAP business components provide autonomous business functions and consist of business objects. For example, the business object types Employee and Applicant are assigned to business component Human Resources. Business processes are either implemented within a business component or across several components (distributed business processes).

Business object types

The object-oriented structure of the SAP system is based on business object types. A single business object type represents one business entity. It encompasses the functions and the data of this entity.

BAPIs

The Business Application Programming Interfaces allow object-oriented access to the SAP system through methods for the business object types. Together with the business object types, BAPIs define and document the interface standard at the business level.

Application Link Enabling (ALE)

The ALE integration service enables the technical integration of business processes that are carried out in different SAP and non-SAP systems. It involves distributing business object types across the systems using the ALE distribution model.

Integration scenarios

The design of all relevant situations in the Business Framework is based on concrete scenarios. Integration scenarios describe how components, business object types, and BAPIs interact, and integrate the systems by synchronizing business processes at a semantic level.

Read only

Former Member
0 Likes
629

hi saurabh,

BAPI is remotely Enabled, means u can call a bapi from JAVA, VB programs where as BDC and LSMW u can't

regards,

pavan