Skip to Content
0
Jun 08, 2022 at 10:28 AM

Unable to update company code against Business partner

449 Views Last edit Jun 24, 2022 at 12:51 PM 2 rev

Hi ,

i have used bapi BAPI_BUPA_CREATE_FROM_DATA to create Business partner

and method cmd_ei_api=>maintain_bapi

to update company code against business partner but getting error

customer doesnot exist.

can someone suggest where have made the mistake?

   call function 'BAPI_BUPA_CREATE_FROM_DATA'
exporting
partnercategory = ls_upload-partner_category "'1'
partnergroup = ls_upload-role_grouping "'ZSPE'
centraldata = wa_central_data
centraldataperson = ls_CENTRALDATAPERSON
centraldataorganization = ls_centraldataorganization
addressdata = wa_addressdata
importing
businesspartner = lv_bupartner
tables
telefondata = li_bapiadtel
* faxdata = i_bapiadfax
e_maildata = li_bapiadsmtp
return = li_return_bp.
call function 'BAPI_TRANSACTION_COMMIT'
exporting

wait = 'X'.

append initial line to ls_cmds_main-customers assigning field-symbol(<ls_customers>).


<ls_customers>-header-object_instance-kunnr = lv_bupartner.
<ls_customers>-header-object_task = 'U'.


append initial line to <ls_customers>-company_data-company assigning field-symbol(<ls_company>).
<ls_company>-task = 'U'.

<ls_company>-data_key-bukrs = ls_upload-company_code.

 <ls_company>-datax-zwels     = abap_true.<br>    <ls_company>-data-akont      = ls_upload-reconcilliation_account.<br><br><br>    cmd_ei_api=>maintain_bapi(<br>      exporting<br>        iv_test_run          = abap_true                    " Checkbox Test Run ('X' = Yes)<br>        iv_collect_messages  = abap_true                  " Checkbox Collect Messages ('X' = Yes)<br>        is_master_data       = ls_cmds_main               " Total Customer Data<br>      importing<br>        es_message_defective = data(ls_message_defect)    " Error Indicator and System Messages for Incorrect Data<br>    ).<br><br>    call function 'BAPI_TRANSACTION_COMMIT'<br>      exporting<br>        wait = 'X'.<br>