Application Development and Automation 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: 
Read only

. bapi to create customer

Former Member
0 Likes
500

Hi All,

I am having problem finding a right bapi for create a customer.

I am using "bapi_customer_createfromdata1" to create a customer. Problem is i couldn't find a structure to pass sales org. data as well as partner functions.

Please help me. Feel free to ask me questions.

Thanks,

Diwakar.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
431

Hi,

The way is using multiple BAPI's.

bapi "bapi_customer_createfromdata1" is used to create customer with reference customer number and then send the information to bapi "sd_customer_maintain_all" for changing the the values.

Still having problem passing parameters.

When i am sending partner information(knvp) to "sd_customer_maintain_all", it is giving abap dump assertion_failed.

I tried to debug the program but i couldn't find the error.

values i passed to bapi sd_customer_maintain_all

internal table of type <b>fknvp</b>.

MANDT sy-mandt 
KUNNR st_knvp-kunnr 
VKORG st_knvp-vkorg 
VTWEG st_knvp-vtweg 
SPART st_knvp-spart 
PARVW st_knvp-parvw 
PARZA 
KUNN2 st_knvp-sp_kunnr 
LIFNR 
PERNR 
PARNR 
KNREF 
DEFPA 

Appended line by line to the table.

Reward points if found helpful....

Cheers,

Venkoji Babu.

2 REPLIES 2
Read only

uwe_schieferstein
Active Contributor
0 Likes
431

Hello Reddy

The BAPI creates the new customer based on a template customer. Most of the business-related data are copied from this reference customer which you have to provide in the mandatory IMPORTING parameter PI_COPYREFERENCE. This structure contains the reference customer and the sales area:

SALESORG Sales Organization

DISTR_CHAN Distribution Channel

DIVISION Division

REF_CUSTMR Reference customer

The reference customer must exist in the sales area. The new customer will be created in the same sales area.

Kind Regards,

Uwe

Read only

Former Member
0 Likes
432

Hi,

The way is using multiple BAPI's.

bapi "bapi_customer_createfromdata1" is used to create customer with reference customer number and then send the information to bapi "sd_customer_maintain_all" for changing the the values.

Still having problem passing parameters.

When i am sending partner information(knvp) to "sd_customer_maintain_all", it is giving abap dump assertion_failed.

I tried to debug the program but i couldn't find the error.

values i passed to bapi sd_customer_maintain_all

internal table of type <b>fknvp</b>.

MANDT sy-mandt 
KUNNR st_knvp-kunnr 
VKORG st_knvp-vkorg 
VTWEG st_knvp-vtweg 
SPART st_knvp-spart 
PARVW st_knvp-parvw 
PARZA 
KUNN2 st_knvp-sp_kunnr 
LIFNR 
PERNR 
PARNR 
KNREF 
DEFPA 

Appended line by line to the table.

Reward points if found helpful....

Cheers,

Venkoji Babu.