‎2008 Apr 11 7:17 PM
I'm trying to use BAPI_CUSTOMER_CREATEFROMDATA1 to update the customer master.
This does not work asking message the referencing customer number does not exist on the sales master.
Since I want to create a new customer, I have nothing to reference do I?
I then switched and tried sub-function module inside the one above called SD_CUSTOMER_MAINTAIN_ALL and this update and created a new customer number with appropriate data.
This function module alone does not update the 'View' so when I try to view the newly created customer number in VD01 and the screen dumps saying the DYNPRO not found.
Has anyone had this error and maybe the best way to use ABAP to create/change a customer master record.
‎2008 Apr 11 7:43 PM
Give us the code that calls this BAPI..
Are you using PI_COPYREFERENCE?
The reference customer should be created bearing in mind that its sole purpose is to provide data for customers that are created via the BAPI. That is, the reference customer is not an operative customer in the business sense. As a result, the customer should be created with a separate account group with internal number assignment. In addition, the reference customer must exist in the organizational data that is transferred to the BAPI. If company-code-independent data is transferred to the BAPI, the reference customer must be created for a company code.
G@urav.
‎2008 Apr 11 7:49 PM
I am using PI_COPYREFERENCE.
My structure looks something like this.
I'm still not sure what to use for this ref_custmr. My business process is a new customer needs to be created, non-existent in our system. I am not sure how to use this ref_custmr.
copyref-salesorg = '1000'.
copyref-distr_chan = '10'.
copyref-division = '01'.
copyref-REF_CUSTMR = .
‎2008 Apr 11 8:13 PM
Reference customer will be used to get the organizational data which is not passed to the BAPI .
All the master data, company code data, sales area data, tax code data, and reminder data that is not entered is adopted from a reference customer and from the sales area data (sales organization, distribution channel and division - import parameter PI_COPYREFERENCE).
Otherwise, If values exist for the fields in PI_OPT_PERSONALDATA, these values take priority over any equivalent values for the reference customer.
Hope you now u understand that it is just a reference used to get data when it is not found in PI_OPT_PERSONALDATA.
G@urav.
‎2008 Apr 11 8:34 PM
I still receive error message "889Internal error: Ref. customer does not exist in comp.code master record' even after filling in all fields on PI_OPT_PERSONALDATA. Any ideas?
I've pasted my code below.
REPORT ZINC_TEST_SETUP_TABLE.
Data:
personaldata like BAPIKNA101_1,
personalopt like BAPIKNA105,
copyref like BAPIKNA102,
message like bapireturn1,
SORTL LIKE KNA1-SOrtL,
custnumber(10) type c.
personaldata-firstname = 'RYAN FIRST NAME'.
personaldata-lastname = 'SPACE'.
personaldata-CITY = 'GRAND RAPIDS'.
personaldata-POSTL_COD1 = '49508'.
personaldata-STREET = '44th'.
personaldata-country = 'US'.
personaldata-REGION = 'US'.
personaldata-CURRENCY = 'USD'.
personaldata-LANGU_P = 'EN'.
personalopt-TRANSPZONE = '1111'.
personalopt-CONTROL_ACCOUNT = 'Z003'.
personalopt-PMNTTRMS = 'MI'.
personalopt-SHIP_COND = 'MI'.
personalopt-DELYG_PLNT = 'MI'.
personalopt-PART_DLV = 'MI'.
personalopt-C_CTR_AREA = 'MI'.
personalopt-TAXJURCODE = 'MI'.
copyref-salesorg = '1000'.
copyref-distr_chan = '10'.
copyref-division = '01'.
copyref-REF_CUSTMR = '0000022492'.
*
Call function 'BAPI_CUSTOMER_CREATEFROMDATA1'
exporting
PI_PERSONALDATA = personaldata
PI_OPT_PERSONALDATA = personalopt
PI_COPYREFERENCE = copyref
importing
CUSTOMERNO = custnumber
return = message.
Write custnumber.
‎2008 Apr 11 8:53 PM
copyref-salesorg = '1000'.
copyref-distr_chan = '10'.
copyref-division = '01'.
*copyref-REF_CUSTMR = '0000022492'.
It searches for this record, but can't find any, hence the error "889Internal error: Ref. customer does not exist in comp.code master record'
Indeed provide some reference customer no which can be used for getting those values...
If you r passing proper values in PI_OPT_PERSONALDATA, PI_COPYREFERENCE won't get used .
G@urav.
‎2014 Dec 16 7:57 AM