Querying the Distribution Model
Prerequisites
The distribution model defines the potential receivers of a BAPI call. Because the distribution of data can be linked to additional conditions, certain dependencies between BAPIs or between BAPIs and message types can be defined as receiver filters.
A filter object is initially created for each receiver filter before the distribution model is maintained; the value of the filter object determines at runtime whether the condition is satisfied or not.
Procedure
The query of the distribution model is divided into the two sub-phases determining the filter objects and performing receiver determination.
Determining the Filter Objects
Before receiver determination can be performed, the filter objects that have been assigned to the BAPI must be determined.
If the filter objects are known at runtime, they can be specified directly during receiver determination. If not, function module ALE_BAPI_GET_FILTEROBJECTS is available: it extracts the corresponding filter objects for a specific BAPI.
Performing Receiver Determination
Function module ALE_SYNC_BAPI_GET_RECEIVER is called by the application program to determine the receivers of a synchronous BAPI. This module returns a table with all the receivers. In addition to the logical system, the table also contains the RFC destination.
If receiver determination is tied to conditions, then the function module must be given the values of the filter objects that were determined above.
Receiver determination for calling a remote BAPI from the ALE distribution model generally appears as follows:
call function 'ALE_SYNC_BAPI_GET_RECEIVER'
exporting
object= 'TESTFH01'
method= 'GETDETAIL'
tables
receivers= receivers
filterobject_values= filterobject_values
exceptions
error_in_filterobjects=1
error_in_ale_customizing=2
no_rfc_destination_maintained =3.
If you want to determine only one receiver for a synchronous BAPI, then the application program calls function module ALE_BAPI_GET_UNIQUE_RECEIVER.