CRM and CX Blogs by Members
Find insights on SAP customer relationship management and customer experience products in blog posts from community members. Post your own perspective today!
cancel
Showing results for 
Search instead for 
Did you mean: 
Kinsbrunner
Active Contributor
4,813

Introduction

When working with system integration, we often receive business requirements where customer do not want to replicate all their information from one system to the other, so there is when filtering becomes necessary.

Systems such as C4C, ERP and CRM should hold business logic and not Middleware (in order to minimize dependencies), however we should analyze where to apply each filter, depending on each particular case.

Purpose

The aim of this document is to explain an overview of the ways to filter data exchange for specific objects from ERP into C4C and, vice versa. This document should help consultants to define whether they can solve their business requirements through this method or, to research for other alternatives.

Filtering data from C4C into other system (ERP, CRM, etc.)

When requirement is to filter objects to flow from C4C into other systems, this has to be managed through Scoping under Business Configuration workcenter. A common example for this is when customer requires not to replicate Prospects from C4C into ERP. As said before, this is being done through Scoping questions:

Filtering data from ERP into C4C

When requirement is to prevent objects (such as Accounts or Materials) from being replicated into C4C, SAP provides some standard filters which can be accessed and configured through BD64 transaction.

When requirements is to filter Accounts, the filter will be put over DEBMAS_CFS message type and the available filters are the following: Account Group, Country Key, Postal Code, Region, Global Code, Credit Control Area, Function, Division, Sales Organization and, Distribution Channel.

When requirements is to filter Materials, the filter will be put over MATMAS_CFS message type and the available filters are the following: Language Key, Material Group, Material is configurable, Competitor, Material Type, Division, Plant, Storage Location, Valuation Area, Warehouse Number, Sales Organization and, Distribution Channel.

In the following screenshot, you can see an example where Acconts are being filter through Acconut Group and, Materials by Material Group:

Something which is very important to highlight is that consultants should include those values of filters which want to be taken into account which means that values which are not mentioned under this filters, will be ignored and not replicated into C4C. Filters are inclusive and not exclusive.

In case it is required to filter with other criteria, it is possible to implement BAdI IDOC_CREATION_CHECK but be aware that code should be very specific and restrict any other scenario as this could affect normal behavior of the system. Also, there is a second BAdI for preventing Change Pointers from being written which is BDCP_BEFORE_WRITE. For sure, it is highly recommended to use delivered filters, when possible, instead of using BAdIs.

Filtering data on Middleware

As mentioned in the Introduction, it is a good practice to avoid including business logic on Middleware. In addition to this, imagine system has a huge amount of records which will be passed into PI/HCI (as IDOCs) and will be filtered out there consuming resources; this should have been done definitely on the source system and not in the Middleware.

I would only recommend to apply filters in Middleware if delivered filters and BADIs do not satisfy business requirements.

5 Comments
SAPjedi
Contributor
0 Kudos

Please confirm if those filters above are working as whole IDOC filters, or just segment filters ?  The effect of segment filters is that the whole idocs is still sent but with just those segments matching those values.

rajiv_juarbal
Participant
0 Kudos
Hi Tim, it seems to be filtering the segment only not the whole IDOC  as what we have observed in our current system. @Alejandro: We're you able to filter the whole IDOC?
former_member193040
Participant
0 Kudos
Hello,

thanks for that great blog.

We have the same requirement as you described above. We would like to filter Accounts (DEBMAS_CFS) on Account Group. Therefore we set the filter in BD64 as you described. Then we have the effect that address IDocs are not created anymore.

How could we now realize our requirement with standard customizing and not with implementing the BadI IDOC_CREATION_CHECK?

 

Thanks,

Anne
sandrobunturi
Participant
0 Kudos
Hello

 

How can I do so that bd64 filters restricted whole idoc sending ? I want to send only specific sales organization customers to c4c, but when I set this filter customer data is still stent, but without the segment which holds data about sales organization.

BR

 

Sandro.
fel_me
Discoverer
0 Kudos
Hello Sandro,

a little late, but the above mentioned BAdI does exactly that:

IDOC_CREATION_CHECK

If you implement that you get a class/method where you have IDOC-Info like Tenant/Port, Message type for which you should filter, as this BAdI is called for all IDOC messages. And you want to make sure only to change this message, and not all.

SAP recommends to only use this if the ALE-Filters do not offer a solution.

We for example use it to transfer materials to C4C, but only if at least one Sales-Org Master Data set is available for the material.

You can loop through IDOC_DATA which contains all segments of the IDOC and then check if a certain segment (or value of the segment) is missing/available.

segnam = Name of Segment (for example E1MVKEM - Sales Org data from Material).

sdata contains the data as String, but you can define a structure type E1MVKEM and then transfer the data  to that structure  ls_E1MVKEM = <ls_edidd>-sdata

then extract your data from the field of that structure (for example ls_e1mvkem-vkorg) for further checking.

If your check has the outcome: no IDOC shall be created then simply set CREATE_IDOC to abap_false (default it is set to abap_true - which means IDOC is generated).

Hope this was helpful - if you have not solved it already.
Labels in this area