BAPI_CREATE_BANK used to Create Bank.
- Object Name : Bank.
- Object Type : BUS1011.
- BAPI Method : Create.
- BAPI : BAPI_CREATE_BANK.
- To find out the BAPI_CREATE_BANK details.
- Go to Transaction Code : SWO1.
- Object Name : BapiService.
- Object Type : SAP0001.
- BAPI Method : TransactionCommit.
- BAPI : BAPI_TRANSACTION_COMMIT.
- To find out the BAPI_TRANSACTION_COMMIT details.
- Go to Transaction Code : SWO1.
- Enter the Object Type name and click on Display.
- Go to Transaction Code :SE38.
- Enter the program name which start's with Y or Z< program name > and click on Create.
- Pop-up will appear.
- Enter the Title.
- Select the Attribute Type as : Executable Program.
- Click on SAVE.
- Source Code.
DATA : BANK_ADDRESS TYPE BAPI1011_ADDRESS,
RETURN TYPE BAPIRET2.
BANK_ADDRESS-BANK_NAME = 'J.D CRASTA &CO.'.
BANK_ADDRESS-STREET = 'BANTWAL'.
BANK_ADDRESS-CITY = 'MANGALORE'.
BANK_ADDRESS-BANK_BRANCH = 'MANGALORE'.
call function 'BAPI_BANK_CREATE'
exporting
bank_ctry = 'IN'
BANK_KEY = '786114'
bank_address = BANK_ADDRESS
* BANK_METHOD =
* BANK_FORMATTING =
* BANK_ADDRESS1 =
* I_XUPDATE = 'X'
IMPORTING
RETURN = RETURN
* BANKCOUNTRY =
* BANKKEY =
.
call function 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =
.
IF RETURN IS INITIAL.
MESSAGE 'The bank is created successfully' TYPE 'S'.
ELSE.
WRITE : / RETURN-MESSAGE.
ENDIF.
RETURN TYPE BAPIRET2.
BANK_ADDRESS-BANK_NAME = 'J.D CRASTA &CO.'.
BANK_ADDRESS-STREET = 'BANTWAL'.
BANK_ADDRESS-CITY = 'MANGALORE'.
BANK_ADDRESS-BANK_BRANCH = 'MANGALORE'.
call function 'BAPI_BANK_CREATE'
exporting
bank_ctry = 'IN'
BANK_KEY = '786114'
bank_address = BANK_ADDRESS
* BANK_METHOD =
* BANK_FORMATTING =
* BANK_ADDRESS1 =
* I_XUPDATE = 'X'
IMPORTING
RETURN = RETURN
* BANKCOUNTRY =
* BANKKEY =
.
call function 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =
.
IF RETURN IS INITIAL.
MESSAGE 'The bank is created successfully' TYPE 'S'.
ELSE.
WRITE : / RETURN-MESSAGE.
ENDIF.
No comments:
Post a Comment