29

BAPI Presentation

Embed Size (px)

DESCRIPTION

BAPI_presentation

Citation preview

Page 1: BAPI Presentation
Page 2: BAPI Presentation

BAPI Presentation

Chaitanya Latha.T

Lakshmi Durga.P

Page 3: BAPI Presentation

API method of a business object(BO).

Implemented as an RFC

What is BAPI ?

Page 4: BAPI Presentation

Architecture

Page 5: BAPI Presentation

Business Object

Provides Object Oriented view of R/3 business functionality.

Encapsulates R/3 data and business processes, by hiding the structure and implementation.

Page 6: BAPI Presentation

Object types and Object instance

Each BO belongs to specific class based on nature and characteristics. These Object classes are called Object Types.

Each individual SAP business object is a representation, or instance, of its object type

Page 7: BAPI Presentation

SAP BO

Object Type Key fieldsAttributesMethodsEvents Interfaces

Page 8: BAPI Presentation

Object Type

The object type describes the features common to all instances of that object type. This includes information such as the unique name of the object type.

Page 9: BAPI Presentation

Key Fields

To access a specific instance of the object type

Ex: SalesDocument number of sales order.

Can Conists of several key fields. All the key fields should be from same table. Must be used as parameters in instance

dependent BAPIs.

Page 10: BAPI Presentation

Attributes

Specific property of an object. They can be from different tables.

Ex: SalesDocumentType of salesorder.

DataBase AttributesVirtual Attributes(Macros)

Object Virtual AttributesMultiline Virtual Attributes

Page 11: BAPI Presentation

Methods

An operation that is performed on a business object either to access or process business data.

Adding a method With remote enabled With out remote enabled

Page 12: BAPI Presentation

Events

Signals to notify that the status change of an business object. Used only in workflow.

Page 13: BAPI Presentation

Interface

Group of related methods associated with an object type.

Documentation Describes the functionality of methods. Possible return messages.

Page 14: BAPI Presentation

Business Object Repository

The Business Object Repository (BOR) is the repository of Business Objects in the R/3 System. It contains SAP Business Objects and SAP Interface types methods and their attributes

 Transaction Code: /bapi

Page 15: BAPI Presentation

BOR use

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.

Manages BAPIs in release updates.

Page 16: BAPI Presentation

Relation between Objective types

Inheritance – allowing common attributes and methods to be passed automatically from supertypes to subtypes

Composition – "Is part of" relationship between object types

Interface Implementation - expressing which object types support an interface.

Association – an attribute referencing another object type as an object reference.

Page 17: BAPI Presentation

RFC Implementation Function Module which is a remote enabled

one.

Parameters Import Export Table(Import/Export)

Exceptions

Page 18: BAPI Presentation

Programming Guidelines The following steps are to be done for an RFC

underling a BAPI.BAPIRETURN structure is must as an export

parameter To be processed without returning any screen

dialogs to the calling application Should not contain

Following statements are not allowed.Call TransactionSubmit ReportSubmit Report and Return

Page 19: BAPI Presentation

Accessing BAPIs Object-Oriented Access Function Oriented Access

R/3 Server

Business Object Repository

Business Object : Sales Order

Function module (RFC capable)

BAPI BAPI

BAPI BAPI

BAPI BAPI

Function module (RFC capable) Function module (RFC capable)

Function Builder

Object-oriented access RFC access

Page 20: BAPI Presentation

Object-Oriented Access to BAPIs Development Tools/MiddleWare

BAPI ActiveX Control BAPI C++ Class library BAPI Java Class library R/3 Dcom Component Connector

Programming Environments Delphi connect for SAP Access Builder for SAP R/3 Visual Studio

Page 21: BAPI Presentation

Object Oriented

Set boOrder = oBAPICtrl.GetSAPObject("SalesOrder")Set oOrderHeader = oBAPICtrl.DimAs(boOrder, _

"CreateFromDat1", "OrderHeaderIn")Set otabItems = oBAPICtrl.DimAs(boOrder, _

"CreateFromDat1", "OrderItemsIn")Set otabPartners = oBAPICtrl.DimAs(boOrder, _

"CreateFromDat1", "OrderPartners")Calling the BAPIboOrder.CreateFromDat1

OrderHeaderIn:=oOrderHeader, OrderPartners:=otabPartners, OrderItemsIn:=otabItems, Return:=oReturn

Page 22: BAPI Presentation

Function OrientedCalling RFC theModule.setFunctionName("ZEMP_GETLIST"); Module.callReceive();setting parameters dept = facMan.getSimpleFactory().createSimple( new

SimpleInfo(null, IFieldInfo.RFCTYPE_CHAR,10, 0),"DEPT" );

deptTable.setParameterName("emp_table");Import/Export theModule.addImportParam(dept); theModule.addTableParam(deptTable);

Page 23: BAPI Presentation

Naming Conventions

Business Object: BUS0001 where 0001 is an active function group.

Function Module: BAPI_<object name>_<methodName>

Method Name: max 30 chars. Should start with capital letter. GetDetail

Reference fields: Structures. Should start with BAPI…

Page 24: BAPI Presentation

Standard BAPIs

They provide basic functions and can be used for most SAP BO. The Object methods with BAPIs can differentiate between Instance Methods and Class Methods.

BAPIs for Reading Data :GetList Method type ClassGetDetail InstanceGetStatus InstanceExistenceCheck InstanceBAPIs for Creating or Changing Data :Create or CreateFromData ClassChange InstanceDelete and Undelete InstanceBAPIs for Replicating BO Instances :Replicate and SaveReplica Class

Page 25: BAPI Presentation

ServiceBAPIs They provide basic help functions.

HelpValues.GetList (F4 help) BapiService.FieldHelpGetDocu BapiService.InterfaceGetDocu BapiService.TransactionCommit BapiService.Rollback BapiService.DataConversionInt2Ext1 BapiService.DataConversionEnt2Int1

Page 26: BAPI Presentation

Customer Modifications to BAPIs

Creating a BAPI for an existing Business Object.Copy the function module and make the

required changes

Creating a BAPI for new Business Object. Inherit the object and override the method

Page 27: BAPI Presentation

Enhancements It is carried out ensuring the syntax and downward compatibility. Compatible interface enhancements.

New Optional parameters New optional fields to structure

Incompatible interface enchancements Changes to the field length Changes to the field type Inserting a field within a structure Deleting parameters and fields Adding new mandatory fields or mandatory parameters

Page 28: BAPI Presentation

CheckList Have you identified the SAP Business Object

involved? Is the BAPI assigned to the appropriate SAP

Business Object? Have you identified the key fields and

attributes of this Business Object? Have you defined the function module

interface using only EXPORTING, IMPORTING and TABLES parameters?

Page 29: BAPI Presentation

CheckList Have you defined the formats in which the values

must be transferred in the function module interface? Have you included a Return parameter? Are you using the Dictionary structure BAPIRETURN1

or BAPIRET2 for the Return parameter (as of Release 4.0)?

Did you create the function group, if required? Did you create the function module? Did you create the documentation for the BAPI in the

Function Builder? Did you use the program to map between internal and

external data formats?