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_CUSTOMER_CREATEFROMDATA1 to create customer

Former Member
0 Likes
1,792

I am new to SAP. I am trying to create a customer in SAP 4.7 using BAPI_CUSTOMER_CREATEFROMDATA1 and running into all kinds of problem on sales org does not exist in master record, to copy customer does not exist in the master record, to tax code and address text relate problem.

Is there simple way to find out required data to create new cusomer using that bapi

5 REPLIES 5
Read only

Former Member
0 Likes
1,121

Hi,

you can use PI_COPYREFERENCE parameter to create customer using the reference.

pass BAPIKNA102 structure and populate

Sales Organization,

Distribution Channel,

Division and Reference customer.

CALL FUNCTION 'BAPI_CUSTOMER_CREATEFROMDATA1'

EXPORTING

PI_PERSONALDATA = PI_PERSONALDATA

  • PI_OPT_PERSONALDATA = PI_OPT_PERSONALDATA

  • PI_COMPANYDATA = PI_COMPANYDATA

  • PI_OPT_COMPANYDATA = PI_OPT_COMPANYDATA

  • PI_CONSUMEREN = PI_CONSUMEREN

PI_COPYREFERENCE = PI_COPYREFERENCE

  • PI_CREDIT_CONTROL_FLAG = PI_CREDIT_CONTROL_FLAG

  • IMPORTING

  • CUSTOMERNO = CUSTOMERNO

  • RETURN = RETURN

.

please try like this.

bye

srinivas

Read only

uwe_schieferstein
Active Contributor
0 Likes
1,121

Hello Sanjay

These are the mandatory address fields (either for PI_PERSONALDATA or PI_COMPANYDATA):

- LASTNAME (if you have a personal address)

- NAME (if you have a company address)

- CITY

- POSTL_COD1

- STREET

- COUNTRY

- LANGU_P

- CURRENCY

Furthermore, you <b>must</b> provide a reference customer in order to create a new debitor (PI_COPYREFERENCE, all fields must be filled and this reference customer must exist for this sales area). All debitor-specific data (<> address data) are copied from the reference customer. This is sample like using transaction XD01 with a template debitor.

Regards

Uwe

Read only

Former Member
0 Likes
1,121

Thanks for the information. I always endup getting wrong combination. i.e, if I get the right refrence customer it would say the sales record does not exist in the master table. If every thing else is fine I would get tax related error. I know I am asking very trivial question but is there any way I can get good data to pass so all the interdepandancy not creating any problem.

Again I am new to this and I am trying to demonstarte the capability to integrate with BEA WebLogic and ALSB to SAP using BAPI/WebService and IDOC XML transport. But in order to demo those I need to figure out the right combination of the data to create the customer so I can popluate the xml with right data using WS or IDOC/XML over HTTP.

Read only

0 Likes
1,121

Hello Sanjay

If you have access to the SAP system where you want to create the new customers (or if you have a SAP user at hand) then call transaction <b>XD01</b> (Create customer) and create a new customer using an existing customer as template (= reference customer). <b>The reference customer must exist in a company code and a sales area (combination of sales organisation, distribution channel and division)</b> of this company code. When you enter the adress data of the new customer you will see that only the fields I mentioned before are required.

If this works fine, i.e. the new customer is created within the company code and the sales area then you can use these data for feeding the BAPI. However, be careful to vary the address every time because otherwise the BAPI might complain that a customer with similiar address exists already.

Regards

Uwe

Read only

0 Likes
1,121

Hi all,

I also would like to create a customer with BAPI_CUSTOMER_CREATEFROMDATA1. I looked up some customers in XD01 to use as a reference, but am not able to get the SalesOrg, Division, and other sales parameter. I tried BAPI_CUSTOMER_GETSALESAREAS. But what I always get back is

"No sales area data has been maintained for customer number XXXX"

How can I look up this information?

Where can I find documentation about what is a mandatory field for a structure I need to give to a function module? I mean there are tons of fields and nobody really knows which one to fill and which not and what constraints exist between fields and structures and tables. That drives me nuts

Hope you guys have some answers ready.

Looking forward to hear from you.

Thanks

Stefan