Ansicht
Dokumentation

/XLSO/CREATE_CUSTOMER - Create Customer Master

/XLSO/CREATE_CUSTOMER - Create Customer Master

General Data in Customer Master   ABAP Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

This function module (FM) is used to create a customer in SAP ERP on the basis of the 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.

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 ERP.

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 the 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 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.

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.
  • Contact person data, partner function data, and bank details.

Data needed to create a customer in SAP ERP:

  • Fields of import parameter PI_PERSONALDATA: Last name, language, location, country, and currency.
Depending on the country, further data may be necessary. 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: Last names are always entered in the search term A field in the customer master.
  • Fields of optional import parameter 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)
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.

The permitted countries are those in the R/3 table T005. The permitted regions in these countries are those in the R/3 table T005S. The correct length and necessity of a postal code depends on the country in question.

An email 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 email addresses of companies or personal addresses are relevant for future operative business. The email address of the reference customer is only adopted if CAM is not active.

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.

Note: 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.

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.

There are some optional parameters such as Department, Function, pref_comm, industry, and plant. This information is required in case we have a B2B relationship for the customer and the department, and function is saved in customer master. Industry and plant information for the user is also persisted in customer master.

For all three cases, person customer, consumer, or company customer, the following applies:

  • 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.
  • Messages are returned in parameter RETURN. The return values and their meanings can be found in this parameter documentation.
  • The customer is updated synchronously, but no 'Commit' is executed.
  • The new customer is returned in the field CUSTOMERNO (key field of 'Customer' business object (KNA1)).

Example

Notes

Importing parameters:

  • IS_PERSONALDATA
  • IS_OPT_PERSONALDATA
  • IS_COMPANYDATA
  • IS_OPT_COMPANYDATA
  • IV_CONSUMEREN
  • IS_COPYREFERENCE
  • IV_CREDIT_CONTROL_FLAG
  • IV_COMP_DEPT
  • IV_COMP_FUNCTION
  • IV_PREF_COMMUNICATION
  • IV_INDUSTRY_DETAIL
  • IV_PLANT
  • IV_COMPANY_CODE

Further information





Parameters

ES_RETURN_STATUS
EV_CUSTOMERNO
IS_COMPANYDATA
IS_COPYREFERENCE
IS_OPT_COMPANYDATA
IS_OPT_PERSONALDATA
IS_PERSONALDATA
IT_CONTACT_PERSON
IV_BUSINESS_PARTNER
IV_COMPANY_CODE
IV_COMP_DEPT
IV_COMP_FUNCTION
IV_CONSUMEREN
IV_CREDIT_CONTROL_FLAG
IV_INDUSTRY_DETAIL
IV_PLANT
IV_PREF_COMMUNICATION
IV_SHIPPING_CONDITION
IV_SOURCE_CLIENT
IV_SOURCE_SYSID

Exceptions

Function Group

O/SAPLUSER_REGISTRATION

General Data in Customer Master   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Length: 10317 Date: 20240426 Time: 133413     sap01-206 ( 142 ms )