0% found this document useful (0 votes)
258 views2 pages

Execute FI01'. Provide Bank Country Key (IN) - Bank Key (121516) - Enter. Provide The Bank Name (HDFC Bank) - Save

The document describes steps to create bank details and cost center groups manually in SAP and using BAPIs. It provides examples of calling BAPI functions to create a bank with details like name, region, and street using BAPI_BANK_CREATE. It also provides an example to create a cost center group named SPCG3 with value ranges from 1000-3000 and 5000-7000 using BAPI_COSTCENTERGROUP_CREATE. Finally, it distinguishes between instance independent BAPIs that don't require input and instance dependent BAPIs that do require input parameters.

Uploaded by

Trainning ABAP
Copyright
© © All Rights Reserved
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)
258 views2 pages

Execute FI01'. Provide Bank Country Key (IN) - Bank Key (121516) - Enter. Provide The Bank Name (HDFC Bank) - Save

The document describes steps to create bank details and cost center groups manually in SAP and using BAPIs. It provides examples of calling BAPI functions to create a bank with details like name, region, and street using BAPI_BANK_CREATE. It also provides an example to create a cost center group named SPCG3 with value ranges from 1000-3000 and 5000-7000 using BAPI_COSTCENTERGROUP_CREATE. Finally, it distinguishes between instance independent BAPIs that don't require input and instance dependent BAPIs that do require input parameters.

Uploaded by

Trainning ABAP
Copyright
© © All Rights Reserved
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/ 2

Steps to create the bank details manually: -

 Execute ‘FI01’.
 Provide bank country key (IN).
 Bank key (121516). Enter.
 Provide the bank name (HDFC Bank).
 Save.

Object:Create the bank details by using BAPI.

REPORT ZSPRAO_O_BAPI1.

PARAMETER P_BCTRY LIKE BAPI1011_KEY-BANK_CTRY.


PARAMETER P_BKEY LIKE BAPI1011_KEY-BANK_KEY.

DATA WA_ADD LIKE BAPI1011_ADDRESS.


DATA WA_RETURN LIKE BAPIRET2.

WA_ADD-BANK_NAME = 'ICICI BANK'.


WA_ADD-REGION = '01'.
WA_ADD-STREET = 'SRNAGAR'.
WA_ADD-CITY = 'HYD'.

CALL FUNCTION 'BAPI_BANK_CREATE'


EXPORTING
BANK_CTRY = P_BCTRY
BANK_KEY = P_BKEY
BANK_ADDRESS = WA_ADD
IMPORTING
RETURN = WA_RETURN .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

IF WA_RETURN IS INITIAL.
WRITE 'BANK CREATED SUCCESSFULLY'.
ELSE.
WRITE WA_RETURN-MESSAGE.
ENDIF.

Steps to create cost center group manually: -


 Execute ‘KSH1’.
 Provide the Controlling area (6000). Enter.
 Provide the cost center group name (SPCG1). Enter.
 Provide short description.
 Click on cost center in the application tool bar.
 Provide the from to (1000 – 3000), (5000 – 7000) cost centers. Enter.
 Click on save.
Object: Create the cost center group by using BAPI.

REPORT ZSPRAO_O_BAPI2.

PARAMETER P_CAREA LIKE BAPICO_GROUP-CO_AREA.

DATA WA_RETURN LIKE BAPIRET2.

DATA : IT_HNODE LIKE TABLE OF BAPISET_HIER,


WA_HNODE LIKE LINE OF IT_HNODE.

DATA : IT_HVAL LIKE TABLE OF BAPI1112_VALUES,


WA_HVAL LIKE LINE OF IT_HVAL.

WA_HNODE-GROUPNAME = 'SPCG3'.
WA_HNODE-HIERLEVEL = '0'.
WA_HNODE-VALCOUNT = '2'.
WA_HNODE-DESCRIPT = 'SPRAO Cost center group'.
APPEND WA_HNODE TO IT_HNODE.

WA_HVAL-VALFROM = '0000002000'.
WA_HVAL-VALTO = '0000003000'.
APPEND WA_HVAL TO IT_HVAL.

WA_HVAL-VALFROM = '0000004000'.
WA_HVAL-VALTO = '0000005000'.
APPEND WA_HVAL TO IT_HVAL.

CALL FUNCTION 'BAPI_COSTCENTERGROUP_CREATE'


EXPORTING
CONTROLLINGAREAIMP = P_CAREA
IMPORTING
RETURN = WA_RETURN
TABLES
HIERARCHYNODES = IT_HNODE
HIERARCHYVALUES = IT_HVAL .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.


IF WA_RETURN IS INITIAL.
WRITE 'Cost center group is created'.
ELSE.
WRITE WA_RETURN-MESSAGE.
ENDIF.
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.

You might also like