cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to update company code against Business partner

vikash_pathak
Participant
0 Kudos
698

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>
abo
Active Contributor
0 Kudos

The way the code is formatted makes it almost impossible to piece it together so the first order of business should be to reformat it properly, using the CODE tag on the whole source. Next, check the returns from the BP creation.

vikash_pathak
Participant
0 Kudos

Hi c5e08e0478aa4727abc4482f5be390b2

i checked return from BP creation BAPI and its returning no error , instead getting error in cmd_ei_api=>maintain_bapi method which is calling just after BP creation Bapi has error that customer has not been created .

Thanks

Accepted Solutions (0)

Answers (0)