0% found this document useful (0 votes)
58 views32 pages

Bapi (Business Application Programming Interface) : August 12, 2011 1

The document discusses Business Application Programming Interfaces (BAPIs) in SAP systems. It provides an overview of BAPIs and their structure, including business objects and implementing BAPIs. The document outlines how to define and develop a BAPI, including creating programming objects, testing, and releasing/freezing the BAPI. It also reviews guidelines for BAPI programming, such as documentation standards, error handling, and interface design best practices.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views32 pages

Bapi (Business Application Programming Interface) : August 12, 2011 1

The document discusses Business Application Programming Interfaces (BAPIs) in SAP systems. It provides an overview of BAPIs and their structure, including business objects and implementing BAPIs. The document outlines how to define and develop a BAPI, including creating programming objects, testing, and releasing/freezing the BAPI. It also reviews guidelines for BAPI programming, such as documentation standards, error handling, and interface design best practices.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

BAPI (Business Application Programming Interface)

August 12, 2011

Agenda

Introduction to BAPI Structure of a BAPI Business Object Implementing a BAPI Error Handling Rules & Guidelines for BAPI Programming

August 12, 2011

Overview

August 12, 2011

Uses

August 12, 2011

Example: Flight Booking Business Object

August 12, 2011

Business Objects - Introduction

Business object technology and business object programming are based on the concept of "business objects". Real world objects, for example an employee or a sales order, are modelled as business objects in business application systems, such as the R/3 System. You can visualize the SAP Business Objects as "black boxes" that encapsulate R/3 data and business processes, thus hiding the details of the structure and implementation of the underlying data. To achieve this encapsulation, the SAP Business Objects are constructed as entities with multiple layers:

August 12, 2011

Business Object - Layers

August 12, 2011

Accessing Business Objects (1)

As the graphic shows, the interface layer separates a Business Object's data and the applications and technologies that can be used to access it. To the outside, the SAP Business Objects reveal only their interface, which consists of a set of clearly defined methods. Applications can only access the Business Object data by the object's methods. An application program that accesses an SAP Business Object and its data only needs the information required to execute the methods.

August 12, 2011

Accessing Business Objects (2)

Therefore, an application programmer can work with the SAP Business Objects and invoke their methods without having to know or consider the object's underlying implementation details. The set of methods that is associated with a Business Object represents the object's behaviour. When a method is executed on a Business Object, the method can change the object's internal state, that is, the object's data. For example, one method that you can use on the Business Object "Employee" is to "check for the employee's existence".

August 12, 2011

BOR Business Object Repository Introduction (1)

All SAP Business Object types and their methods are identified and described in the R/3 Business Object Repository (BOR). The BOR was first implemented with R/3 Release 3.0, the same time when the SAP Business Objects and the SAP Business Workflow were introduced. When it was first released, the BOR was used primarily by the SAP Business Workflow.

August 12, 2011

10

BOR Business Object Repository Introduction (2)

The BOR contains two categories of object types:

Business object types The SAP Business Object types are arranged within the BOR in a hierarchical structure based on the R/3 business application areas, such as sales, material management, etc.

Technical object types These are items such as texts, work items, archived documents, as well as development and modelling objects

August 12, 2011

11

BAPI Explorer

August 12, 2011

12

BAPI Explorer Legends

August 12, 2011

13

Business Objects In the BAPI Explorer

August 12, 2011

14

BAPIs In the BAPI Explorer

August 12, 2011

15

Business Object Builder

August 12, 2011

16

Standard BAPIs

August 12, 2011

17

BAPIs Are Implemented as Function Modules

August 12, 2011

18

Calling A BAPI From a ABAP Program

August 12, 2011

19

BAPI Interface

A BAPI interface is defined by: Import parameters, which contain data to be transferred from the calling program to the BAPI Export parameters, which contain data to be transferred from the BAPI back to the calling program Import/export (table) parameters for both importing and exporting data

August 12, 2011

20

Exception Handling

August 12, 2011

21

Defining & Implementing a BAPI

Scenario Scenarioin inwhich which the theBAPI BAPIwill willbe be used used

Review Review BAPI BAPI concept concept and and scenario scenario

Defining a BAPI and its Interface

Process Flow
Releasing and freezing the BAPI Creating Creating Individual Individual Programming Programming Objects Objects Testing the BAPI

August 12, 2011

22

Releasing & Freezing the BAPI

OBJECTIVE: To release the function module the BAPI is based on and the method in the BOR To freeze the BAPI as a method in the BOR ESSENTIALS: A BAPI is available as a Business Object method only after it is released and frozen Once a BAPI is released and frozen, all changes made to it are automatically checked for compatibility in the BOR and the ABAP dictionary. Incompatible changes are rejected
August 12, 2011 23

Releasing & Freezing the BAPI

People responsible for the development objects and quality control should be closely involved with this process TASKS Select Function module, Release, Release to release the function module in the function builder In the Business Object Builder, set the status of the method to released. Select the appropriate SAP Business Object and expand the node for Methods

August 12, 2011

24

Releasing & Freezing the BAPI

Place the cursor on the BAPI and select Edit, Change Status, Released Place the cursor again on the BAPI and select Utilities, API methods, Freeze method to freeze the method Check the new status of the function module in the Function Builder and the method in the BOR

August 12, 2011

25

Rules & Guidelines for programming BAPIs

Currency amounts with decimal points must have a decimal point in the interface Document the Business object Document all interface parameters Documentation on return parameters must include descriptions of all possible return values and messages Documentation on mandatory parameters must specify fields to be filled

August 12, 2011

26

Rules & Guidelines for programming BAPIs

BAPIs must not produce any screen output Database changes can only be made through updates To transfer values, do not use the Set and Get parameters and the global memory It is recommended that every BAPI must be able to carry out its own authorization checks Minimize interface complexity A BAPI should always select a range between A-Z, a-z and 0-9

August 12, 2011

27

Rules & Guidelines for programming BAPIs

The BAPI must not use the following commands: COMMIT WORK CALL TRANSACTION SUBMIT REPORT SUBMIT REPORT and RETURN

Data for customizing or language dependent values cannot be use in interface parameters

August 12, 2011

28

Rules & Guidelines for programming BAPIs

All field and parameter names must be in English All quantity and amount fields must have quantity unit fields All currency amount fields must have currency indicator fields Key fields in GetDetail and Get List BAPIs must be displayed in a text field It is recommended that F4 input help be provided for fields in BAPI parameters

August 12, 2011

29

Rules & Guidelines for programming BAPIs


A BAPI must have a RETURN parameter for returning messages to the calling application Exceptions for using an internal data format in BAPIs are: Currency amount fields Quantity fields ISO codes Fields having an internal key Use a period for the decimal point

August 12, 2011

30

Exercises

August 12, 2011

31

Thank You

August 12, 2011

32

You might also like