Hello,
if you want to change businesspartner or customer than the short demo program could be useful.
Martin
DATA: i_data TYPE cvis_ei_extern_t,
e_return TYPE bapiretm,
wa_data LIKE LINE OF i_data,
wa_partn TYPE bus_ei_extern,
wa_partn_hdr TYPE bus_ei_header,
wa_partn_hdr_object_instance TYPE bus_ei_instance,
wa_partn_ctr_data TYPE bus_ei_central_data,
wa_partn_ctr_data_common TYPE bus_ei_bupa_central,
wa_partn_ctr_data_role TYPE bus_ei_bupa_roles,
wa_partn_ctr_data_bankdetail TYPE bus_ei_bankdetail,
wa_partn_ctr_data_ident_number TYPE bus_ei_identification,
wa_partn_ctr_data_taxnumber TYPE bus_ei_taxnumber,
wa_partn_ctr_data_addr TYPE bus_ei_address,
wa_partn_ctr_data_addr_addres TYPE bus_ei_bupa_address,
wa_partn_ctr_data_taxclass TYPE bus_ei_tax_classification,
wa_company TYPE cmds_ei_company,
v_partner.
v_partner = 'X'. "change businesspartner
*v_partner = ' '. "change customer
* change businesspartner
IF v_partner EQ 'X'.
wa_partn_hdr-object_instance-bpartner = '5500199886'.
wa_partn_hdr-object_instance-bpartnerguid = '0050568177331EE38083CFA6ADE9DB46'.
wa_partn_hdr-object_task = 'M'.
MOVE-CORRESPONDING wa_partn_hdr TO wa_partn-header.
wa_partn_ctr_data-common-data-bp_control-grouping = 'TR05'. "grouping in your system
wa_partn_ctr_data-common-data-bp_control-category = '1'. " person
* add role
* wa_partn_ctr_data_role-task = 'I'.
* wa_partn_ctr_data_role-data_key = 'FLCU00'. "Debitor
* APPEND wa_partn_ctr_data_role TO wa_partn_ctr_data-role-roles.
wa_partn_ctr_data-common-data-bp_person-firstname = 'Tom'.
wa_partn_ctr_data-common-data-bp_person-lastname = 'SAP'.
wa_partn_ctr_data-common-datax-bp_person-firstname = 'X'.
wa_partn_ctr_data-common-datax-bp_person-lastname = 'X'.
wa_partn_ctr_data_addr_addres-task = 'M'.
wa_partn_ctr_data_addr_addres-data-postal-data-country = 'AT'.
wa_partn_ctr_data_addr_addres-data-postal-data-city = 'Vienna'.
wa_partn_ctr_data_addr_addres-data-postal-data-postl_cod1 = '1030'.
wa_partn_ctr_data_addr_addres-data-postal-data-street = 'Teststr. 47/11'.
wa_partn_ctr_data_addr_addres-data-postal-datax-country = 'X'.
wa_partn_ctr_data_addr_addres-data-postal-datax-city = 'X'.
wa_partn_ctr_data_addr_addres-data-postal-datax-postl_cod1 = 'X'.
wa_partn_ctr_data_addr_addres-data-postal-datax-street = 'X'.
APPEND wa_partn_ctr_data_addr_addres TO wa_partn_ctr_data-address-addresses.
MOVE-CORRESPONDING wa_partn_ctr_data_addr TO wa_partn_ctr_data.
MOVE-CORRESPONDING wa_partn_ctr_data TO wa_partn-central_data.
MOVE-CORRESPONDING wa_partn TO wa_data-partner.
APPEND wa_data TO i_data.
ELSE.
* change customer
wa_partn_hdr-object_instance-bpartner = '5500199886'.
wa_partn_hdr-object_instance-bpartnerguid = '0050568177331EE38083CFA6ADE9DB46'.
wa_partn_hdr-object_task = 'M'.
MOVE-CORRESPONDING wa_partn_hdr TO wa_partn-header.
MOVE-CORRESPONDING wa_partn TO wa_data-partner.
wa_data-customer-header-object_instance-kunnr = '5500199886'.
wa_data-customer-header-object_task = 'U'.
wa_company-task = 'U'.
wa_company-data_key = '0010'. " company code
wa_company-data-zterm = '0002'. " terms of payment
wa_company-datax-zterm = 'X'.
APPEND wa_company TO wa_data-customer-company_data-company.
APPEND wa_data TO i_data.
ENDIF.
CALL FUNCTION 'CVI_EI_INBOUND_MAIN'
EXPORTING
i_data = i_data
IMPORTING
e_return = e_return.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
* IMPORTING
* RETURN =
.