Sapass

 Simplify SAP R/3 development with Excel VBA/VB RFC  
Home> Bapi>Customer



Index

Customer

Customer


The business object Customer is a business partner, with whom
you have a relationship involving the transfer of goods and/or services.

Structure

A customer can deal with several sales areas. The customers of a sales
area can be assigned to a customer hierarchy. Within a customer hierarchy, it is possible to determine pricing agreements for the
highest hierarchy level (e.g. head offices) that can also be valid for the subordinate hierarchy levels (e.g. branches).


For a customer designated as a ship-to party, the different unloading points and receiving points can be determined.


Integration

A customer can have the following partner functions:



  • sold-to party

  • bill-to party

  • payer

  • ship-to party

  • 11-Dec-2005


    Methods

    Available Methods


    • AddHierarchyNodes : Create Nodes in SD Customer Hierarchy [ BAPI_CUSTOMER_HIERARCHIE_INS ]
    • ChangeFromData : Change [ BAPI_CUSTOMER_CHANGEFROMDATA ] (Obsolete in 40C)
    • ChangeFromData1 : Change [ BAPI_CUSTOMER_CHANGEFROMDATA1 ]
    • ChangeHierarchyNodes : Change Nodes in SD Customer Hierarchy [ BAPI_CUSTOMER_HIERARCHIE_UPD ]
    • ChangePassword : Change Password [ BAPI_CUSTOMER_CHANGEPASSWORD ]
    • CheckExistence : Check Existence [ BAPI_CUSTOMER_CHECKEXISTENCE ] (Obsolete in 46A)
    • CheckPassword : Check Password [ BAPI_CUSTOMER_CHECKPASSWORD ] (Obsolete in 46A)
    • CheckPassword1 : Check Password [ BAPI_CUSTOMER_CHECKPASSWORD1 ]
    • Create : Create Online [ BAPI_CUSTOMER_CREATE ]
    • CreateFromData : Create [ BAPI_CUSTOMER_CREATEFROMDATA ] (Obsolete in 40C)
    • CreateFromData1 : Create [ BAPI_CUSTOMER_CREATEFROMDATA1 ]
    • CreatePassword : Create Password [ BAPI_CUSTOMER_CREATEPWREG ]
    • Delete : Delete Customer Master Online [ BAPI_CUSTOMER_DELETE ]
    • DeletePassword : Delete Password [ BAPI_CUSTOMER_DELETEPWREG ]
    • Display : Display Online [ BAPI_CUSTOMER_DISPLAY ]
    • Edit : Change Online [ BAPI_CUSTOMER_EDIT ]
    • ExistenceCheck : Check Existence [ BAPI_CUSTOMER_EXISTENCECHECK ]
    • Find : Customer Matchcode [ BAPI_CUSTOMER_FIND ]
    • GetContactList : List of Customer Contact Persons [ BAPI_CUSTOMER_GETCONTACTLIST ]
    • GetDetail : Read [ BAPI_CUSTOMER_GETDETAIL ] (Obsolete in 40C)
    • GetDetail1 : Read [ BAPI_CUSTOMER_GETDETAIL1 ]
    • GetDetail2 : Customer Details [ BAPI_CUSTOMER_GETDETAIL2 ]
    • GetHierarchyChildren : Sub-Nodes of SD Customer Hierarchy [ BAPI_CUSTOMER_GET_CHILDREN ]
    • GetHierarchyRoot : Read Root Node from SD Customer Hierarchy [ BAPI_CUSTOMER_GET_ROOT ]
    • GetHierarchyRootList : Read All Root Nodes from SD Customer Hierarchy [ BAPI_CUSTOMER_GET_ROOT_LIST ]
    • GetInternalNumber : Provides Internal Customer Numbers [ BAPI_CUSTOMER_GETINTNUMBER ]
    • GetList : List with Addresses [ BAPI_CUSTOMER_GETLIST ]
    • GetPassword : Read Password [ BAPI_CUSTOMER_GETPWREG ]
    • GetSalesAreas : Read Customer Sales Areas [ BAPI_CUSTOMER_GETSALESAREAS ]
    • InitPassword : Initialize Password [ BAPI_CUSTOMER_INITPASSWORD ]
    • RemoveHierarchyNodes : Delete Nodes in SD Customer Hierarchy [ BAPI_CUSTOMER_HIERARCHIE_DEL ]
    • Search : Find [ BAPI_CUSTOMER_SEARCH ] (Obsolete in 40C)
    • Search1 : Find [ BAPI_CUSTOMER_SEARCH1 ]

    11-Dec-2005


    AddHierarchyNodes

    AddHierarchyNodes


    The function module inserts assignments into the customer hierarchy. These are imported with table NODE_LIST. The result log is in the table Return. The assignment can only be carried out for existing customers.


    Further Information

    This function implicitly saves the assignment. The working memory is deleted each time the function module is called up as new.


    11-Dec-2005


    ChangeFromData

    ChangeFromData


    Note: In Release 4.5A, this BAPI is replaced by BAPI "BAPI_CUSTOMER_CHANGEFROMDATA1", which takes full acount of integrationof customer data in Central Address Management (CAM). As this BAPI("BAPI_CUSTOMER_CHANGEFROMDATA") is being replaced, it will only be supported for 2 releases after Release 4.5A.


    This method of the "Customer" business object can be used to change thepersonal data of an existing customer in the R/3 system, with thecustomer being entered as a consumer (company address = contact partner address = personal address). This has the following results:

    If only a company address exists, this BAPI can be used to changed thecompany address accordingly and creates an identical personal and contact partner address.
    If only a company address and contact person address, and no personaladdress exists for this customer, this BAPI can only be used to change the customer if a company address is transferred to the BAPI
    ("ONLY_CHANGE_COMADDRESS" = 'X').
    The same applies in the following case:
    If the personal address is different to the company address, this BAPIcan only be used to change the customer if a company address is transferred to the BAPI ("ONLY_CHANGE_COMADDRESS" = 'X').

    A different address is understood to be the following: The personal orcontact person address is different to the company address in one ormore of the following fields: Language, Street, House Number, Region,Town, Postal code, Country, Telephone number, Fax number, E-mail.

    Note: For customer data created before Release 4.5A, a company addressis different from the contact partner address if the first name,surname, or title of the contact partner of the 2nd entry differs fromthe 1st entry of the name field or title of the company address.


    Note: The address data needed is the same as that needed for the method for creating a customer (see BAPI_CUSTOMER_CREATEFROMDATA).
    The authorization requirements for using this BAPI are the same as those for BAPI BAPI_CUSTOMER_CREATEFROMDATA
    , whereby here, authorization is needed for the change activity.
    The sales organization is a required field.
    If the country changes, the Distribution channel and Division fieldsmust be transferred so that the BAPI can determine the related currency (T005).

    If a currency field (in R/3 or ISO format) is transferred to the BAPIvia structure PI_ADDRESS, this currency field takes priority over thecurrency field from table T005. If both currency fields are transferredto the BAPI from the PI_ADDRESS structure, the currency field in R/3 format has priority.

    The number of the existing customer in the R/3 system that is to be changed must be transferred.
    Note: All transferred values (including blank values) are adopted as they are in the database.

    Notes

    Messages are returned in paramter RETURN. The return values and their meanings can be found in the parameter documentation.



    11-Dec-2005


    ChangeFromData1

    ChangeFromData1


    This method of the "Customer" business object can be used to change thepersonal or company data of a customer that exists in the R/3 system.
    Only one filled structure (personal OR company data) can be passed on to the BAPI.

    (i) One person should be changed as a customer:
    In this case, the customer is entered as a person (company address =
    address of contact person = personal address). The customer can then bea consumer (see import parameter PI_CONSUMEREN for the BAPIs: and BAPI_CUSTOMER_CREATEFROMDATA1 ).
    (a) The customer is not a consumer:
    If "only" a company address exists, this BAPI is used to change the
    company address accordingly, and create identical personal and contact person addresses.
    If a personal address exists that is different (*) to the companyaddress, then this is regarded as an error. In this case, the BAPI should receive the company address as well (see case (ii) below).

    If only a company address exists with a contact person address andwithout a personal address, this BAPI can only be used to change the customer if a company address is also transferred to the BAPI("ONLY_CHANGE_COMADDRESS" = 'X').
    A different address is understood to be the following:

    The personal or contact person address is different to the companyaddress in one or more of the following fields: Language, Street, Housenumber, Region, Town, Postal code, Country, Telephone number, Fax number, E-mail.
    Note: for customer data created before Release 4.5A, a company address
    is different from the contact partner address if the first name,surname, or title of the contact partner of the 2nd entry differs fromthe 1st entry of the name field or title of the company address.

    (b) The customer is not a consumer:
    If only a company address exists in this case, then this is recognized as an error.

    Otherwise, the same functions apply as for case (i) (a) above.

    (ii) A company should be changed as a customer:
    In this case, only the corresponding address data (PI_COMPANYDATA) is changed in the BAPI.
    Otherwise, the same change mechanisms are valid for changing the company customers as for the personal customers.

    In all three cases (personal customer, consumer, or company customer) the following is valid:
    All customer address data is determined from Central Address Management (CAM).
    The personal/comp. data needed is the same as that needed for the method for creating a customer (siehe
    BAPI_CUSTOMER_CREATEFROMDATA1
    ).
    The authorization requirements for using this BAPI are the same as those for BAPI BAPI_CUSTOMER_CREATEFROMDATA1 , whereby here, the authorization is needed for the change activity.
    The sales organization is a required field.
    The number of the R/3 customer to be changed must be transferred to the BAPI.

    Only fields (personal/company and optional personal/company data) flagged with X (see import structure PI_PERSONALDATAX are transferred to the database.

    Notes

    Messages are returned in parameter RETURN. The return values and their meaning can be found in the parameter documentation.



    11-Dec-2005


    ChangeHierarchyNodes

    ChangeHierarchyNodes


    Change and save assignments for the SD hierarchy.

  • NodeListBefore, list of assignments to be changed
  • NodeListAfter, list of changed assignments
  • Further Information

    This function implicitly saves the assignment. The working memory is deleted each time the function module is called up as new.


    11-Dec-2005


    ChangePassword

    ChangePassword


    You can use this function module to change a customer password.

    The password is encrypted and stored in central table BAPIUSW01.

    Example

    call function 'BAPI_CUSTOMER_CHANGEPASSWORD'

    exporting

    object_id = customerid


    password = oldpass

    new_password = newpass

    verify_password = veripass

    importing

    return = rcode.

    Notes

    The precondition for calling this function module is a check of the


    customer number in the customer master record.

    This function module cannot be called if the customer number does not

    exist in the master record.


    11-Dec-2005


    CheckExistence

    CheckExistence


    OBSOLETE! DO NOT USE!

    The CheckExistence method in the Customer business object is obsolete.Intead you should use the ExistenceCheck. The detailed data about thecustomer that was returned to the CheckExistence method is now available in the GetDetail2 method.



    11-Dec-2005


    CheckPassword

    CheckPassword


    OBSOLETE! DO NOT USE!

    The CheckPassword method in the Customer business object is obsoleteand you should now use the CheckPassword1 method. The detailed dataabout the customer that used to be returend to the CheckPassword method is now available in the GetDetail2 method.


    You can use this function module to check a customer's password.

    The password is stored as a key in the central BAPIUSW01 table.

    Example

    call function 'BAPI_CUSTOMER_CHECKPASSWORD'

    exporting

    object_id = customerid


    password = pass

    importing

    return = rcode.

    Notes

    Before you can call up the function module, you must check the customer number in the customer master record.

    You should not call up the function module if the customer number is not in the master record.


    11-Dec-2005


    CheckPassword1

    CheckPassword1


    Use this method to check a customer's password.

    Notes

    The password is encrypted in the central table BAPIUSW01.


    11-Dec-2005


    Create

    Create


    With this method, you can create or extend a customer.


    11-Dec-2005


    CreateFromData

    CreateFromData


    Note: In Release 4.5A, this BAPI is replaced by BAPI "BAPI_CUSTOMER_CREATEFROMDATA1", which takes full account of theintegration of customer address data in Central Address Management(CAM). As this BAPI ("BAPI_CUSTOMER_CREATEFROMDATA") is being replaced, it will only be supported for 2 releases after Release 4.5A.

    This method of the "Customer" business object can be used to create acustomer in the R/3 system on the basis of entered address data (import parameter PI_ADDRESS).

    The entered address data has a direct influence on the master data,company code data and contact person data. One contact person record is created for the customer to be created.


    All the master data, company code data, sales area data, and tax codedata that is not entered is adopted from a reference customer, and fromsales area data (sales organization, distribution channel and division - import parameter PI_COPYREFERENCE).

    (Exception: Currency field of the sales area data. This field can be
    transferred to the BAPI via structure PI_ADDRESS via the currency fields (in R/3 or in ISO format).

    If both currency fields are transferred to the BAPI, the currency field in R/3 format has priority.

    If both currency fields are blank when transferred to the BAPI, the
    currency field is determined using table T005, on the basis of the country that is specified.

    Note:

  • Important data that is adopted from the reference customer:
  • Master data: Account group - this must be an account group linked to a number range that internally assigns a customer number.

    Company code data: Reconciliation account in Financial Accounting

    Sales data: Customer schema (for determining the calculation schema),term of payment key, shipping conditions, incoterms part 1, 2 and supplying plant.

  • Data that is not adopted from the reference customer:

  • Contact person data, partner function data, and bank details.

    Notes

    (i) Data needed for creating a customer in the R/3 system:

  • Fields of import parameter PI_ADDRESS:
  • Surname, language, location, and country

    Depending on the country, further data may be necessary.


    The country can be transferred to the BAPI in the following formats:R/3 format, ISO standard, ISO numerical standard, or ISO alphanumerical standard.

    The ISO numerical and alphanumerical formats are not supported.

    If the country key is transferred to the BAPI in both formats (R/3 and ISO standard), the country key in R/3 format has priority.

    A language key in R/3 format or ISO 639 standard must also be transferred to the BAPI.

    If both formats are transferred to the BAPI, the language key in R/3 format has priority.

  • Fields of import parameter PI_COPYREFERENCE:
  • R/3 reference customer, sales area data (sales organization, distribution channel and division)
    Note on reference customer:

    The reference customer should be created bearing in mind that its solepurpose is to provide data for customers that are created via the BAPI.
    That is, the reference customer is not an operative customer in thebusiness sense. As a result, the customer should be created with a
    separate account group with internal number assignment. In addition,the reference customer must exist in the organizational data that is transferred to the BAPI.
    If company-code-independent data is transferred to the BAPI, the reference customer must be created for a company code.


    (ii) The permitted countries are those in R/3 table T005. The permittedregions in these countries are those in R/3 table T005S. The length andnecessity of the postal code depend on the country in question.

    (iii) An e-mail address is only valid if it contains the character '@'.


    (iv) A check on duplicate records for the purpose of matchcode fields(see MCOD1-3 and table TFMC) is carried out on the basis of an entry inR/3 table T100C (transaction OBA5 work area F2, for MsgNr 145 entry I).
    If the three matchcode fields are the same, an error message is issued.


    (v) Messages are returned in parameter RETURN. The return values and their meanings can be found in this parameter documentation.

    (vi) The customer is updated synchronously.

    (vii) The new customer number is returned in the field CUSTOMERNO.

    Note: Field PE_CUSTOMER always contains exactly the same value asCUSTOMERNO. Field CUSTOMERNO stands for a method veiw of the functionmodule, field PE_CUSTOMER for a procedural view of the function module.

    (viii) Authorization requirements for using the BAPI:
    "Create" authorization is required for the following objects:

    F_KNA1_APP (customer: user authorization), F_KNA1_BUK (customer:authorization for company codes, for the selected company code) andV_KNA1_VKO (customer: authorization for sales organization, for the selected sales organization).
    Authorization profiles that cover the above objects are SAP_ALL, V_Verkauf and V_Versand.


    11-Dec-2005


    CreateFromData1

    CreateFromData1


    This method of the "Customer" business object is used to create acustomer in the R/3 system on the basis of entered personal data (import parameter PI_PERSONALDATA).
    With the entered personal data, addresses of type 1 (company address),type 2 (address for a person/private address of a contact person), and
    type 3 (contact partner address) are created simultaneously in Central Address Management (CAM).
    The entered personal data has a direct influence on the master data,company code data and contact person data. One contact partner record is created for the customer in question.

    All the master data, company code data, sales area data, tax code data,and reminder data that is not enetered is adopted from a referencecustomer and from the sales area data (sales organization, distribution channel and division - import parameter PI_COPYREFERENCE).

    Exceptions to these fields can only exist for the fields of importstructure "optional personal data" (PI_OPT_PERSONALDATA). If valuesexist for the fields in this structure, these values take priority over any equivalent values for the reference customer.
    Note:

    Important data that is adopted from the reference customer:
    Master data: Account group. This must be an account group linked to a number range that internally assigns a customer number.
    Company code data: Reconciliation account in Financial Accounting

    Sales data: Customer schema (for determining the calculation schema),term of payment key, shipping conditions, Incoterms part 1, 2 and supplying plant.
    Data that is not adopted from the reference custoemr:
    Contact person data, partner function data, and bank details.


    Example

    Notes

    (i) Data needed to create a customer in the R/3 system:

  • Fields of import parameter PI_PERSONALDATA
    Surname, language, location, country, currency.
    Depending on the country, further data may be necesary.
    The country can be transferred to the BAPI in the following formats:
    R/3 format, ISO standard, ISO numerical standard, ISO alphanumerical standard.
    The ISO numerical and alphanumerical formats are not supported.
    If the country key is transferred to the BAPI in both formats (R/3format and ISO standard), the country key in R/3 format has priority.

    A language key in R/3 format or ISO 639 standard must also be transferred to the BAPI.
    If both formats are transferred to the BAPI, the language key in R/3 format has priority.
    A currency key in R/3 format or ISO standard format must also be transferred to the BAPI.

    If both formats are transferred, the currency key in R/3 format has priority.
    Notes on names and search term field:
    Surnames are always entered in the Search term A field in the customer master.
  • Fields of optional import parameters PI_OPT_PERSONALDATA:
    None of these fields are mandatory for customer creation.

    The structure consists of the following fields:
    Customer master field: Transportation zone
    Company-code-relevant fields: Reconciliation account and term of payment
    Sales data fields: Shipping condition, supplying plant, partial delivery at item level and credit control area

  • Fields of import parameter PI_COPYREFERENCE:
    R/3 reference customer, sales area data (sales organization,distribution channel, division)
    Note on reference customer:
    The reference customer should be created bearing in mind that its solepurpose is to provide data for customers that are created via the BAPI.

    That is, the reference customer is not an opreative customer in thebusiness sense. As a result, the customer should be created with aseparate account group with internal number assignment. In addition,the reference customer must exist in the organizational data that is transferred to the BAPI.

    If company-code-independent data is transferred to the BAPI, the reference customer must be created for a company code.
  • (ii) The permitted countries are those in R/3 table T005. The permittedregions in these countries are those in R/3 table T005S. The correct
    length and necessity of a postal code depends on the country in question.

    (iii) An e-mail address is only valid if it contains the character '@'.
    Note: The e-mail address in the reference customer's correspondencedata is not adopted, as only e-mail addreses of companies or personal
    addresses are relevant for future operative business. The e-mailaddress of the reference customer is only adopted if CAM is not active.

    (iv) Re. fields for form of address and form of address key:
    Only the form of address in the personal data structure is used to update this field. The form of address key in the personal data
    structure is irrelevant for updating the data. This field is only usedfor the "Customer" business object, and therefore possibly used in F4 help for the form of address field.

    (v) A check on duplicate records for the purpose of matchcode fields(see MCOD1-3 and talbe TFMC) is carried out on the basis of an entry in
    R/3 table T100C (transaction OBA5 work area F2, for MsgNr 145 entry I)t.
    If the three matchcode fields are the same, an error message is issued.
    (vi) Messages are returned in parameter RETURN. The return values and their meanings can be found in this parameter documentation.

    (vii) The customer is updated synchronously, but no Commit is executed.
    (viii) The new customer is returned in field CUSTOMERNO (key field of "Customer" business object (KNA1)).
    (ix) Authorization requirements for using this BAPI:
    "Create" authorization must exist for the following objects: F_KNA1_APP
    (customer: user authorization), F_KNA1_BUK (customer: authorization forcompany codes, for the selected company code) and V_KNA1_VKO (customer:authorization for sales organization, for the selected sales organization).
    Authorization profiles that cover the following objects are SAP_ALL, V_Verkauf and V_Versand.


    FURTHER_SOURCES_OF_INF&


    11-Dec-2005


    CreatePassword

    CreatePassword


    In this function module, an entry for the customer is created in table

    BAPIUSW01.

    The system does not generate a password for the customer.

    The following are displayed as return codes:

    '00' = ok

    '11' = Entry in table BAPIUSW01 already exists


    Example

    call function 'BAPI_CUSTOMER_CREATEPWREG'

    exporting

    object_id = customerid

    importing

    return = rcode.

    Notes

    Before calling up the function module, check the customer number in the customer master record.


    If the customer number is not available in the master record, you can not call up the function module.

    Further Information

    FB 'BAPI_CUSTOMER_INITPASSWORD'


    11-Dec-2005


    Delete

    Delete


    Set the delete indicator for the customer to be transferred.


    11-Dec-2005


    DeletePassword

    DeletePassword


    This function module deletes the customer entry in table BAPIUSW01.

    The following return codes are displayed:

    '00' = ok

    '10' = Entry is not available in table BAPIUSW01

    Example

    call function 'BAPI_CUSTOMER_DELETEPWREG'


    exporting

    object_id = customerid

    importing

    return = rcode

    Notes

    Before calling up the function module, you must check the customer number in the customer master record.


    If the customer number does not exist in the master record, you cannot call up the function module.


    11-Dec-2005


    Display

    Display


    Displays the required customer.


    11-Dec-2005


    Edit

    Edit


    Opens the maintenance transaction for the required custome online.


    11-Dec-2005


    ExistenceCheck

    ExistenceCheck


    Use this method to check whether a customer is available.

    If you enter a company code, the system also checks whether the customer belongs to this company code.

    If you enter a sales area, the system also checks whether the customerhas been created for this sales area. The sales area must be entered in full.


    11-Dec-2005


    Find

    Find


    This method searches for all customers, that store a transferred content in a transferred table field.

    The search terms are transferred in structure SELOPT_TAB.

    The probable blocks or deletion flags will be marked for the customers found.


    The number of hits can be restricted by the parameter MAX_CNT. Value "0" means that there is no restriction on the search result.

    The standard search is for the exact field content (Field SELOPT_TAB-FIELDVALUE). If the parameter PL_HOLD is selected, the use
    of wild cards is allowed. "*" is for any character string and "+" for any character.

    The search terms are processed individually and not joined to othersearch terms, that is, only one field from the customer master table is examined at a time.

    The method is case sensitive with the exception of the match code fields that are maintained in the table TFMC.


    Example

    1. Customers should be found that have "23" in the field KNB1-PERNR(personnel number) for the company code 0001. All the customers thatare found should be displayed. The search should be carried out exactly, that is, without match codes.

    The required entries:

    Table SELOPT_TAB

    Field Content
    -----------------------------------------
    COMP_CODE 0001
    TABNAME KNB1
    FIELDNAME PERNR
    FIELDVALUE 23


    IMPORT-Parameter
    MAX_CNT 0
    PL_HOLD SPACE

    The transfer of import parameter MAX_CNT and PL_HOLD is optional, as the values named above correspond to the standard settings.

    1. Customers should be found that have that "SAP" at the beginning of
      field KNB5-KNRMA (account number of the dunning recipient). The searchshould be cross-company code and the number of hits should be restricted to 100. The use of wild cards is allowed.

    The required entries:

    Table SELOPT_TAB

    Field Content
    -----------------------------------------
    COMP_CODE SPACE

    TABNAME KNB5
    FIELDNAME KNRMA
    FIELDVALUE SAP*

    IMPORT parameter
    MAX_CNT 100
    PL_HOLD X

    The import parameters MAX_CNT and PL_HOLD have to be transferred, asthe values named above do not correspond to the standard settings.



    11-Dec-2005


    GetContactList

    GetContactList


    This method provides the address data of the contact persons from oneor more customers. The selection of the customers is carried out using a range.

    Notes

    Where maintained, different service addresses are taken into account.

    The address data of known contact persons is supplied by BAPI_BUSPARTNEREMPLOYE_GETLIST.



    11-Dec-2005


    GetDetail

    GetDetail


    Note: In Release 4.5A, this BAPI is replaced by BAPI "BAPI_CUSTOMER_GETDETAIL1", which takes full account of the integrationof customer data in Central Address Management (CAM). As this BAPI ("BAPI_CUSTOMER_GETDETAIL") is being replaced, it will only be
    supported for 2 releases after Release 4.5A.

    This method of the "Customer" business object is used to determine the address data of a customer that exists in the R/3 system.

    All customer address data is determined from Central Address Management (CAM).

    Note: If a customer number that has a company address, a differentcontact person address, and no personal address (or a personal addressthat differs from the company address) is transferred to this BAPI, the address data of the company address is returned.

    A different address is understood to be the following: The personal orcontact person address is different to the company address in one ormore of the following fields: Language, Street, House number, Region,Location, Postal code, Country, Telephone number, Fax number, E-mail.

    Note: For customer data created before Release 4.5A, a company addressis different from the contact partner address if the first name, surname, or form of address of the contact person of the 2nd entrydiffers from the first entry of the name field or form of address field of the company address.


    If a distribution channel and division are also transferred to theBAPI, the appropriate currenncy is determined from the customer master and provided for structure PE_ADDRESS.

    Authorization requirements for using this BAPI: "Display" authorization
    must exist for the following objects: F_KNA1_APP (customer: user authorization) and F_KNA1_BUK (customer: authorization for companycodes, for the selected company code).

    Authorization profiles that cover the above objects are SAP_ALL, V_Verkauf and V_Versand.


    Notes

    Messages are returned in parameter RETURN. The return values and their meaning can be found in this parameter documentation.


    11-Dec-2005


    GetDetail1

    GetDetail1


    This method of the "Customer" business object is used to determine thepersonal and optional personal data of a customer that exists in the R/3 system.
    All the customer address data is determined from Central Address Management (CAM).
    Note: If a customer number that has a company address, a different contact partner address and a different personal address (or no
    personal address) is transferred to this BAPI, the address data of the company address is returned.
    A different address is understood to be one of the following: Thepersonal or contact person address is different to the company addressin one or more of the following fields: Language, Street, House number,
    Region, Town, Postal code, Country, Telephone number, Fax number, E-mail.
    Note: For customer data created before Release 4.5A, a company addressis different to the contact person address if the surname, first name,or form of address of the contact person of the 2nd entry is different
    to the first entry of the name field or form of address of the company address.

    If a distribution channel and division are also transferred to theBAPI, the relevant currency is determined from the customer master andprovided for structure PE_PERSONALDATA and/or PE_OPT_PERSONALDATA.

    Authorization requirements for using this BAPI: "Display" authorizationmust exist for the following objects: F_KNA1_APP (customer: userauthorization), F_KNA1_BUK (customer: authorization for company codes,for the selected company code), and if a distribution channel and division are also transferred to the BAPI, V_KNA1_VKO (customer:
    authorization for sales organization).
    Authorization profiles that cover the above objects are SAP_ALL, V_Verkauf and V_Versand.

    Notes

    Messages are returned in parameter RETURN1. The return values and their meanings can be found in this documentation.



    11-Dec-2005


    GetDetail2

    GetDetail2


    Use this method to read detailed data for a customer.

    The following data is retreived:

  • Address data
  • General data
  • A table from bank data
  • Company code-specific data (if you enter a company code)

  • 11-Dec-2005


    GetHierarchyChildren

    GetHierarchyChildren


    Implementation of Instance Method: Customer.getChildren()

    The system determines the customers subordinated to the ValidOnbusiness transaction event, up to the level indicated, for the customerin the hierarchy of the specified hierarchy type. The system issues the direct predecessor to each node.


    11-Dec-2005


    GetHierarchyRoot

    GetHierarchyRoot


    Implementation of the Customer.getRoot() Instance Method

    The system determines the highest-level customer for the customer in the hierarchy of the specified type for a specific time.


    11-Dec-2005


    GetHierarchyRootList

    GetHierarchyRootList


    Implementation of the Customer.getAllRoots() Instance Method

    The highest-level customer is determined for a certain time and a specified hierarchy type.


    11-Dec-2005


    GetInternalNumber

    GetInternalNumber


    This function module is used for internal number assignment andsupplies the next free customer numbers to a selected account group.


    11-Dec-2005


    GetList

    GetList


    This method supplies address data and special customer data. The customers are selected via a range.


    11-Dec-2005


    GetPassword

    GetPassword


    You can read status information about a customer from table BAPIUSW01 with this function module.

    The following are displayed as return codes:

    '00' = ok

    '10' = Entry does not exist in table BAPIUSW01

    Example


    call function 'BAPI_CUSTOMER_GETPWREG'

    exporting

    object_id = customerid

    importing

    statusinfo = customerstatus

    return = rcode.

    Notes

    You must check the customer number in the customer master record before calling up the function module.


    If the customer number does not exist in the master record, you cannot call up the function module.


    11-Dec-2005


    GetSalesAreas

    GetSalesAreas


    This module reads all the sales areas for a customer.

    Notes

    Notifications are displayed by the parameter RETURN
    You can find the notification values and their meanings in thisparameter.


    11-Dec-2005


    InitPassword

    InitPassword


    The system determines an initial customer password.

    The password is encrypted and stored in central table BAPIUSW01.

    Returen codes are:

    '00' = ok

    '10' = Entry in table BAPIUSW01 does not exist

    Example

    call function 'BAPI_CUSTOMER_INITPASSWORD'


    exporting

    object_id = customerid

    importing

    password = initpassword

    return = rcode.

    Notes

    Check the customer number in the customer master record before calling


    the function module.

    The function module cannot be called if the customer number does not

    exist in the master record.


    11-Dec-2005


    RemoveHierarchyNodes

    RemoveHierarchyNodes


    Delete and save assignments of SD customer hierarchy.

  • NodeList, list of assignments for deletion
  • Return, processing log
  • Further Information

    This Function implicitly saves the assignment. The working memory is deleted each time the function module is called up as new.


    11-Dec-2005


    Search

    Search


    Note: In Release 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 supported for 2 releases after Release 4.5A.


    This method of the "Customer" business object can be used to determinethe customer number for an e-mail address (from Central Address Management) for a customer in the R/3 system on the basis of theaddress data, and personal number if this exists. That is, both the
    e-mail address of the "company address" and the personal e-mail address of the contact person can be used as a search criterion.
    To be able to access existing e-mail addresses (e-mail addresses thatwere created before Release 4.5A, internet address of the internet
    coordinator) in the customer tables, a sales organization must be transferred to the BAPI.

    Notes

    Note:
    If e-mail addresses already exist (i.e. e-mail addresses were createdbefore Release 4.5A), the functions of this BAPI can only be used
    without adversely affecting performance if an index is created on thedatabase field "INTAD" (internet address) of the customer master company code table "KNB1".
    (i) To include customer number and e-mail address in an IAC:
    A maximum of one e-mail address must exist for a customer number at
    company code level.
    A maximum of one customer must exist for an e-mail address (also at company code level).
    Reasons for this:
    (a) A single customer should not have two customer nubers.
    (b) It must be possible to identify a customer by the e-mail address alone.
    Consequences:

    (a) A customer has forgotten his/her password for his/her customernumber, and therefore tries to create a new customer record. This isnot permitted (if the e-mail address is the same). In addition toensuring uniqueness of customer number for e-mail address, there are
    security reasons for this. If a customer forgets a password, he/she can only log on to the system as follows:
    He/she must ring up the merchant, who provides a new initial password,which can be used in connection with the "old" customer number or e-mail address to log on to the system.

    (b) The customer has a company and private address, but the same e-mailaddress, which he/she wants to use for purchasing. This is only allowed if the customer has different e-mail addresses.
    (c) Company employees have a joint e-mail address. This case is permitted if a joint password is also used.

    In general, the following applies:
    In the R/3 system, several customers can exist for one e-mail address.These customers are referred to as 'duplicates' below.
    If the BAPI finds duplicates, these are entered in transfer table"MULTIPLE". In addition, the BAPI issues a message of type "E" (error).

    (ii) Messages are returned in parameter RETURN. The return values and their meanings can be found in this parameter documentation.


    11-Dec-2005


    Search1

    Search1


    This method of the "Customer" business object can be used to determinethe customer number for an e-mail address (from Central AddressManagement (CAM) ) of a customer in the SAP system on the basis of theaddress data, and personal number, if one exists. That is, both the
    e-mail address of the company and the personal e-mail address can be used as search criteria.
    To be able to access existing e-mail addresses (e-mail addresses created before Release 4.5A, internet address of the internetcoordinator) in the customer tables, a sales organization must be transferred to the BAPI.


    Notes

    In the case of existing e-mail addresses (that is, e-mail addressescreated before Release 4.5A), the functions of this BAPI can only beused without adversely affecting performace if an index is created ondatabase field "INTAD" (internet address) of customer company code table "KNB1".


  • To include a customer number and e-mail address in an Internet Application Component (IAC):
  • A maximum of one e-mail address must exist for a single customernumber. Several customers can exist for one e-mail address. Reasons for this are:

  • A customer who has forgotton his/her customer number or password should
    be able to create a new customer record with the same e-mail address as use the first customer record.
  • A customer has forgotton his/her password, and therefore creates a newcustomer record, using the same e-mail address as was used in the initial registration. If the customer logs on with his/her e-mail
    address and new password, these two pieces of information (e-mail and password) are used to identify the customer.
  • Alternatively, the customer can telephone the merchant, who provides anew initial password, which can be used in connection with the "old" customer number or e-mail address to log on to the system.


  • Error message for customer duplicates
  • In the SAP system, sevaral customers (duplicates) can exist for onee-mail address. If the BAPI finds duplicates, these are entered intransfer table "MULTIPLE". In addition, the BAPI issues a message of type "E" (error).


    Messages are returned in paramter RETURN1. The return values and their meanings can be found in this parameter documentation.


    11-Dec-2005