SAP Function BAPI_CUSTOMER_GETDETAIL1 - Only to ONLINE Store!!! BAPI Read Cstmr to BO Cstmr (KNA1) - with CAM

Parameter Reference Type Length Default Optional Text
CUSTOMERNO BAPIKNA103-CUSTOMER C 10 Customer to Be Required
PI_DISTR_CHAN BAPIKNA102-DISTR_CHAN C 2 X Distribution Channel
PI_DIVISION BAPIKNA102-DIVISION C 2 X Division
PI_SALESORG BAPIKNA102-SALESORG C 4 Sales Organization

Parameter Reference Type Length Text
PE_ADDRESSTYPE_NO BAPIKNA109 u 31 Address Number/Address Category
PE_COMPANYDATA BAPIKNA106 u 841 Customer Company Data
PE_CONSUMER_FLAG BAPIKNA107-CONSUMER_FLAG C 1 Customer is Consumer
PE_OPT_COMPANYDATA BAPIKNA105 u 50 Optional Customer Company Data
PE_OPT_PERSONALDATA BAPIKNA105 u 50 Optional Personal Data for Customer
PE_OPT_PERSONALDATA_NEW BAPIKNA105 u 50 Optional Personal Data for Customer
PE_PERSONALDATA BAPIKNA101_1 u 803 Customer Personal Data
PE_PERSONALDATA_NEW BAPIKNA101_1 u 803 Customer Personal Data
RETURN BAPIRETURN1 u 470 Return Value

Functionality
This method of the "Customer" business object is used to determineeither the personal or optional personal data of a customer that existsin SAP R/3 (PE_PERSONALDATA_NEW / PE_OPT_PERSONALDATA_NEW) or thecompany or optional company data. (PE_COMPANYDATA / PE_OPT_COMPANYDATA)
A couple of these structures, depending on whether the customer is aperson or a company, are always returned filled. For the characteristicperson or company, see import parameter Customerno.
Note: From now on, the structures PE_PERSONALDATA andPE_OPT_PERSONALDATA are, for compatibility reasons, always filled withdata. See the description for more information. As of SAP R/3 4.6A,these new structures should be used: PE_PERSONALDATA_NEW /PE_OPT_PERSONALDATA_NEW or PE_COMPANYDATA / PE_OPT_COMPANYDATA.
Description:
All the customer address data is determined from Central AddressManagement (CAM).
The address type and address number (see export parameterPE_SDDRESS_NO_TYPE) that are pointers in the CAM table, are madeavailable from this BAPI to the program to be called.
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 anddivision 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 theirmeanings can be found in this documentation.

Description
In this export parameter, the address numbers and the address categoryfor an address are returned to the calling program using the followinglogic:

  • Case 1, company address:

  • Address category is 1 and the address number (ADRNR) links to theaddress in Central Address Management (CAM).
    • Case 2, contact person's business address:

    • Address category is 3 and the address number (ADRNR) and the personnumber (PRSNR) link to the addresses in CAM (ADRC und ADRP) and to theassignment person/address (ADCP).
      • Case 3, contact person's private address:

      • Address category is 2 and the address number (ADRNP_2) and the personnumber (PRSNR) link to the addresses in CAM (ADRC und ADRP)

        Description
        Export parameter for a customer's company data.
        Note: (i) If this export parameter is filled with data, do not fill thecorresponding export parameter for person address data.

        Description
        If this indicator is set, the customer is a consumer in the R/3 Systemcontext, that is, it has the following characteristics:

        • A consumer has a reduced master record.

        • You create a consumer with the help of a reference customer.

        • In practice, the organizational data of the reference customer is read
        • alongside.
          • You define the reference customer itself under Master Data ->
          • Customer -> Business Partner -> Consumer -> Reference Customer.

            Description
            Export parameter for a customer's optional company data.
            Note: (i) If this export parameter is filled with data, do not fill thecorresponding export parameter for person address data. .

            Description
            Note: As of Release 4.6A this export parameter should no longer beused. Use instead the corresponding new export parameter:PE_OPT_PERSONALDATA_NEW or PE_OPT_COMPANYDATA.
            Description:
            Export parameter optional personal data of customer in the R/3 systemfrom whom data was required.

            Description
            Export parameter for a customer's optional person data.
            Note: (i) If this export parameter is filled with data, do not fill thecorresponding export parameter for company address data.

            Description
            Note: As of SAP R/3 4.6A, these export parameters should not be used.Instead, use the relevant new parameters: PE_PERSONALDATA_NEW orPE_COMPANYDATA.
            Description:
            Export parameter for personal data of a customer in SAP R/3, from whichdata is required. The customer address data is determined from CentralAddress Management (CAM). Note: This BAPI sets the field"ONLY_CHANGE_COMADDRESS" to 'X' if the BAPI determines a companyaddress for the customer number that is transferred, and if a'different' (*) contact person address exists at the same time.
            (*) If there is a different address: The personal or contact personaddress is different to the company address in one of the followingfields: Language, Street, House number, Region, Town, Postal code,Country, Telephone number, Fax number, E-mail. Note: For customer datacreated before SAP R/3 4.5A, a company address is different from thecontact partner address if the first name, surname, or title of thecontact partner of the 2nd entry differs from the 1st entry of the namefield or title of the company address.

            Description
            Export parameter for a customer's person data.
            Note: (i) If this export parameter is filled with data, thecorresponding export parameter for the company address data is notfilled. (ii) The field "ONLY_CHANGE_COMADDRESS" is always returnedempty in this structure.

            Description
            Return value of errors

            Value range

            • TYPE = "E"

            • CODE = "F2878" Internal error: Authorization problem, data cannot bedisplayed
              • TYPE = "E"

              • CODE = "F2888" Internal error: Customer does not exist in the masterrecord
                Note
                For errors that can occur in CAM, see the documentation on:
                • ADDR_GET_COMPLETE

                • ADDR_CONVERT_COMPLETE_3_TO_2

                • ADDR_PERSONAL_GET_COMPLETE
                • Description
                  Import parameter customer number. For this customer number, personaldata is required if the customer is a person, and company data isrequired if the customer is a company.
                  Note: (i) A customer is understood to be a person if he is either aconsumer in the R/3 sense (see import parameter PI_CONSUMEREN of BAPI: BAPI_CUSTOMER_CREATEFROMDATA1),
                  or if his contact person address or private address is the same as hiscompany address.
                  For more information on 'different' company addresses, see thedocumentation of BAPI BAPI_CUSTOMER_CHANGEFROMDATA1 .
                  A customer is understood to be a company if he is not a person in thesense described above.
                  (ii) As a consequence, only ever one structure PE_PERSONALDATA_NEW /PE_OPT_PERSONALDATA_NEW or PE_COMPANYDATA / PE_OPT_COMPANYDATA will bereturned filled.
                  For compatibility reasons, the structure PE_PERSONALDATA orPE_OPT_PERSONALDATA is always filled. You can tell whether a'different' company address exists in the same way as before, from thefield "PE_PERSONALDATA-ONLY_CHANGE_COMADDRESS".

                  Description
                  Optional import parameter distribution channel of customer

                  Description
                  Optional import parameter division of customer

                  Description
                  Import parameter sales organization of customer