0% found this document useful (0 votes)
71 views

There Are 2 Types of Bapi's

There are two types of BAPIs: 1. Instance independent BAPIs which do not require input parameters, such as GETLIST(). 2. Instance dependent BAPIs which do require input parameters, such as GETDETAIL() and GETSTATUS(). The document then provides steps to manually update a bank's city and street using transaction FI02 and BAPI_BANK_CHANGE. It also develops a conversion program to update bank details from a flat file to SAP using functions like UPLOAD, BAPI_BANK_CHANGE, and BAPI_TRANSACTION_COMMIT. The last section notes that BAPI can connect SAP to SAP and SAP to non-SAP

Uploaded by

Trainning ABAP
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views

There Are 2 Types of Bapi's

There are two types of BAPIs: 1. Instance independent BAPIs which do not require input parameters, such as GETLIST(). 2. Instance dependent BAPIs which do require input parameters, such as GETDETAIL() and GETSTATUS(). The document then provides steps to manually update a bank's city and street using transaction FI02 and BAPI_BANK_CHANGE. It also develops a conversion program to update bank details from a flat file to SAP using functions like UPLOAD, BAPI_BANK_CHANGE, and BAPI_TRANSACTION_COMMIT. The last section notes that BAPI can connect SAP to SAP and SAP to non-SAP

Uploaded by

Trainning ABAP
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

There are 2 types of bapi's

1.Instance independent bapi : For which bapi's, we no need to provide the input thant bapi's are called
instance independent bapi
ex: GETLIST( ) bapi's are called instance independent bapi
2.Instance dependent bapi : For which bapi's, we must provide the input thant bapi's are called instance
dependent bapi
ex : GETDETAIL( ), GETSTATUS( ),...bapi's are called instance dependent bapi.

Object:Update the bank city & street using BAPI.


Steps to update the bank details manually: -

 Execute FI02.
 provide bank country key (IN),
 bank key (121516). Enter.
 Provide the street (SR Nagar),
 city (HYD).
 Save.

REPORT ZSPRAO_O_BAPI3.

PARAMETER : P_BCTRY LIKE BAPI1011_KEY-BANK_CTRY,


P_BKEY LIKE BAPI1011_KEY-BANK_KEY,
P_STREET LIKE BAPI1011_ADDRESS-STREET,
P_CITY LIKE BAPI1011_ADDRESS-CITY.

DATA WA_ADD LIKE BAPI1011_ADDRESS.


DATA WA_ADDX LIKE BAPI1011_ADDRESSX.

DATA WA_RETURN LIKE BAPIRET2.

WA_ADD-STREET = P_STREET.
WA_ADD-CITY = P_CITY.

WA_ADDX-STREET = 'X'.
WA_ADDX-CITY = 'X'.

CALL FUNCTION 'BAPI_BANK_CHANGE'


EXPORTING
BANKCOUNTRY = P_BCTRY
BANKKEY = P_BKEY
BANK_ADDRESS = WA_ADD
BANK_ADDRESSX = WA_ADDX
IMPORTING
RETURN = WA_RETURN .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.


IF WA_RETURN IS INITIAL.
WRITE 'BANK UPDATED'.
ELSE.
WRITE WA_RETURN-MESSAGE.
ENDIF.
Object:Develop a conversion program to update the bank city & street from flat file to sap system by
using BAPI. The flat file contains bank country key, bank key, street & city.

REPORT ZSPRAO_O_BAPI4.

TYPES : BEGIN OF TY_BANK,


BCTRY LIKE BAPI1011_KEY-BANK_CTRY,
BKEY LIKE BAPI1011_KEY-BANK_KEY,
STREET LIKE BAPI1011_ADDRESS-STREET,
CITY LIKE BAPI1011_ADDRESS-CITY,
END OF TY_BANK.

DATA WA_BANK TYPE TY_BANK.


DATA IT_BANK TYPE TABLE OF TY_BANK.

DATA WA_ADD LIKE BAPI1011_ADDRESS.


DATA WA_ADDX LIKE BAPI1011_ADDRESSX.

DATA WA_RETURN LIKE BAPIRET2.

CALL FUNCTION 'UPLOAD'


EXPORTING
FILETYPE = 'DAT'
TABLES
DATA_TAB = IT_BANK.

LOOP AT IT_BANK INTO WA_BANK.


WA_ADD-STREET = WA_BANK-STREET.
WA_ADD-CITY = WA_BANK-CITY.

WA_ADDX-STREET = 'X'.
WA_ADDX-CITY = 'X'.
CALL FUNCTION 'BAPI_BANK_CHANGE'
EXPORTING
BANKCOUNTRY = WA_BANK-BCTRY
BANKKEY = WA_BANK-BKEY
BANK_ADDRESS = WA_ADD
BANK_ADDRESSX = WA_ADDX
IMPORTING
RETURN = WA_RETURN .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.


IF WA_RETURN IS INITIAL.
WRITE / 'BANK UPDATED'.
ELSE.
WRITE WA_RETURN-MESSAGE.
ENDIF.

ENDLOOP.
Differences between BAPI and RFC(Remote function call)

Note: - BAPI is used to connecting from SAP to SAP as well as SAP to NON – SAP. Where as RFC is
used to connecting from SAP-SAP only.

You might also like