SAP CRM Business Partner Banking Detail

Sap AP Tcodes- SAP CRM Business Partner Banking Detail 2

SAP CRM Business Partner Banking Detail is a main data for SAP CRM BP. It helps organize and collect SAP CRM BP Banking data and accelerate Payment process.

In this post, the SAP CRM Data Model for Business Partner Bank Master Data will be explained and a sample of extraction of SAP CRM BP Bank Data with ABAP Code in SAP CRM.

Also found the list of SAP CRM BP BAPI for Banking (read, update and delete).

SAP CRM BP Bank Tables

The main SAP CRM Data Model Tables for Business Partner Banking details are:
BUT0BK, BUT0BANK and BNKA.

Check alsoSAP CRM Business Partner: Tables and BAPI

The list of fields of SAP CRM BP Bank Tables are:

  • BUT0BK BP: Bank Details : Business Partner Bank Data & Details
    • PARTNER Business Partner ID
    • BKVID Bank details ID
    • BANKS Bank country key
    • BANKL Bank Keys
    • BANKN Bank account number
    • BKONT Bank Control Key
    • BKREF Reference specifications for bank details
    • KOINH Account Holder Name
    • BKEXT Bank details ID in external system
    • XEZER Indicator: Collection Authorization
    • ACCNAME Name of Bank Account
    • MOVE_BKVID ID of Target Details for Change of Bank Details (BP)
    • BK_VALID_FROM Validity Start of Business Partner Bank Details
    • BK_VALID_TO Validity End of Business Partner Bank Details
    • BK_MOVE_DATE of Change to Bank Details (BP)
    • IBAN (International Bank Account Number)
    • BANK_GUID Bank GUID
    • ACCOUNT_ID Bank Account Number (New)
    • CHECK_DIGIT Bank Account Check Digit
    • ACCOUNT_TYPE Bank Account Type
  • BUT0BANK: Business Partner: Bank Data
    • PARTNER Business Partner ID
    • BANKL Bank Keys
    • BANKS Bank country key
    • MIN_RESERV Minimum Reserve Requirement for Bank
  • BNKA : Bank master record
    • BANKS Bank country key
    • BANKL Bank Keys
    • ERDAT Date on which the record was created
    • ERNAM Name of person who created the object
    • BANKA Name of bank
    • PROVZ Region (State, Province, County)
    • STRAS House number and street
    • ORT01 City
    • SWIFT Code for International Payments
    • BGRUP Bank group (bank network)
    • XPGRO Post Office Bank Current Account
    • LOEVM Deletion Indicator
    • BNKLZ Bank number
    • PSKTO Post office bank current account number
    • ADRNR Address number
    • BRNCH Bank Branch
    • CHKME Check digit calculation method
    • VERS Format of File with Bank Data

SAP CRM Business Partner Banking BAPI

The most used SAP CRM BAPI for Business Partner Banking are:

  • BAPI_BUPA_BANKDETAILS_GET SAP BP, BAPI: Determine All Bank Details
  • BAPI_BUPA_BANKDETAIL_ADD SAP BP, BAPI: Add Bank Details
  • BAPI_BUPA_BANKDETAIL_CHANGE SAP BP, BAPI: Change Bank Details
  • BAPI_BUPA_BANKDETAIL_GETDETAIL SAP BP, BAPI: Read Bank Details
  • BAPI_BUPA_BANKDETAIL_NUMBERS SAP BP, BAPI: Read Bank Details Numbers
  • BAPI_BUPA_BANKDETAIL_REMOVE SAP BP, BAPI: Delete Bank Details

SAP CRM Business Partner Banking ABAP Sample

You will find bellowing a sample ABAP Code to retrieve Banking details for a SAP CRM Business Partner.

First, the Payer (SAP CRM BP Relationship CRMH03) will be retrieved for the BP.
Then the banking details will be exported.

************************************************************************************************
* Get SAP CRM Business Partner Banking Details ( Payer ) 
************************************************************************************************
  DATA: lt_bankdetails   TYPE TABLE OF bapibus1006_bankdetails,
        lt_relationships  TYPE TABLE OF bapibus1006_relations,
        lt_return  TYPE BAPIRETTAB,
        lv_bp TYPE bu_partner.


  " Get SAP CRM BP Relationship PAYER
  CALL FUNCTION 'BUPA_RELATIONSHIPS_GET'
    EXPORTING
      iv_partner               = iv_account
      iv_relationship_category = 'CRMH03'
    TABLES
      et_relationships         = lt_relationships.
    
    " Get only the First Payer 
    READ TABLE lt_relationships INTO ls_relationships INDEX 1.
    IF sy-subrc  = 0.
      lv_bp = ls_relationships-partner2. "Payer
    ELSE.
      lv_bp = iv_account. "Account
    ENDIF.
  
  " Get SAP CRM Business Partner Banking Details
   CALL FUNCTION 'BAPI_BUPA_BANKDETAILS_GET'
    EXPORTING
      businesspartner = lv_bp
      valid_date      = sy-datlo
    TABLES
      bankdetails     = lt_bankdetails
      return          = lt_return.