cancel
Showing results for 
Search instead for 
Did you mean: 

Calling BAPI_CUSTOMER_CHANGEFROMDATA1 from Data Services

Former Member
0 Kudos

I’m having a couple of issues trying to use Data Services to update R/3 via BAPI_CUSTOMER_CHANGEFROMDATA1.

I’m new to SAP and relatively new to BODS too, so apologies in advance if I'm doing something silly.

So, the object of the exercise overall is to pick up changes in the source system - salesforce.com (SFDC), if it matters - and update the corresponding customer record in SAP.

Here’s where I’m up to at the moment: in SFDC, I can change, say, the contact’s telephone number and then see the change go through my Data Services dataflow.  There’s a custom field in SFDC that holds the SAP customer number, so by the time the data gets through as far as the BAPI, I have the SAP customer number, the changed telephone number, and a few other fields like LastName, and I think I should be able to assign those values to fields in the BAPI function, and have the SAP record updated.

The SAP log reports that the job completed successfully, but it also throws up an error:

Error calling custom RFC function <BAPI_CUSTOMER_CHANGEFROMDATA1 RFC return error! F2 892 Internal error: Sales Organization does not exist in master record  000000    >

The change to the telephone number has not been successfully applied to SAP.

The Sales Organization that I’m passing to the BAPI is ‘UK10’ (which I’ve tried passing through the dataflow and which I’ve also tried hard-coding into the BAPI function), and this is the correct Sales Organization for the customer that I’m trying to update.

I read a post on SCN that said you can’t update the company level data and the personal data via the BAPI at the same time.  So I tried to change the BAPI call to only update the personal-level data (and also AL_LANGUAGE, CUSTOMERNO, PI_DISTR_CHAN, PI_DIVISION, PI_SALESORG).  This gave me a different error when I tried to run the job:

Error calling custom RFC function <BAPI_CUSTOMER_CHANGEFROMDATA1 RFC return error! F2 827 Internal error: Make an entry in all fields where required   000000    >

I tried to figure out what the required fields were from the BAPI documentation, but I couldn't find the relevant information.  A post on SCN suggested that the required fields are LASTNAME, CITY, POSTL_COD1, STREET, COUNTRY, LANGU_P and CURRENCY.  All these are set in my BAPI function, and I’ve also set the corresponding ‘X’ field for each of these.

I’ve tried Google and I’ve tried re-reading the BAPI documentation, but it hasn’t helped me.

If you do have any ideas, or suggestions for where I could look next, I’d be very grateful.

Thanks

Steve

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Can you try updating the phone number manually via tcode 'XD02' without getting an error message? You should be able to get the list of all system required mandatory fields, if any while saving this change.

-Chaitanya

Former Member
0 Kudos

Thanks for the response, Chaitanya.

I have finally solved this problem, with some help from my colleagues.  We determined that the mandatory fields were:

TITLE_P

LASTNAME

CITY

POSTL_COD1

COUNTRY

COUNTRYISO

LANGU_P

LANGUP_ISO

CURRENCY

CURRENCY_ISO

However, even with these fields set, the error "F2 827 Internal error: Make an entry in all fields where required" was still appearing.  In the end, I deleted the BAPI call from the DS query and rebuilt it, and that appeared to sort out the problem and it is now working.  I guess the original BAPI call had become corrupted, somehow, maybe?  Anyway, all is working now.

Answers (0)