Contact Us 1-800-596-4880

SAP Custom BAPI Setup Guide

The following provides guidance on how to use the custom BAPI code (for example, ZBAPI_CUSTOMER_V3) for your SAP instance.

You must complete the following instructions before deploying the Customer profile sync from SAP use case.

BAPI custom objects

You must create the following ABAP objects in order to use this custom BAPI, which are described below.

Data Elements

  • Z_MASTER_ID

Structures

  • ZSTR_PERSON

  • ZSTR_ORGANIZATION

  • ZSTR_GROUP

  • ZES_CUSTOMER

  • ZES_CONTROLDATA

Table Types

  • ZTY_CUSTOMER

Transparent Tables

  • ZTT_CUSTOMER

Function Groups

  • ZFG_CUSTOMER

  • ZFG_CUSTOMER2

  • ZBAPI_CUSTOMER

  • ZBAPI_CUSTOMER_CREATE

  • ZBAPI_CUSTOMER_CUSTOM_FIELDS

  • ZBAPI_CUSTOMER_UPDATE

  • ZBAPI_QUERY

  • ZBAPI_ADDR_QUERY

  • ZBAPI_QUERY_SAP

  • ZBAPI_CUST_QUERY

  • ZBAPI_CUSTOMER_CD

Creating data elements

Object How to create

Z_MASTER_ID

SAP data element definition for Z_MASTER_ID

Creating structures

Object How to create

ZSTR_PERSON

SAP structure definition for ZSTR_PERSON

ZSTR_ORGANIZATION

SAP structure definition for ZSTR_ORGANIZATION

ZSTR_GROUP

SAP structure definition for ZSTR_GROUP

ZES_CUSTOMER

SAP structure definition for ZES_CUSTOMER

ZES_CONTROLDATA

SAP structure definition for ZES_CONTROLDATA

Creating table types

Object How to create

ZTY_CUSTOMER

SAP table type definition for ZTY_CUSTOMER

Creating transparent tables

Object How to create

ZTT_CUSTOMER

SAP transparent table definition for ZTT_CUSTOMER


Creating function groups and function modules

ZBAPI Customer modules

  1. Create the function group "ZFG_CUSTOMER_V3".

  2. Create the function module "ZBAPI_CUSTOMER_V3", using "Remote-enable module" as processing type:

    SAP Create Function Module for ZBAPI_CUSTOMER_V3
  3. Complete the import parameters with the following:

    SAP import parameters for ZBAPI_CUSTOMER_V3
  4. Complete the export parameters with the following:

    SAP export parameters for ZBAPI_CUSTOMER_V3
  5. Copy and paste the code from "ZBAPI_CUSTOMER_V3.txt".

  6. Create the function module "ZBAPI_CUSTOMER_CREATE_V3":

    SAP Create Function Module for ZBAPI_CUSTOMER_CREATE_V3
  7. Complete the import parameters with the following:

    SAP import parameters for ZBAPI_CUSTOMER_CREATE_V3
  8. Complete the export parameters with the following:

    SAP export parameters for ZBAPI_CUSTOMER_CREATE_V3
  9. Copy and paste the code from "ZBAPI_CUSTOMER_CREATE_V3.txt".

  10. Create the function module "ZBAPI_CUSTOMER_CUSTOM_FLDS_V3":

    SAP Create Function Module for ZBAPI_CUSTOMER_CUSTOM_FLDS_V3
  11. Complete the import parameters with the following:

    SAP import parameters for ZBAPI_CUSTOMER_CUSTOM_FLDS_V3
  12. Copy and paste the code from "ZBAPI_CUSTOMER_CUSTOM_FIELDS_V3.txt".

  13. Create the function module "ZBAPI_CUSTOMER_UPDATE_V3":

    SAP Create Function Module for ZBAPI_CUSTOMER_UPDATE_V3
  14. Complete the import parameters with the following:

    SAP import parameters for ZBAPI_CUSTOMER_UPDATE_V3
  15. Complete the export parameters with the following:

    SAP export parameters for ZBAPI_CUSTOMER_UPDATE_V3
  16. Copy and paste the code from "ZBAPI_CUSTOMER_UPDATE_V3.txt".

  17. Create the function module "ZBAPI_QUERY_V3", using "Remote-enable module" as processing type:

    SAP Create Function Module for ZBAPI_QUERY_V3
  18. Complete the import parameters with the following:

    SAP import parameters for ZBAPI_QUERY_V3
  19. Complete the export parameters with the following:

    SAP export parameters for ZBAPI_QUERY_V3
  20. Copy and paste the code from "ZBAPI_QUERY_V3.txt".

  21. Create the function module "ZBAPI_CONTROL_DATA_V3":

    SAP Create Function Module for ZBAPI_CONTROL_DATA_V3
  22. Complete the import parameters with the following:

    SAP import parameters for ZBAPI_CONTROL_DATA_V3
  23. Complete the export parameters with the following:

    SAP export parameters for ZBAPI_CONTROL_DATA_V3
  24. Copy the source code from "ZBAPI_CONTROL_DATA_V3.txt".

  25. Activate the entire function group by right-clicking on it in the tree and then selecting "Activate":

    SAP command to activate the ZFG_CUSTOMER_V3 function group
  26. Create the function group "ZFG_CUSTOMER2".

  27. Create the function module "ZBAPI_ADDR_QUERY", using "Remote-enable module" as processing type:

    SAP Create Function Module for ZBAPI_ADDR_QUERY
  28. Complete the import parameters with the following:

    SAP import parameters for ZBAPI_ADDR_QUERY
  29. Complete the export parameters with the following:

    SAP export parameters for ZBAPI_ADDR_QUERY
  30. Copy and paste the code from "ZBAPI_ADDR_QUERY.txt".

  31. Create the function module "ZBAPI_CONTROL_DATA" using the import parameters as follows:

    SAP import parameters for ZBAPI_CONTROL_DATA
  32. Use the export parameters as in the following:

    SAP export parameters for ZBAPI_CONTROL_DATA
  33. Copy the source code from "ZBAPI_CONTROL_DATA.txt".

  34. Activate the entire function group by right-clicking on it in the tree and selecting 'Activate':

    SAP command to activate the ZFG_CUSTOMER2 function group
  35. Complete the following:

  36. Create a customer group ZSME (Logistics - General->Business Partner->Customer->Control->Define and Assign Customer Number Ranges)

  37. Create a partner group ZSME (Cross-Application Components->SAP Business Partner->Business Partner->Basic Settings->Number Ranges and Settings) from the transaction SPRO

  38. Synchronize them from the same transaction (Cross-Application Components->Master Data Synchronization->Customer/Vendor Integration->Business Partner Settings->Settings for Customer Integration->Assign Keys->Define Number Assignment for Direction BP to Customer)

    SAP customer and partner group configuration for ZSME

More ZBAPI modules

The following describes how to sufficiently set up your SAP instance in order to use the following custom BAPIs:

  • ZBAPI_ADDR_QUERY

  • ZBAPI_QUERY_SAP

  • ZBAPI_CUST_QUERY

  • ZBAPI_CUSTOMER_CD

To create ABAP custom objects, groups, and modules:

  1. Create the same dictionary objects created for the BAPI ZBAPI_CUSTOMER using the following structure/table type:

    SAP dictionary object definition for additional custom BAPIs
    SAP table type definition for additional custom BAPIs
  2. Create the function group ZFG_CUSTOMER2.

  3. Create the function module ZBAPI_ADDR_QUERY using 'Remote-enable module' as the processing type:

    SAP Create Function Module for ZBAPI_ADDR_QUERY
  4. Complete the import parameters with the following:

    SAP import parameters for ZBAPI_ADDR_QUERY
  5. Complete the export parameters with the following:

    SAP export parameters for ZBAPI_ADDR_QUERY
  6. Copy and paste the code from 'ZBAPI_ADDR_QUERY.txt'.

  7. Create the function module ZBAPI_ADDR_SAP using 'Remote-enable module' as the processing type:

    SAP Create Function Module for ZBAPI_ADDR_SAP
  8. Complete the import parameters with the following:

    SAP import parameters for ZBAPI_ADDR_SAP
  9. Complete the export parameters with the following:

    SAP export parameters for ZBAPI_ADDR_SAP
  10. Copy and paste the code from 'ZBAPI_QUERY_SAP.txt'.

  11. Create the function module ZBAPI_CUST_QUERY using 'Remote-enable module' as the processing type:

    SAP Create Function Module for ZBAPI_CUST_QUERY
  12. Complete the import parameters with the following:

    SAP import parameters for ZBAPI_CUST_QUERY
  13. Complete the export parameters with the following:

    SAP export parameters for ZBAPI_CUST_QUERY
  14. Copy and paste the code from 'ZBAPI_CUST_QUERY.txt'.

  15. Create the function module ZBAPI_CUSTOMER_CD using 'Remote-enable module' as the processing type:

    SAP Create Function Module for ZBAPI_CUSTOMER_CD
  16. Complete the import parameters with the following:

    SAP import parameters for ZBAPI_CUSTOMER_CD
  17. Complete the export parameters with the following:

    SAP export parameters for ZBAPI_CUSTOMER_CD
  18. Copy and paste the code from 'ZBAPI_CUSTOMER_CD.txt'.

  19. Activate the entire function group by right-clicking on it in the tree and selecting 'Activate':

    SAP command to activate custom BAPI function modules