Ansicht
Dokumentation

BAPI_CUSTOMER_CREATEFROMDATA1 - Only for ONLINE Store!!! BAPI Create Cstmr for BO Cstmr (KNA1) - with CAM

BAPI_CUSTOMER_CREATEFROMDATA1 - Only for ONLINE Store!!! BAPI Create Cstmr for BO Cstmr (KNA1) - with CAM

General Material Data   BAL Application Log Documentation  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

This method of the "Customer" business object is used to create a customer in SAP R/3 on the basis of entered personal data (import parameter PI_PERSONALDATA) or entered company data (import parameter PI_COMPANYDATA).
Only one structure (personal data or company data) can be transferred to the BAPI with entries.

(i) One person to be created as a customer:
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).
If the "Allow Consumer Maintenance" indicator is set, then a consumer is created in SAP R/3. (See also: import parameter PI_CONSUMEREN).
(a) No consumers to be created:
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 entered is adopted from a reference customer and from the sales area data (sales organization, distribution channel and division - import parameter PI_COPYREFERENCE).
If parameter PI_CREDIT_CONTROL_FLAG is set, then the credit control data of the reference customer is adopted.
Exceptions to the fields mentioned above can only exist for the fields of import structure "optional personal data" (PI_OPT_PERSONALDATA). If values exist 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 customer:
Contact person data, partner function data, and bank details.

Example

Notes

(1) Data needed to create a customer in SAP R/3:

  • - 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 R/3 format or ISO standard.
    If the country key is transferred to the BAPI in both formats (R/3 format 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.
    Finally, a currency key in R/3 format or ISO standard format must 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 sole purpose is to provide data for customers that are created via the BAPI.
    That is, the reference customer is not an operative customer in the business 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.

(2) The permitted countries are those in R/3 table T005. The permitted regions 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.

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


(b) A consumer is to be created:
The entered personal data has a direct influence on the master data and
contact person data. One contact person record is created for the customer in question.
All the master data that is not entered is adopted from the reference customer of the consumer.
Exceptions to the master data fields can only exist for the first two customer master fields of the import structure "optional personal data" (PI_OPT_PERSONALDATA). If values exist for the fields in this structure, these values take priority over any equivalent values for the reference customer.

Notes
The necessary data for creating a consumer in SAP R/3 is, except for the reference customer, the same as the data described above needed for the person customer.


(ii) A company customer is to be created:
With the entered personal address data, only one type 1 address (company address) is created. Otherwise, the same mechanisms for a person customer (not a consumer) apply to a company customer.


For all three cases: person customer, consumer or company customer, the following applies:
(1) For the 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 used for the "Customer" business object, and therefore possibly used in F4 help for the form of address field.
(2) 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 in R/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.
(3) Messages are returned in parameter RETURN. The return values and their meanings can be found in this parameter documentation.
(4) The customer is updated synchronously, but no Commit is executed.
(5) The new customer is returned in field CUSTOMERNO (key field of "Customer" business object (KNA1)).
(6) All address data come from the central function module of the CAM (see ADDR_CHECK).
(7) 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 for company 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.

Example

Notes

FURTHER_SOURCES_OF_INF&





Parameters

CUSTOMERNO
PI_COMPANYDATA
PI_CONSUMEREN
PI_COPYREFERENCE
PI_CREDIT_CONTROL_FLAG
PI_OPT_COMPANYDATA
PI_OPT_PERSONALDATA
PI_PERSONALDATA
RETURN

Exceptions

Function Group

V02D

BAL_S_LOG - Application Log: Log header data   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.

Length: 9129 Date: 20240523 Time: 113741     sap01-206 ( 138 ms )