Skip to Content
Author's profile photo Former Member

Relationship Data replication from ECC TO CRM

If you download a partner role from R/3 to CRM, a sales area-independent relationship is created in addition to the sales area-dependent partner function in CRM. You can no longer delete this from R/3 by a download in the standard system since a relevant object does not exist in R/3. So when you change the relationship (partner role from ECC) and download to CRM system rather than updating the existing relationship a new record gets created. The old records still remain in the system.


To delete the OLD relationship that exists in CRM system in BUT050 table.

There is an SAP Note which is valid for only CRM Release 3.0 – 4.0.

497146 – Rel. in CRM remains after download of partner function Deletion

Conditions checked:

·         Sales Org

·         Relationship category – ZW/ZR

Standard Function Module: CRM_BUPA_MTCS_REL

Create an Implicit Function Module: Z0CR_DELETE_REL_ECC_CRM


ET_REL_EXTERN is the structure will be having the data that is downloaded from ECC.

Get all the data like partner, partner2, sales org, relationship category.


check for the relationship category and sales org.


Check if there is already an entry in CRM with the ET_REL_EXTERN data


2 .Steps to be done if the record already exists in CRM

·         Delete the relationship from CRM using the FM BUPA_RELATIONSHIP_REMOVE.

·         Delete the record from ET_REL_EXTERN, if we don’t remove the record from this structure then it will create a new record in CRM with this data


To test (Debug) this functionality (FM):

Change the used/Password for CRM System maintained in SM59 of ECC system.

In ECC system in SM59 we need to save the ID/PASSWORD and then we can use the user to debug the FM.


Before Relationship Change in ECC

·         In ECC system below three customers are having ZW relationship maintained as in below screen shots.


In In CRM system


Request Download:

Define the queue with the partner1, partner2 and relationship category



Then download the queue: R3AR4



Then check the queues SMQ2/SMQ1.

Go to SMW01 and check the BDOC Generated:





N  Now check the tables in CRM, only one relationship should exist.


H  Hope it helps!!!

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Luís Pérez Grau
      Luís Pérez Grau

      Hi Anitha,

      Thanks for the contribution, but I have one doubt, if you follow the notes 497146 and 757955 you don't need and enhancement point, why did you do that?



      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Thanks Luis.

      We’ve implemented the SAP note suggested in the OSS raised for relationship replication.

      Even with the SAP note implemented (497146), the delta (changes from ECC in partner function data) is correcting itself in CRM, i.e. new one is replicated okay (except for one scenario in which new account/wholesaler comes into picture) but old relationships are not removed from CRM (if wholesaler partner function is changed from one to another). SAP note does mentions its only for a scenario when PF was deleted in ECC but we tried it to be sure.

      Hence, we cannot use the partner function clarification as it is, we would have to –

      Enhance relationship replication – to treat “customer + relationship type” as primary key i.e. is there is another relationship coming of same type for that customer, remove earlier one from BUT050 and let SAP standard code create a new one. Enhancement would be to write that validation of duplicate entry and deletion part just before inserting a new record.