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
594

Hi,

1.can u tell me what is bapi.

2. how to create sales order and purchase order with bapi plz send coding.

3. main which area we do bapi.

Thanks,

srinivas

.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
569

BAPI (Business Application Programming Interface) is an API method of a business object which intern is a RFC enabled Function Module.

Business Objects are the Objects which has business sence associated to it. Ex. Sales Orders, Purchase Orders etc.

The Properties of BAPI are:

  • Every BAPI name should start with letters 'BAPI'.

  • It is an API method of a Business Object.

  • it does not contain a internal COMMIT statement in the Function Module.

  • It does not contain "CALL TRANSACTION" statements.

  • BAPI do not raise 'EXCEPTIONS'.

a RETURN structure is defined as an interface parameter of a BAPI which is used to log all the errors, warnings and the successful processes tha are triggered in the course of execution of a BAPI.

A successful execution of a BAPI requires the data to be commited and this process of performing a COMMIT is achieved by calling the BAPI_TRANSACTION_COMMIT' explicitly if there are no errors logged in the RETURN structure.

There are two types of BAPI's: Instance Dependent & Instance Independent.

BAPI provides an access to the SAP system for external applications to have the business data processed in the form of web services. When BAPI's are used to post the data in SAP system these are used as Function Modules.

For Sales order:

Check these BAPI

BAPI_SALESORDER_CHANGE

BAPI_SALESORDER_CREATEFROMDAT2

for Purchase Order:

check these combination

1) BAPI_PO_CREATE

2) BAPI_TRANSACTION_COMMIT

Reward points if useful.

4 REPLIES 4
Read only

p291102
Active Contributor
0 Likes
569

Hi,

Following report is the example for BAPI test report for purchase order item details .

REPORT YMS_BAPITEST .

*REPORT ZBAPI_1.

DATA : BEGIN OF I_POITEM OCCURS 0.

INCLUDE STRUCTURE BAPIEKPO.

DATA : END OF I_POITEM.

PARAMETERS P_EBELN LIKE EKKO-EBELN. "default '4500012164'..

CALL FUNCTION 'BAPI_PO_GETDETAIL'

EXPORTING

PURCHASEORDER = P_EBELN

  • ITEMS = 'X'

  • ACCOUNT_ASSIGNMENT = ' '

  • SCHEDULES = ' '

  • HISTORY = ' '

  • ITEM_TEXTS = ' '

  • HEADER_TEXTS = ' '

  • SERVICES = ' '

  • CONFIRMATIONS = ' '

  • SERVICE_TEXTS = ' '

  • EXTENSIONS = ' '

  • IMPORTING

  • PO_HEADER =

  • PO_ADDRESS =

TABLES

  • PO_HEADER_TEXTS =

PO_ITEMS = I_POITEM.

  • PO_ITEM_ACCOUNT_ASSIGNMENT =

  • PO_ITEM_SCHEDULES =

  • PO_ITEM_CONFIRMATIONS =

  • PO_ITEM_TEXTS = .

  • PO_ITEM_HISTORY =

  • PO_ITEM_HISTORY_TOTALS =

  • PO_ITEM_LIMITS =

  • PO_ITEM_CONTRACT_LIMITS =

  • PO_ITEM_SERVICES =

  • PO_ITEM_SRV_ACCASS_VALUES =

  • RETURN =

  • PO_SERVICES_TEXTS =

  • EXTENSIONOUT =

LOOP AT I_POITEM.

WRITE : / 'PO NUMBER = ' , I_POITEM-PO_NUMBER COLOR COL_HEADING,

/ 'ITEM = ' , I_POITEM-PO_ITEM,

/ 'MATERIAL NAME = ' , I_POITEM-MATERIAL,

/ 'MATERIAL = ' , I_POITEM-PUR_MAT,

/ 'CHANGED ON = ' , I_POITEM-CHANGED_ON,

/ 'SHORT TEXT = ' , I_POITEM-SHORT_TEXT,

/ 'COMPANY CODE = ' , I_POITEM-CO_CODE,

/ 'PLANT = ' , I_POITEM-PLANT,

/ 'MATERIAL GROUP = ' , I_POITEM-MAT_GRP,

/ 'QUANTITY = ' , I_POITEM-QUANTITY LEFT-JUSTIFIED,

/ 'UNIT = ' , I_POITEM-UNIT,

/ 'NET PRICE = ' , I_POITEM-NET_PRICE LEFT-JUSTIFIED.

ULINE.

ENDLOOP.

Thanks,

<b>Sankar M</b>

Read only

Former Member
0 Likes
570

BAPI (Business Application Programming Interface) is an API method of a business object which intern is a RFC enabled Function Module.

Business Objects are the Objects which has business sence associated to it. Ex. Sales Orders, Purchase Orders etc.

The Properties of BAPI are:

  • Every BAPI name should start with letters 'BAPI'.

  • It is an API method of a Business Object.

  • it does not contain a internal COMMIT statement in the Function Module.

  • It does not contain "CALL TRANSACTION" statements.

  • BAPI do not raise 'EXCEPTIONS'.

a RETURN structure is defined as an interface parameter of a BAPI which is used to log all the errors, warnings and the successful processes tha are triggered in the course of execution of a BAPI.

A successful execution of a BAPI requires the data to be commited and this process of performing a COMMIT is achieved by calling the BAPI_TRANSACTION_COMMIT' explicitly if there are no errors logged in the RETURN structure.

There are two types of BAPI's: Instance Dependent & Instance Independent.

BAPI provides an access to the SAP system for external applications to have the business data processed in the form of web services. When BAPI's are used to post the data in SAP system these are used as Function Modules.

For Sales order:

Check these BAPI

BAPI_SALESORDER_CHANGE

BAPI_SALESORDER_CREATEFROMDAT2

for Purchase Order:

check these combination

1) BAPI_PO_CREATE

2) BAPI_TRANSACTION_COMMIT

Reward points if useful.

Read only

Former Member
0 Likes
569

BAPIs uses the technique of business objects in broad sense, and they are object oriented representation of business scenarios or techniques.

BAPIs are implemented as FMs in ABAP u can just call the appropriate BAPI function module to get the work done

Read only

Former Member
0 Likes
569

Hi Srinivas,

What is BAPI?

BAPI (Business Application Programming Interface) is a set of interfaces to object-oriented programming methods that enable a programmer to integrate third-party software into the proprietary R/3 product from SAP. For specific business tasks such as uploading transactional data, BAPIs are implemented and stored in the R/3 system as remote function call (RFC) modules.

Creating BAPI:

http://help.sap.com/saphelp_nw04/helpdata/en/8b/40aeefc95c11d1ad0c080009b0fb56/content.htm

BAPI Convention:

http://www.sap-img.com/abap/bapi-conventions.htm

Coding Example:

http://help.sap.com/saphelp_46c/helpdata/en/dd/5009660aa411d2ad1b080009b0fb56/content.htm

Regards,

Rajesh

<b>Please award points if found helpful.</b>