Fonction SAP BAPI_CUSTOMER_SEARCH - Only for ONLINE Store!!! Customer: Find Customer Number

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
PI_ADDRESS BAPIKNA101 u 477 Customer Address Data
PI_SALESORG BAPIKNA102-SALESORG C 4 Sales Organization
PI_SEARCH_FLAG BAPIKNA104-SEARCHFLAG C 1 Search Criterion

Paramètre Reférence Type Long. Description
PE_CUSTOMER BAPIKNA103-CUSTOMER C 10 Customer Number
RETURN BAPIRETURN u 452 Return Value

Paramètre Reférence Long. Facultatif Description
MULTIPLE BAPIKNA103 10 X Duplicates

Functionality
Note:
In SAP R/3 4.5A, this BAPI is being replaced by BAPI"BAPI_CUSTOMER_SEARCH1", which takes full account of the integration ofcustomer address data in Central Address Management (CAM). As this BAPI("BAPI_CUSTOMER_SEARCH") is being replaced, it will only be supportedfor 2 releases after SAP R/3 4.5A.
This method of the "Customer" business object can be used to determinethe customer number for an e-mail address (from Central AddressManagement) for a customer in SAP R/3 on the basis of the address data,and personal number if this exists. That is, both the e-mail address ofthe "company address" and the personal e-mail address of the contactperson can be used as search criteria.
To be able to access existing e-mail addresses (e-mail addresses thatwere created before SAP R/3 4.5A and the internet address of theinternet coordinator) in the customer tables, a sales organization mustbe transferred to the BAPI.

Notes
If e-mail addresses already exist (any e-mail addresses created beforeSAP R/3 4.5A), the functions of this BAPI can only be used withoutadversely affecting performance if an index is created on the databasefield "INTAD" (internet address) of the customer master company codetable "KNB1".

  • To include customer number and e-mail address in an IAC:

  • A maximum of one e-mail address must exist for a customer number atcompany code level.
    A maximum of one customer must exist for an e-mail address (also atcompany code level). Reasons for this:
    A single customer should not have two customer nubers.
    It must be possible to identify a customer by the e-mail address alone.
    • Consequences:

    • A customer has forgotten his/her password for his/her customer number,and therefore tries to create a new customer record. This is notpermitted (if the e-mail address is the same). In addition to ensuringuniqueness of customer number for e-mail address, there are securityreasons for this. If a customer forgets a password, he/she can only logon to the system as follows:
      He/she must ring up the merchant, who provides a new initial password,which can be used with the "old" customer number or e-mail address tolog on to the system.
      The customer has both company and private addresses, but the samee-mail address, which he/she wants to use for purchasing. This is onlyallowed if the customer has different e-mail addresses.
      Company employees have a joint e-mail address. This case is permittedif a joint password is also used.
      • Error messages about customer duplicates

      • In SAP R/3, several customers can exist for one e-mail address. Thesecustomers are referred to as 'duplicates' below. If the BAPI findsduplicates, these are entered in transfer table "MULTIPLE". Inaddition, the BAPI issues a message of type "E" (error).
        Messages are returned in parameter RETURN. The return values and theirmeanings can be found in this parameter documentation.

        Description
        Export parameter customer number. Number of the customer determined forthe e-mail address.

        Description
        Return value for error

        Value range

        • TYPE = "E" CODE = "F2820" A customer already exists for e-mail address
        • .
          • TYPE = "E" CODE = "F2821" Several customers exist for e-mail address &.

          • TYPE = "E" CODE = "F2823" & You already have a customer number.

          • TYPE = "E" CODE = "F2824" No customer exists for e-mail address &.

          • TYPE = "E" CODE = "F2883" Internal error: Sales organization does not
          • exist in the master record.

            Description
            Import parameter for address data that can contain, among other things,the e-mail address of the customers. This is used as a search argumentfor the BAPI. It is used to find the customer number belonging to thee-mail address.

            Description
            Import parameter sales organization of the customer.

            Description
            Note: For an e-mail address, it is possible that no customer exists,one customer exists (unique), or several customers exist.

            Value range

            • 0: Test for 'Customer still unknown'

            • Successful: No message, no PE_CUSTOMER, no MULTIPE entry
              Error: Message, no PE_CUSTOMER and 0..n MULTIPLE entries
              • 1: Test for 'e-mail is unique'.

              • Successful: No message, PE_CUSTOMER is delivered, 1
                entry in MULTIPLE
                Error: Message, no PE_CUSTOMER, 0 or 2..n MULTIPLE entries

                Description
                This table contains the customer numbers of the customers that werefound for the e-mail address entered.