Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_CUSTOMER_CREATEFROMDATA1 - Previous Account Number field

Former Member
0 Kudos

Hi,

I have a requirement to create customers in SAP from an external system. We need to store the customer numbers of the external system to the 'Previous account number' field(KNB1-ALTKN). (This field is in the Account management tab of Company Code details in XD03 transaction. )

I need to use the SAP provided BAPI -BAPI_CUSTOMER_CREATEFROMDATA1 -to create the customers in SAP. But, I don't see a field in the bapi where I can input the existing customer number.

Please provide your expert and detailed advice.

Thanks,

Ani

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Ani, the BAPI_CUSTOMER_CREATEFROMDATA1 create a customer from an existing customer (reference). I think that the function module SD_CUSTOMER_MAINTAIN_ALL help you. This FM is use into BAPI_CUSTOMER_CREATEFROMDATA1 and it has the parameters that you need to happed.

Example:

CALL FUNCTION 'SD_CUSTOMER_MAINTAIN_ALL'

EXPORTING

i_kna1 = i_kna1 " General part

i_knb1 = i_knb1 " Company code details

i_knvv = i_knvv " Sales area info

i_bapiaddr1 = i_bapiaddr1 " Address

pi_postflag = pi_postflag " X=Post document

IMPORTING

e_kunnr = e_kunnr "Customer

You can create un FM: Z_ and you can do it RFC anable. Then implement SD_CUSTOMER_MAINTAIN_ALL FM.

Regards, Victor

2 REPLIES 2

Former Member
0 Kudos

Hi Ani, the BAPI_CUSTOMER_CREATEFROMDATA1 create a customer from an existing customer (reference). I think that the function module SD_CUSTOMER_MAINTAIN_ALL help you. This FM is use into BAPI_CUSTOMER_CREATEFROMDATA1 and it has the parameters that you need to happed.

Example:

CALL FUNCTION 'SD_CUSTOMER_MAINTAIN_ALL'

EXPORTING

i_kna1 = i_kna1 " General part

i_knb1 = i_knb1 " Company code details

i_knvv = i_knvv " Sales area info

i_bapiaddr1 = i_bapiaddr1 " Address

pi_postflag = pi_postflag " X=Post document

IMPORTING

e_kunnr = e_kunnr "Customer

You can create un FM: Z_ and you can do it RFC anable. Then implement SD_CUSTOMER_MAINTAIN_ALL FM.

Regards, Victor

Former Member
0 Kudos

Thanks Victor.

I am using the FM 'SD_CUSTOMER_MAINTAIN_ALL' to create the customer and it is working fine.

Ani