Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SD_CUSTOMER_MAINTAIN_ALL Raising KUNNR_NOT_UNIQUE

Hello,

I am trying to update a customer using this function but keep getting the exception KUNNR_NOT_UNIQUE. This is how I am calling the function, what am I missing? all fields being passed have data in them.

  ls_kna1-kunnr = p_inrec-kunnr.

   ls_kna1-name1 = p_inrec-name1.

   ls_kna1-name2 = p_inrec-name2.

   ls_kna1-stras = p_inrec-stras.

   ls_kna1-ort01 = p_inrec-ort01.

   ls_kna1-regio = p_inrec-regio.

   ls_kna1-pstlz = p_inrec-pstlz.

   ls_kna1-land1 = p_inrec-land1.

   ls_kna1-telf1 = p_inrec-telf1.

   ls_kna1-telfx = p_inrec-telfx.

   ls_kna1-ktokd = p_inrec-ktokd.

   ls_kna1-kdkg1 = p_inrec-kdkg1.

   ls_knvv-vkorg = p_inrec-vkorg.

   ls_addr1-sort2 = p_inrec-sort2.

   ls_addr1-str_suppl1 = p_inrec-str_suppl1.

   ls_addr1-str_suppl2 = p_inrec-str_suppl2.

   ls_addr1-str_suppl3 = p_inrec-str_suppl3.

   CALL FUNCTION 'SD_CUSTOMER_MAINTAIN_ALL'

     EXPORTING

       i_kna1                              = ls_kna1

       i_knvv                              = ls_knvv

       i_bapiaddr1                         = ls_addr1

       i_maintain_address_by_kna1          = 'X'

       pi_postflag                         = 'X'

     IMPORTING

       e_kunnr                             = vl_kunnr

     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.

Zach

Former Member
Not what you were looking for? View more on this topic or Ask a question