
DATA: ls_cmds_ei_main TYPE cmds_ei_main, " Total Customer Data
ls_cmds_ei_extern TYPE cmds_ei_extern, " Complex External Interface for Customers
es_error TYPE cvis_message,
lv_phone1 TYPE LINE OF cvis_ei_phone_t,
lv_contact TYPE LINE OF cmds_ei_contacts_t.
*existing customer is getting updated, hence object_task – ‘U’
ls_cmds_ei_extern-header-object_instance-kunnr = 'DAKK103'.” pass the existing customer number
ls_cmds_ei_extern-header-object_task = 'U'."I for insert U for update
*fil lastname, title,
lv_contact-task = 'I'.
lv_contact-address_type_3-task = 'I'.
lv_contact-address_type_3-postal-data-title_p = '0002'.
lv_contact-address_type_3-postal-datax-title_p = 'X'.
lv_contact-address_type_3-postal-data-lastname = 'lastname'.
lv_contact-address_type_3-postal-datax-lastname = 'X'.
*fill telephone, tel_extens, mob number, fax number
lv_phone1-contact-task = 'I'.
lv_phone1-contact-data-telephone = '004823283'.
lv_phone1-contact-datax-telephone = 'X'.
lv_phone1-contact-data-R_3_USER = '1'.
lv_phone1-contact-datax-R_3_USER = 'X'.
INSERT lv_phone1 INTO TABLE lv_contact-address_type_3-communication-phone-phone.
lv_phone1-contact-task = 'I'.
lv_phone1-contact-data-telephone = '9710893900'.
lv_phone1-contact-datax-telephone = 'X'.
lv_phone1-contact-data-R_3_USER = '2'.
lv_phone1-contact-datax-R_3_USER = 'X'.
INSERT lv_phone1 INTO TABLE lv_contact-address_type_3-communication-phone-phone.
*set the central posting block
ls_cmds_ei_extern-central_data-central-data-sperr = ' '.
ls_cmds_ei_extern-central_data-central-datax-sperr = 'X'.
*set the central order block
ls_cmds_ei_extern-central_data-central-data-aufsd = '01'.
ls_cmds_ei_extern-central_data-central-datax-aufsd = 'X'.
*set the central sales block
ls_cmds_ei_extern-central_data-central-data-cassd = 'X'.
ls_cmds_ei_extern-central_data-central-datax-cassd = 'X'.
*set the central deletion flag
ls_cmds_ei_extern-central_data-central-data-loevm = 'X'.
ls_cmds_ei_extern-central_data-central-datax-loevm = 'X'.
lv_contact-task = 'D'.
lv_contact-data_key-parnr = '1101'.
INSERT lv_contact INTO TABLE ls_cmds_ei_extern-central_data-contact-contacts.
APPEND ls_cmds_ei_extern TO ls_cmds_ei_main-customers.
CLEAR ls_cmds_ei_extern.
IF ls_cmds_ei_main IS NOT INITIAL.
CALL METHOD cmd_ei_api=>initialize.
CALL METHOD cmd_ei_api=>lock( iv_kunnr = ls_cmds_ei_extern-header-object_instance-kunnr ).
CALL METHOD cmd_ei_api=>maintain
EXPORTING
is_master_data = ls_cmds_ei_main " Total Customer Data
IMPORTING
es_error = es_error. " Error Indicator and System Messages
CALL METHOD cmd_ei_api=>unlock( iv_kunnr = ls_cmds_ei_extern-header-object_instance-kunnr ).
ENDIF.
'BAPI_TRANSACTION_COMMIT'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
3 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |