Fonction SAP BAPI_CUSTOMER_CREATEFROMDATA - Only for ONLINE Store!!! Customer: Create Customer

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
PI_ADDRESS BAPIKNA101 u 477 Customer Address Data
PI_COPYREFERENCE BAPIKNA102 u 18 Reference Data

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

Functionality
Note: In SAP R/3 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 SAP R/3 4.5A.
This method of the "Customer" business object can be used to create acustomer in SAP R/3 on the basis of entered address data (importparameter 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 iscreated 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 betransferred to the BAPI via structure PI_ADDRESS via the currencyfields (in R/3 or in ISO format).
If both currency fields are transferred to the BAPI, the currency fieldin R/3 format has priority.
If both currency fields are blank when transferred to the BAPI, thecurrency field is determined using table T005, on the basis of thecountry 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 anumber 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 andsupplying plant.
    • Data that is not adopted from the reference customer:

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

      Example

      Notes
      (i) Data needed for creating a customer in SAP R/3:

      • 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 either R/3 format or ISOstandard. If both fields (R/3 format and ISO standard) are selected andtransferred to the BAPI, the country key in R/3 format has priorityover the ISO standard format.
        Note: The 'old' ISO standard fields for the country (numerical andalphanumerical formats) are not supported and have been shut down.
        Lastly, a language key in R/3 format or ISO 639 standard must also betransferred to the BAPI.
        If it is transferred to the BAPI in both formats (R/3 and ISOstandard), the country 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 his onlypurpose is to provide data for customers that are created via the BAPI.
          In other words, the reference customer is not an operative customer inthe business 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 istransferred to the BAPI.
          If company-code-independent data is transferred to the BAPI, thereference 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 fieldconsistency (see MCOD1-3 and table TFMC) is carried out on the basis ofan entry in R/3 table T100C (transaction OBA5 work area F2, for MsgNr145 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 andtheir 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 view 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 theselected sales organization).
          Authorization profiles that cover the above objects are SAP_ALL,V_Verkauf and V_Versand.

          Further information

          Description
          Export parameter customer number. Number of newly created customer inthe R/3 system.
          Note: Field CUSTOMERNO always contains exactly the same value asPE_CUSTOMER. Field CUSTOMERNO stands for a method view of the functionmodule, the field PE_CUSTOMER stands for a procedural view of thefunction module.

          Description
          Export parameter customer number. Number of newly created customer inthe R/3 system.
          Note: Field CUSTOMER always contains exactly the same value asPE_CUSTOMERNO. Field CUSTOMERNO stands for a method view of thefunction module, the field PE_CUSTOMER stands for a procedural view ofthe function module.

          Description
          Return value for errors

          Value range
          TYPE = "E" CODE For the error codes, see documentation for exceptionfield NOT_VALID from function module POSTAL_CODE_CHECK
          TYPE = "E" CODE For the error codes, see documentation for functionmodule TELNUMBER_STRUCT_TO_NORMAL
          TYPE = "E" CODE = "F2013" Country & is not defined
          TYPE = "E" CODE = "F2016" Language & is not defined
          TYPE = "E" CODE = "F2031" Region & for country & is not defined
          TYPE = "E" CODE = "F2034" Currency code & is not defined
          TYPE = "E" CODE = "F2145" Customers found with same address; check
          TYPE = "E" CODE = "F2200" You have not entered a postal code or postalcode for the post box
          TYPE = "E" CODE = "F2827" Make an entry in all fields where required
          TYPE = "E" CODE = "F2830" e-mail address & is not valid
          TYPE = "E" CODE = "F2835" Date of birth is not valid
          TYPE = "E" CODE = "F2838" Form of address text not valid
          TYPE = "E" CODE = "F2880" Internal error: & & & -> Inform SAP hotline
          TYPE = "E" CODE = "F2882" Interner error: External number assingmentfor reference customer/customer
          TYPE = "E" CODE = "F2883" Internal error: & is not an element of & =>Inform Hotline
          TYPE = "E" CODE = "F2885" Internal error: Field "Language" of structure is blank
          TYPE = "E" CODE = "F2890" Internal error: The reference customer is notknown in table &
          TYPE = "E" CODE = "F2892" Internal error: The sales organization is notknown in table &
          TYPE = "E" CODE = "F2893" Internal error: Reference customer for salesorganization data is not known in table &

          Description
          Import parameter for address data of a customer
          Note: Field "ONLY_CHANGE_COMADDRESS" is irrelevant for this BAPI.

          Description
          Copy references for creation of a customer in the R/3 system.
          Copy reference fields are:
          Reference customer and organizational data.