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_CHANGEFROMDATA1

Former Member
0 Kudos

Hi,

I am trying to change the customer address using BAPI_CUSTOMER_CHNAGEFROMDATA1. I got the message "Make an entry in all fields where required"

Below is my C# code:

string custNo ="0001000464";

string salesOrg = "XUS1";

string distChan = "01";

string div ="01";

BAPIKNA101_1 persData = new BAPIKNA101_1();

persData.House_No = "Alsterdorf 192";

persData.City = "Bruncwick";

persData.Postl_Cod1 = "32642";

persData.Country = "DE";

persData.Tel1_Numbr = "67-375-3675";

BAPIKNA101_1X persDataX = new BAPIKNA101_1X();

persDataX.Country = "X";

persDataX.City ="X";

persDataX.District = "X";

persDataX.House_No = "X";

persDataX.Postl_Cod1 = "X";

persDataX.Tel1_Numbr = "X";

BAPIKNA105 optPersData = new BAPIKNA105();

BAPIKNA105X optPersDataX = new BAPIKNA105X();

BAPIKNA106 compData = new BAPIKNA106();

BAPIKNA106X compDataX = new BAPIKNA106X();

BAPIKNA105 optCompData = new BAPIKNA105();

BAPIKNA105X optCompDataX = new BAPIKNA105X();

SAP.Connector.BAPIRETURN1 return0 = new SAP.Connector.BAPIRETURN1();

cs.ChangeFromData1(persData, persDataX, optPersData, optPersDataX, compData, compDataX, optCompData, optCompDataX, salesOrg, distChan, div, out return0,

custNo);

I would appreciate if anyone can tell me how I can solve this error.

Thank you in advance,

Sunny

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

It would seem that you are missing a required field. Try to update the system manually via the SAPgui and it may tell you what field you are missing.

Regards,

Rich Heilman

7 REPLIES 7

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

It would seem that you are missing a required field. Try to update the system manually via the SAPgui and it may tell you what field you are missing.

Regards,

Rich Heilman

0 Kudos

Rich,

Thank you for your suggestion. However, I tried by using FD01 to create a new record and FD02 to change. It doesn't require anything I did not provide so I am puzzled as to what I should do to solve this error.

Sunny

0 Kudos

Hello,

You have to enter the customer No BAPIKNA103-CUSTOMER .

Netaji.b

Former Member
0 Kudos

I don't know C# code, but I think you haven't supplied any street address and in most cases it is a required field. Pass something for the street1 field and see if you get the error.

Please take a look at your other posts to see if they are answered and close if so.

Regards,

Srinivas

Former Member
0 Kudos

It looks to me like you're telling it that you're going to update the district (persDataX.District = "X";) but then not supplying a value.

Rob

0 Kudos

Sometimes when you change a customer programatically, you come across one that was created in an earlier version without data needed in a later version. Check to see (FD02) if this customer is missing the search term. If it is and you don't add it, you'll get this error.

Rob

0 Kudos

Rob,

I could get it to work now. It is just that I need to specify firstname, lastname, language and currency as well.

Thank you for your help.

sunny