cancel
Showing results for 
Search instead for 
Did you mean: 

Execution of duplicate check

Former Member
0 Kudos

Hello,

in our demo system the duplicate check is only executed when the address data like the country field of a contact is filled.

I expect the execution at that moment when the name of the obviously duplicate is filled and the button "enter" is pressed.

Best regards,

Marcel Brake

Accepted Solutions (1)

Accepted Solutions (1)

VishnAndr
Active Contributor
0 Kudos

Hello, Marcel.

For the same reason we've added own code in DO_VALIDATE_INPUT of BP_HEAD/AccountDetails view controller.

The code we've added is quite similar to the one which triggers standard duplicate check because of address changing. You can find it in the method HANDLE_DUPLICATES of the class CL_BUIL_ADDRESS (which in turn is called from MODIFY method of the same class).

Check the code which we've used in the attachement. The only parameter there is IR_OBJECT TYPE REF TO CL_CRM_BOL_ENTITY which represents BuilHeader entity. Also I'd suggest to trigger the duplicate check only if relevant data has been changed (e.g. check if there were any changes to the relevant fields before calling this method).

Hope this will help you.

Former Member
0 Kudos

Hello Andrei,

thanks for your quick response.

However, the solution does not fit completely to the requirement described by me. I am searching for a solution which works without any address data.

Here is the example: I create a contact and only fill the first name and the last name. After that I create a second contact with the same first name and the same last name. In our system the duplicate check will not be initiated, because in both business partners were no address data be maintained.

In the described scenario I would expect the duplicate check, because it is possible to save the contacts without the maintenance of any address data.

Furthermore I have a second question: It is possible that the duplicate check also includes the E-Mail-Address of the contact?

Kind regards,

Marcel    

VishnAndr
Active Contributor
0 Kudos

Marcel,

generally duplicate check in SAP CRM originates from BAS (Business Address Services) which deals with address. And there is all about addresses. I almost sure that the (standard) address is needed to run duplicate check. At least in standard manner.

We've also needed to run duplicate check without any address data entered during one of our projects. For that we've just defaulted the country in address. And so we had the address to run duplicate check.

Certainly, it's possible to develop own duplicate check flow (probably without addresses at all) with reference to standard Duplicate Check description and general understanding of BAS functionality. But it's probably should be done on project basis.

Regarding your second question about e-mail address of the contact. Yes, it's possible. But it seems you'll need to extend the fill-in logic to get this information to BAS structures. I strongly recommend to get familiar with Duplicate Check and Error-Tolerant Search topic beforehand.

Former Member
0 Kudos

Hello Andrei,

thank you for your assessment about my plan for ehancing the duplicate check.

You said that I have to extend the fill-in logic for the including of the e-mail-address. Do you know if the method "READ_INDEX_FIELD_LIST" of the business add-in "ADDRESS_SEARCH" is the right one (like it is described in Determination of Fields for Error-Tolerant Search)?

Kind regards,

Marcel    

VishnAndr
Active Contributor
0 Kudos

Marcel,

in READ_INDEX_FIELD_LIST method you can only provide pairs of table names and field names to use in duplicate check.

What we've done:

1. Provide desired fields in READ_INDEX_FIELD_LIST method of ADDRESS_SEARCH BAdI.

2. Extend the logic of providing content of our fields in method PREPARE_ADDRESS_SEARCHFIELDS of CL_CRM_BUPA_SEARCH using implicit enhancement at the end of the method.

3. Process actual duplicate check in method ADDRESS_SEARCH of ADDRESS_SEARCH BAdI.

Not sure if this is a correct logic. But it works for us.

Will be great if someone will provide different approach regarding # 2.

Hope this will help you.

Former Member
0 Kudos

Hello Andrei,

sorry, but the solution which you have mentionend before doesn't work in our system. Did you make further changes or enhancements?

The problem is that the table "TSAD10" doesn't contain the field "SMTP_ADDR" of the table "ADR6" and it is only possible to insert fields from "TSAD10" into the relevant table "SIC_BAS_FIELDS". Which field did you use in your solution?

Best regards,

Marcel

Former Member
0 Kudos

Hello Andrei,

please let me inform you that we have extended the table "TSAD10" with the field "SMTP_ADDR". After that we added the field to the table "SIC_BAS_FIELDS" for the indextable BUT000, but without any success.

Allthough we have recreated the index BAS_BUPA, the duplicate check doesn't get any results.

Best regards,

Marcel Brake

VishnAndr
Active Contributor
0 Kudos

Hi, Marcel.

If it's still relevant.

We didn't extend any standard tables as SIC_BAS_FIELDS etc.

What we've done regarding 3 steps mentioned above is:

1. Provide desired fields in READ_INDEX_FIELD_LIST method of ADDRESS_SEARCH BAdI.

Here in implementation of the BAdI we put something like this:

       DATA: l_field_list TYPE adfldline.

      l_field_list-tablename = 'ZTABLENAME'. "here is your table

      l_field_list-fieldname = 'ZFIELDNAME'. "here is your field

      APPEND l_field_list TO ex_field_list.

2. Extend the logic of providing content of our fields in method PREPARE_ADDRESS_SEARCHFIELDS of CL_CRM_BUPA_SEARCH using implicit enhancement at the end of the method.

Here is an implicit enhancement of the mentioned method:

.......

*$*$-Start: (1)---------------------------------------------------------------------------------$*$*

ENHANCEMENT 1  ZLS_SEARCHFIELDS_DUPLCHECK.    "active version

  READ TABLE et_search_fields ASSIGNING <ls_field>

    WITH KEY  tablename = 'ZTABLENAME'

              fieldname = 'ZFIELDNAME'.

  IF <ls_field> IS ASSIGNED.

    <ls_field>-content = ... "Provide some content for the field using appropriate FMs, BAPIs, BOLs etc.

  ENDIF.

ENDENHANCEMENT.

*$*$-End:   (1)---------------------------------------------------------------------------------$*$*

ENDMETHOD.

3. Process actual duplicate check in method ADDRESS_SEARCH of ADDRESS_SEARCH BAdI.

Here the logic quite simple:

    READ TABLE im_t_search_fields INTO ls_search_fields WITH KEY tablename = 'ZTABLENAME'

                                                                  fieldname = 'ZFIELDNAME'.

    IF sy-subrc EQ 0 AND ls_search_fields-content <> ''.

      "do the search and fill the result in ex_t_search_result and ex_number_of_hits

    ENDIF.

As I said previously it's not probably a best practice but it works for us.

Need to mention that we do not use any standard duplicate check solution here.

Former Member
0 Kudos

Hi Andrei,

I think the class is CL_CRM_BUPA_SERVICE.

We also have similar requirement but we have specific fields related to the communication to be added.

The Note: 1692370 is having all the relevant details.

However, I have also implemented the implicit enhancement in my project and it did work fine for my requirement.

I have been in contact with the Development Team and they are working on adding the new fields for duplicate search.

They have informed that they will be doing these current on Project by Project basis.

They seem to have a different approach for the next release to add the additional details.

Regards

Sainath V

nicolas_busson
Active Contributor
0 Kudos

Hi Andrei,

I ran into this thread while searching for information about duplicate check based on email address. And even if it's quite old, I wanted to leave a note with my findings, because your point #2 is exactly what SAP has released in the following OSS note to enable duplicate check based on email and tel number:

1836711  - HANA: Duplicate Check -1-

So I guess you have now the confirmation that your solution is spot on.

😉

Cheers,

Nick.

Former Member
0 Kudos

Hello Nicolas,

    I looked at the note, what if your CRM is not on a HANA DB yet, can phone & email be included in the contact duplicate check?

Regards,

nicolas_busson
Active Contributor
0 Kudos

Yes indeed!

The part of the note that is dedicated to HANA won't be activated in your system if you're running any other db. But be aware that I still got 2 different customer messages on going because the duplicate check based on email&tel is working fine on the business partner maintenance webui components, but it doesn't work in ELM and DQM.

Cheers,

Nicolas.

nicolas_busson
Active Contributor
0 Kudos

Hello,

Finally here are the answers to my customer messages about duplicate check:

1) To enable duplicate check on email & tel in DQM: 1960504 - Duplicate Check in DQA

2) However, ELM team didn't want to fix there erroneous coding: 1969625 - External List Management - FAQ notes.

It's a pity that the duplicate check is not consistent across the application... but As I said in many posts here on SCN, consistency doesn't seem to be SAP top priority 😞

Nick.

prabhanjan_reddy
Participant
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hello ,

I have the same requirement which consists to check duplicate emails , i would like to know how did you get the content of the field smtp_addr  which have be inserted by the user in the webui screen ?

Thank you by advance for your response

Hasnaa

Answers (0)