I show you how to add two types of receiver determination filters to an SAP delivered ALE BAPI that does not support filtering in the standard delivery. The extension process is modification free and requires only customizing and trivial coding. I also deliver some background information on the workings of the ALE / IDoc machinery. The example is bad on the ALE function for SEPA mandate distribution.
Our company employs a central master data server (MDS) for several FI/CO master data objects, like Customer and Vendor. The MDS distributes the master data to the operational systems executing business processes like payments or dunning. While the MDS holds the enterprise view on all master data, the operational systems shall receive only those parts that are relevant to them. Relevancy is determined by a combination of criteria, like account group and company code(s) the data is relevant for.
The unification of the Euro payment area (SEPA) brings about new processes for direct debit payments. In future, it is necessary to establish a so-called Mandate, which is basically an agreement between you and your Customer that allows you to debit from your customer's account. The Mandate is therefore linked to your Customer, both in the business as well as the IT sense.
Combining the above scenario description for the master data landscape and the SEPA direct debit process leads to the following requirements:
This section will help you understand the implementation. If you only want to add a message dependency for SEPA messages, you can skip ahead to the Implementation section.
IDoc is the oldest form of message based SAP system connection. While this technology offers powerful filtering and data translation functions, a receiver determination can only be applied indirectly, by adding a data filter on a field in the top-level segment of the IDoc. We use the following criteria:
Filtering is done in the distribution layer and does not require changes on the application programm side, i.e. it is always possible to add additional data filters (even to SAP delivered IDoc types) via customizing without modifications.
During the mid 90s of the last century, SAP introduced ALE for connecting business processes across several systems. This is achieved by automatically generating IDoc message types (the technical foundation) from BAPI methods that are connected to BOR objects. All ALE BAPIs automagically take use of the common ALE layer, that provides the same functionality as classic IDoc, but adds a receiver determination function.
2 types of receiver filters are supported:
The ALE BAPI receiver determination does require changes on the application program using the ALE BAPI. This is necessary as unlike with IDoc, the filter values are not read from the IDoc message, but have to be provided by the application program (whilst calling ALE_ASYNC_BAPI_GET_RECEIVER). This provides greater flexibility, but also means you have to rely on your favorite software vendor to provide some extension points for you.
The following implementation adds a value-based and a message dependency-based receiver determination filter to the SEPA.SaveReplica ALE BAPI. The following SAP notes are prerequisites for the implementation:
The filters created will be:
Now the filter objects are known, but the SAP application program does not populate them, as the programmer at SAP have no way of knowing these filters. This is rectified in the next step.
SAP has to provide an extension point so that you can populate your filter values. This usually involves coding some function module or implementing a BAdi and making your implementation known to the SAP implementation.
The filter for the sender ID should not be used directly in the ALE distribution model as a value filter. Instead, it is used an input to a function module that in turn creates the filter values (here: attributes of Customer) needed to determine if the dependent message (here: DEBMAS) would be sent to the same receiver system.
You are now able to add additional filters for SEPAMandate.SaveReplica in the ALE distribution model (BD64):