cancel
Showing results for 
Search instead for 
Did you mean: 

C4C: CheckForDuplicateAccounts checking data from ERP or external system

danielepiazza
Explorer
0 Kudos
518

Dear all,

I have some doubts about using the BADI CheckForDuplicateAccounts in SAP Cloud Applications Studio.

The purpose of our activities is to search possible duplicates on external systems such as SAP ERP or others.

Within the extension documentation it is written:

You can use this enhancement option to implement your own Account Duplicate Check logic (for example, call the Duplicate Check in a remote system).


*
	Add your SAP Business ByDesign scripting language implementation for:
		Enhancement Option: CheckForDuplicateAccounts
		Operation: CHECK_FOR_DUPLICATE_ACCOUNTS

		Script file signature
		----------------------------
		Parameter: InputData of type BadiAccountDuplicateCheckInput
		Returns: BadiDuplicateCheckResult

	Note: 
	  - To use code completion, press CTRL+J.
*/
import AP.FO.BusinessPartner.Global;
import AP.Common.GDT;

var result : BadiDuplicateCheckResult;
var resultEntry : BadiDuplicateCheckDuplicate;

// Perform the remote Duplicate Check...
var remoteSystemConnectionIssue = false;

// [...]

if (remoteSystemConnectionIssue) {
	// In case of connection issues raise error message
	result.QueryExecuted = "X";
	var myText : LANGUAGEINDEPENDENT_MEDIUM_Text;
	myText = "<ERP 1234>";
	raise z1.Create("E", myText); // z1 is defined as message for this enhancement implementation ("Remote system &1 could not be reached")

} else {

    // Return the found Duplicate Accounts...

	// Add 1st Potential Duplicate
	resultEntry.BusinessPartnerUUID.content = "00163E02EF341EE1BB93B81011CA532D";  // Replace this hard coded UUID with the correct one in your system!
	resultEntry.SimilarityPercent = "90.85"; // Replace this hard coded similarity with the correct one for this instance!

	result.Duplicates.Add(resultEntry);

	// Add 2nd Potential Duplicate
	resultEntry.BusinessPartnerUUID.content = "00163E12BA691ED5B6AEE937667DC1AA"; // Replace this hard coded UUID with the correct one in your system!
	resultEntry.SimilarityPercent = "85.13"; // Replace this hard coded similarity with the correct one for this instance!
	result.Duplicates.Add(resultEntry);

	// Return information that query was executed
	result.QueryExecuted = "X";
}

I therefore expect that it will be possible to search possible duplicates in SAP ERP and display them on C4C result list, but this assumption is not confirmed by the fact that as enhancement result an Account UUID must be entered.

If the Account is not in C4C but only in the external system, how can I set this parameter?

Best Regards,

Daniele

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member226
Employee
Employee
0 Kudos

Hi,

In order to use this BADI, it is necessary to return/pass Account UUID in the result table. i.e. if account is not yet in C4C then you cannot show it as a duplicate in C4C.

From the documentation text which you highlighted about "call the Duplicate Check in a remote system", my assumption is, you can call an external API from you BADI and evaluate the similarity rate in the external system however the account MUST persist in c4c in order for this BADI to return the correct result.

BR

danielepiazza
Explorer
0 Kudos

Hi,

so the BADI con be used "just" to implement my own Duplicate Check logic and not to match data in external systems.

Thank you,

D.

former_member226
Employee
Employee
0 Kudos

Yes, It can be used to implement your own duplicate check. This check can include some native business logic for C4C OR can involve call to an external system to validate the duplicate probability based on external environment BUT it will not consider those account which are not yet existing in C4C. (The assumption here is, your ERP & C4C systems are already in sync, hence there is no question of showing a external customer as duplicate in C4C)