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: 

using BAPI_CUSTOMER_CHANGEFROMDATA1

Former Member
0 Kudos

I'm trying to use this BAPI to update only the email address. However I get the error code F2827("Make an entry in all fields...").

I'm passing the customer number, sales org, and personal_data structures. However in the personal_data structures, I'm only filling in fields pertaining to the email address(i.e. I set pi_personaldatax-e_mail to 'X' and pi_personaldata-e_mail to the new email address.) I leave all other fields blank. Is this why the error is happening?

If I go into VD02, I can update the customer and I don't get any indication that other fields are missing.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Kevin,

I believe you might be missing one of the key fields.

Customer + sales org + sales office ??

What do you get as information if you just look up the customer instead of changing it (corresponding BAPI).

Sometimes you just have to read before changing and pass the information of the read to the changing...

Enjoy

5 REPLIES 5

Former Member
0 Kudos

Kevin,

I believe you might be missing one of the key fields.

Customer + sales org + sales office ??

What do you get as information if you just look up the customer instead of changing it (corresponding BAPI).

Sometimes you just have to read before changing and pass the information of the read to the changing...

Enjoy

0 Kudos

Thanks for your help.

My original question was basically: "does the error message refer to missing parameters being passed to the BAPI, or to missing fields within the personal_data structure." And if the answer was the latter then which fields are needed. My apologies for not phrasing this clearer initially.

I found another posting of a similar question, and the answer was that at least the first_name, last_name, language and currency fields were needed to be fill in the personal_data structure in order for the BAPI to work.

This combination seemed a little odd to me, and so I thought I'd post my situation. Your answer, FJB, forced me to take another look at the name, language and currency fields, ...and yes that did solve my problem.

So in my experience, the following parameters of BAPI_CUSTOMER_CHANGEFROMDATA1 were needed to successfully change the email address:

  • pi_personaldata

  • fill in at least the lastname, language, and

currency fields, in addition to the new email.

  • you might want to consider using

BAPI_CUSTOMER_GETDETAIL1.

  • pi_personaldatax

  • set the email field to 'X'.

  • pi_salesorg

  • pi_distr_chan

  • pi_division

  • customerno

Thanks to all.

0 Kudos

Thanks. This helped me. I do want to add a problem that I ran into. I had a contact person defined for my customer. When I tried to update the email for the address under the general data tab using BAPI_CUSTOMER_CHANGEFROMDATA1 it kept telling me that the addresses didn't match and the update would fail. Once I removed the contact person I was able to update the email address. I also needed additional fields populated like address. But it did work.

Former Member
0 Kudos

Hi Kevin,

Go Through the following

This method of the "Customer" business object can be used to change the personal or company data of a customer that exists in the R/3 system.

Only one filled structure (personal OR company data) can be passed on to the BAPI.

One person should be changed as a customer:

In this case, the customer is entered as a person (company address = address of contact person = personal address). The customer can then be a consumer (see import parameter PI_CONSUMEREN for the BAPIs: and BAPI_CUSTOMER_CREATEFROMDATA1 ).

(a) The customer is not a consumer:

If "only" a company address exists, this BAPI is used to change the company address accordingly, and create identical personal and contact person addresses.

If a personal address exists that is different (*) to the company address, then this is regarded as an error. In this case, the BAPI should receive the company address as well (see case (ii) below).

If only a company address exists with a contact person address and without a personal address, this BAPI can only be used to change the customer if a company address is also transferred to the BAPI ("ONLY_CHANGE_COMADDRESS" = 'X').

A different address is understood to be the following:

The personal or contact person address is different to the company address in one or more of the following fields: Language, Street, House number, Region, Town, Postal code, Country, Telephone number, Fax number, E-mail.

Note: for customer data created before Release 4.5A, a company address is different from the contact partner address if the first name, surname, or title of the contact partner of the 2nd entry differs from the 1st entry of the name field or title of the company address.

(b) The customer is not a consumer:

If only a company address exists in this case, then this is recognized as an error.

Otherwise, the same functions apply as for case (a) above.

(ii) A company should be changed as a customer:

In this case, only the corresponding address data (PI_COMPANYDATA) is changed in the BAPI.

Otherwise, the same change mechanisms are valid for changing the company customers as for the personal customers.

In all three cases (personal customer, consumer, or company customer) the following is valid:

All customer address data is determined from Central Address Management (CAM).

The personal/comp. data needed is the same as that needed for the method for creating a customer (siehe BAPI_CUSTOMER_CREATEFROMDATA1 ).

The authorization requirements for using this BAPI are the same as those for BAPI BAPI_CUSTOMER_CREATEFROMDATA1 , whereby here, the authorization is needed for the change activity.

The sales organization is a required field.

The number of the R/3 customer to be changed must be transferred to the BAPI.

Only fields (personal/company and optional personal/company data) flagged with X (see import structure PI_PERSONALDATAX are transferred to the database.

Hope it helps...

Lokesh

Pls. reward appropriate points by clicking the stars on the left side.

Former Member
0 Kudos

kevin,

BAPIs do not go by the screen sequences you encounter in transactions..they use the underlying structures for getting the data and then will update the respective tables .

Do check the structures and populate all required fields for updation.

Regards,

Raj