cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_CUSTOMER_CREATEFROMDATA1

Former Member
0 Kudos

Hi,

I have a requirement to create customer through Bapi.

But in the BAPI_CUSTOMER_CREATEFROMDATA1, Reference Customer is a mandatory field.

Please let me know, if any other FM is there to create customer without giving Reference customer.

Thanks,

Bindu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Bindu,

SD_CUSTOMER_MAINTAIN_ALL is used in standard during the maintenance of a consumer using the standard customer master data transaction XD01 & XD02.

It is not intended to be used out of the transaction and in no case it should be used out of its original context. Due to the specificity of the function module, out of the original context we may face limitations and data inconsistencies.

For the maintenance of customers, there is NO BAPI and NO direct function module.

There are some functions modules like the one above where the name is looking nice. But these should not be used.

BAPI_CUSTOMER_CREATEFROMDATA1 is part of them. This one uses SD_CUSTOMER_MAINTAIN_ALL, so the above remark is still valid. Moreover, this BAPI is to be used only from process SAP Product Catalog. Out of it and due to its limitation, a lot of troubles are expected. See [note 390045|https://service.sap.com/sap/support/notes/390045]

Sorry.

  • Below ECC 2005 (6.00), the only solution was batch input and DEBMAS idocs. See [note 384462|https://service.sap.com/sap/support/notes/384462]

  • Starting with ECC 2005 (6.00) and above: a synchronisation tool has been introduce. See class CMD_EI_API and VMD_EI_API

Hope this helps.

BR

Alain

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can use function module : SD_CUSTOMER_MAINTAIN_ALL

in this u can extend sales data and company code for that customer code also.

Please find ttached example.

CALL FUNCTION 'SD_CUSTOMER_MAINTAIN_ALL' EXPORTING i_kna1 = w_kna1 i_knb1 = w_knb1 i_knvv = w_knvv * I_BAPIADDR1 = * I_BAPIADDR2 = i_maintain_address_by_kna1 = ' ' i_knb1_reference = ' ' i_force_external_number_range = ' ' i_no_bank_master_update = ' ' i_customer_is_consumer = ' ' i_raise_no_bte = ' ' pi_postflag = ' ' pi_cam_changed = ' ' * PI_ADD_ON_DATA = i_from_customermaster = ' ' IMPORTING e_kunnr = imp_kunnr o_kna1 = imp_kna1 * E_SD_CUST_1321_DONE = TABLES t_xknas = i_xknas t_xknbk = i_xknbk t_xknb5 = i_xknb5 t_xknex = i_xknex t_xknva = i_xknva t_xknvd = i_xknvd t_xknvi = i_xknvi t_xknvk = i_xknvk t_xknvl = i_xknvl t_xknvp = i_xknvp t_xknza = i_xknza t_yknas = i_yknas t_yknbk = i_yknbk t_yknb5 = i_yknb5 t_yknex = i_yknex t_yknva = i_yknva t_yknvd = i_yknvd t_yknvi = i_yknvi t_yknvk = i_yknvk t_yknvl = i_yknvl t_yknvp = i_yknvp t_yknza = i_yknza t_upd_txt = i_upd_txt EXCEPTIONS client_error = 1 kna1_incomplete = 2 knb1_incomplete = 3 knb5_incomplete = 4 knvv_incomplete = 5 kunnr_not_unique = 6 sales_area_not_unique = 7 sales_area_not_valid = 8 insert_update_conflict = 9 number_assignment_error = 10 number_not_in_range = 11 number_range_not_extern = 12 number_range_not_intern = 13 account_group_not_valid = 14 parnr_invalid = 15 bank_address_invalid = 16 tax_data_not_valid = 17 no_authority = 18 company_code_not_unique = 19 dunning_data_not_valid = 20 knb1_reference_invalid = 21 cam_error = 22 OTHERS = 23 . IF sy-subrc 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. Can anyone tell me what is the purpose for Xtables and ytables (eg . t_xknas,yknas)