Show TOC

Determining Filter Objects Using Business Add-InsLocate this document in the navigation structure

Use

This section outlines how SAP defines Business Add-Ins and how you implement a Business Add-In to query filter objects you have defined when determining receivers.

Note

This description only applies to receiver determination with Business Add-Ins.

It is only relevant for BAPIs for which ALE interfaces exist and for which Business Add-Ins are to be implemented.

In the standard system, SAP provides a range of filter object types for receiver determination. These filter object types are evaluated with the values assigned by you at runtime (for example, filter object plant 0001, 0002). You can add to the default values provided.

If you do however want to use different filter object types for mapping your own business processes to execute the asynchronous BAPI call under enhanced conditions, you have to implement and activate the Business Add-Ins defined by SAP. Business Add-Ins are spots defined by SAP programmers in the source code where you can insert code without having to modify the original object.

To find out which of your SAP applications contain Business Add-Ins, see the application documentation.

Prerequisites

The following requirements must be met:

  • Your SAP applications contain Business Add-Ins defined by SAP ( Start of the navigation path Tools Next navigation step ABAP Workbench Next navigation step Utilities Next navigation step Business Add-Ins Next navigation step Definition End of the navigation path, see also the example below, Creating a Business Add-In in a Form Routine).

  • In the ALE development environment, you have defined a filter object type for the receiver determination, for example, FILTER and assigned it to the appropriate BAPI (from the SAP menu: Start of the navigation path Tools Next navigation step IDoc Interface/ALE Next navigation step Development Next navigation step Receiver Determination End of the navigation path).

  • You have implemented and activated the Business Add-In (from the SAP menu: Start of the navigation path Tools Next navigation step ABAP Workbench Next navigation step Utilities Next navigation step Business Add-Ins Next navigation step Implementation End of the navigation path).

  • You have defined a filter object with specified conditions in the distribution model under the sender and receiver settings (from the Implementation Guide (IMG): Start of the navigation path SAP Web Application Server Next navigation step IDoc Interface/ALE End of the navigation path).

Sender

Receiver

BUSOBJECT.METHOD

Receiver determination

Filter group

FILTER

1010

Procedure

Creating a Business Add-In in a Form Routine

Receiver determination for a BAPI (BUSOBJECT.METHOD) can be structured by SAP developers in SAP applications using a form routine (for example, BUSOBJECT_METHOD_RECEIVERS):

Interface:

TABLES     receivers STRUCTURE bdi_logsys
USING           object TYPE swo_objtyp
                method TYPE swo_method
                parameters LIKE ...
                return_info LIKE syst.

         

In this example, the parameters parameters contain all the filter object values of the application required for receiver determination. They are application-dependent.

The parameter receivers contains the required receivers (or initial value) as the default value and the determined receivers as the return value.

Definition of variables:

t_filter_object_type       TYPE    bdi_flttyp_tab
 t_filter_object_value  TYPE    bdi_fobj_tab
 receivers_output                       LIKE    bdi_logsys OCCURS 0 WITH HEADER LINE

         

The following steps are carried out in the program code of an SAP application: It involves the same steps as when determining the filter object types defined by SAP, with the additional step (step 3) for determining the filter objects you have defined.

  1. Query filter object type for the BAPI with the function module ALE_BAPI_GET_FILTEROBJECTS:

    EXPORTING
    object = busobject
    method = method
    TABLES
    receiver_input = receivers
    filterobjects = t_filter_object_type
    EXCEPTIONS
    error_in_ale_customizing
    
                   
  2. Assign the current values of the application in parameters parameters to the filter object type provided by SAP in the structure t_filter_object_type.

  3. Call the defined Business Add-In to evaluate the filter object types defined by the customer in the flow logic of the application.

    EXPORTING
    object = busobject
    method = method
    parameters = ...
    filterobjtype = t_filter_object_type
    CHANGING
    filterobjvalue = t_filter_object_value
    
    
                   
  4. Determine the receivers of the asynchronous BAPI call using the function module ALE_ASYNC_BAPI_GET_RECEIVER.

    EXPORTING
    object = busobject
    method = method
    TABLES
    receiver_input = receivers
    receivers_output = receivers_output
    filterobject_values = t_filter_object_value
    EXCEPTIONS
    error_in_filterobjects
    error_in_ale_customizing
    receivers[] = receivers_output[]
    
                   

(You can find the program code of this example in Example Programs with Asynchronous BAPI Calls, Receiver Determination with Business Add-In.)

Implement the object method for the Business Add-In using the filter object type you have defined.

Result

The receivers of the asynchronous BAPI call have been determined using the defined filter objects.