Entering content frame

Procedure documentationDetermining Filter Objects Using Business Add-Ins Locate the document in its SAP Library structure

You will find out how SAP defines Business Add-Ins and how you implement a Business Add-In to query filter objects you have defined when determining receivers.

Use

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

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

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 refer to the application documentation.

Prerequisites

The following prerequisites must be fulfilled:

·         Your SAP applications contain Business Add-Ins defined by SAP (Tools ® ABAP Workbench ® Utilities ® Business Add-Ins ® Definition, 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 (via the SAP menu). Tools ® IDoc Interface/ALE® Development ® BAPI ® Receiver Determination).

·         You have implemented and activated the Business Add-In (from the SAP menu: Tools ® ABAP Workbench ® Utilities ® Business Add-Ins ® Implementation).

·         You have defined a filter object with specified conditions in the distribution model under the sender and receiver settings (from the Implementation Guide (IMG): SAP Web Application Server ® IDoc Interface/ALE).

Example:

Sender
  Receiver
     BUSOBJECT.METHOD

Receiver Determination
   Filter Group
        FILTER
            1010

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 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 under Example Programs with Asynchronous BAPI Calls, Receiver Determination with Business Add-In)

Procedure

Implement the object method for the business add-in under the filter object type you have defined.

Result

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

 

 

 

 

Leaving content frame