Technical Articles
Configure New Hana Fuzzy Search in Matching step for Material Consolidation in SAP MDG 9.2 on S/4 HANA 1909.
Introduction:
Configuring New Hana Fuzzy Search in Matching step for Material Consolidation in SAP MDG 9.2 on S/4 HANA 1909
As per Sap Documentations there are two approaches to achieve this requirement
- Configuration using the Fiori App Configure Matching for Consolidation – Adapter: CL_MDC_ADAPTER_MTC (New HANA fuzzy search).
- Configuration without the Fiori App Configure Matching for Consolidation – Adapter: CL_MDC_ADAPTER_FUZZY_MTC ( to create/change rules need Hana Studio ).
Solution:
As I did not have access to Hana Studio went ahead with the first approach.Having said that I also had one more constraint, the Fiori App ‘Configure Matching for Consolidation’ was not configured in the fiori platform during the time of my development so I had to create custom configuration id little differently,to get the matching rules created.
- Configuration using the Fiori App Configure Matching for Consolidation- Adapter: CL_MDC_ADAPTER_MTC (New HANA fuzzy search).
SAP provides the following standard match configurations that can act as template to help you to define and generate your own match configurations:
SAP_BP1 for Business Partner & SAP_MM1 for Material.
First lets try to understand the standard Fuzzy Ruleset Fields and the Fuzzy Ruleset Rules for the Config Id ‘SAP_MM1’.
Click on Configure matching
Click on Configure Sap Hana Fuzzy Matching
Now lets have a look into the Standard Config Id ‘SAP_MM1’
Fuzzy Ruleset Fields for the Config Id ‘SAP_MM1’ this basically contains the tables and respective fields which would be part of the matching criteria during the Matching step in Consolidation.
Now for Fuzzy Ruleset Rules
SAP_MM1 is the config id under which Article Number, Description etc are the sub rules. Since I did not have access to the Fiori APP ‘Configure Matching Consolidation’ as it was not configured at the time of the development I chose to create a custom config id ‘ZSAP_MM1’ by copying the standard config id ‘SAP_MM1’, but for more complex situation I would prefer to leverage the Fiori App in future for better flexibility on rule properties & values.
Configure Sap Hana Fuzzy Matching to create custom config id ‘ZSAP_MM1’.
Create a custom Config ID ‘ZSAP_MM1’ by copying SAP_MM1.Again this should be done from the app as per SAP recommendation. Check link for reference –https://help.sap.com/viewer/6b8255b03aa44628880b5b71c16ddb91/MDG91_SP02/en-US/e0c1ce6bfa1e4f2aa23393217e94b4c6.html
I will create Fuzzy Ruleset Fields for the Config Id ‘ZSAP_MM1’ by taking reference from the standard Config Id ‘SAP_MM1’.For our example I am considering MEINS, MTART, MAKTX, SPRAS fields to be part of the matching rule.
Now I need to create the Ruleset and its corresponding rule.For now lets understand I have to create the Ruleset and its Rules exactly how it is there for the standard Config Id SAP_MM1,this would be more clear once we see the rules in the app & their alignment in the UI.
Now to create the Fuzzy Ruleset Rules
But once the Fiori App was configured I found the custom config id ZSAP_MM1 was available there
ZSAP_MM1
As the rules are shown in the app ui, to achieve this the custom rules needs to be copied from the standard rules exactly to the T otherwise in the absence of the app the matching will not work properly hence we have to copy it carefully as per the standard alignments for each rule for the matching requirement.
This completes the configuration of Matching rules via approach 1.
- Configuration without the Fiori App Configure Matching for Consolidation- Adapter: CL_MDC_ADAPTER_FUZZY_MTC ( to create/change rules need Hana Studio )
I am mentioning this approach too, as initially I started with this approach and could not get the Matching rule work as no access to Hana studio. So just documented the part of creating custom match configuration.
To create the match configurations for the fuzzy matching run the Customizing activity Create Match Configurations for Fuzzy Matching.
In this Customizing activity, you define and generate a match configuration that SAP HANA uses to match master data records when using fuzzy matching. This activity is only possible within a client allowing cross-client changes. Configurations created here are used during configuration of process templates when assigning step type matching and adapter fuzzy matching.
SAP provides the following standard match configuration that can act as template to help you to define and generate your own match configurations:
MAT_MATCH1 is the standard match configuration for Material Matching.
Click on ‘Create Match Configurations for Fuzzy Matchinig’.
Create Custom Configuration ‘ZMATCH’ by copying the standard configuration id ‘MAT_MATCH1’and follow the steps General data ->Select Attributes->Review and Generate.
In General Data enter the details Match Configuration Name – ‘ZMATCH’ ,Description – Match by Description, Material Type &UOM, Respective Business Object type – 194 ,Abap package – Z* & most importantly the Hana Package – XXX, this would basically create the corresponding Rules in HANA DB, which can be accessed by the Hana studio.
Click on next to go to Select Attributes
This is similar to creating Search Views for duplicate checks from MDGIMG, where in this section we choose the concerned fields as per matching criteria and then finally review and generate.
Since my development with this approach was this much, for next steps to finish matching configuration below link can be referred
Now Configure Process template
Specify Process template
I will use the process template ‘ZTEST_MM’ for testing purpose.Not going into details for Process template configuration.
While setting the adapter class & relevant config id for the Matching step we need to keep the following thing in mind
Custom Match configuration created using the Fiori App ‘Configure Matching for Consolidation’ should be used with Adapter class: CL_MDC_ADAPTER_MTC (New HANA fuzzy search).
OR
And Custom Match configuration created without the Fiori App ‘Configure Matching for Consolidation’ should be used with Adapter class: CL_MDC_ADAPTER_FUZZY_MTC.
Conclusion:
Once all the Matching configurations are done now lets upload the data using the app ‘Import Data for Consolidation.
File content
Mara- Basic data
Makt- Description
Now coming back to the Consolidation app Import Data for Consolidation
I will start the process now by clicking start button
Now clicking on continue button to get to the matching step
Now we can see 4 Open Match Groups one with Orange color and the rest with Blue color.
Orange Color denotes Matching found in source records during the upload whereas Blue Color denotes Matching found with Active Records(records already updated in DB).
So basically Open match group will have the ‘Approve’ & ‘Reject All’ button whereas in Approved match group we will see only ‘Undo Approval’ button as the matching is done automatically before reaching the matching step its just we need to decide whether we are going to move ahead with the same or by undoing the approval the records will come under an Open group where we explicitly decide by clicking Apporve / Reject All button.
So now in Open match groups the matching can be based on Source records/uploaded records(Orange coloured ) or between active records(Blue coloured – DB records).
For source record matching we don’t get any score but when the matching is between source and active records we do get scores.
Now lets try to check the records
This basically means there are matches between themselves and system would take a best record for consolidation among these two.
Now lets try to approve this and check in the previous screen whether Approved group is created for this or not. This is done just to understand the difference between Open and Approved match group.
Clicking on Approve button
Now if you try to check the records under the approved match group
So now we see the ‘Undo Approve’ for the Approve match group.
By clicking on Undo approve button it will revert back to the original situation where the records will come under Open Match group.
Now checking the other records
Similarly for other groups
Lets approve all the match groups
Now on continuing to next steps
It gives a popup as not all the groups were approved
Click on Cancel and approve all the open match groups.One can also move ahead to next steps, without approving all the open match groups in that case the relevant records will not get updated through consolidation.
Now continuing to next steps
Lets try to check all the records
For new best record
And the below three records are updated
Now clicking on Continue
Enter Continue to Activate.
This completes the whole development.
Regards,
Debraj Roy.
Hi Debraj,
Very useful blog.
Thanks Senthilkumar.
Hi Debraj,
Nice blog.
Regards,
Riyaj.
Thanks Riyaj
Nice Blog Debraj
Thanks Rajiv
Nice blog, quite helpful.
Thanks Ranjan.
Awesome blog Debraj!
Thanks Rodrigo
Hi Debraj,
Very very useful Blog. We have used option 1 for matching. However it worked fine in Development. When we moved it to Quality it doesn't work. No Matching group found in that particular step. We have checked both the Server with Configuration and there are no differences. do you have any idea about it ? what we are missing ?
Thank you in advanced.
Prathamesh