Start of Content Area

Function documentation Receiver Pre-Identification  Locate the document in its SAP Library structure

Purpose

You configure the receiver of a message by using the central settings in the Integration Directory. However, in the application program it is useful to know whether a receiver exists, for the following reasons:

·        It can take a long time to structure the message to be sent, for instance when a large amount of application data has to be selected. If the application is able to query whether a receiver exists before it sends the message, then the data does not necessarily need to be selected at all.

·        If you send a message from the application program even though there is no receiver, the Integration Server cannot forward this message. If an application program catches this case at the outset, such messages do not appear unnecessarily in monitoring.

The ABAP proxy runtime provides a routing protocol to support such receiver pre-identification.

Prerequisites

The routing protocol must access the Integration Server to get the configuration for an outbound interface. The Integration Server is determined from the specific configuration data of the Integration Engine (category RUNTIME, parameter IS_RFC_DESTINATION); see the section Change Specific Configuration Data in: Displaying/Changing Configuration Data. Also note that specific configuration data is client-specific. Therefore, you can query different Integration Servers in different clients.

If there is no entry for the parameter IS_RFC_DESTINATION, the routing runtime gets the address of the Integration Server by using the RFC destination AI_INTEGRATION_SERVER. However, this entry applies to all clients in an SAP system.

Features

Receiver Pre-Identification Methods (Interface IF_WS_PRE_ROUTING)

Method

Use

RECEIVERS_EXIST

Determines whether receivers exist by using the sender specification and, optionally, the payload. Applications that set the receiver themselves also have to specify the set receiver here (see below).

GET_LOGICAL_PORT_FROM_RECEIVER

The logical port is required to establish a point-to-point connection using Web services. Applications that set the receiver themselves (for example, because it is known from customizing data) can use this method to have the system return the logical port for a receiver. To assign receiver data to a logical port, enter the transaction LPCONFIG on the XI Receiver tab page (see also: Creating a Logical Port).

Activities

Receiver Pre-Identification with or Without Payload

You can execute the receiver pre-identification with or without the payload. This is significant when routing conditions exist that access the payload. In such a case you must fetch the payload before the client proxy call (see: Querying the Payload).

If you execute the receiver pre-identification without a payload, the parameter ROUTING_VIA_PAYLOAD of the method RECEIVERS_EXIST shows you whether there are conditions in the routing for the specified sender. In such a case, it is only possible to determine whether a receiver exists by using a payload.

...

       1.      Instantiate your client proxy (in this example lo_clientProxy) and fetch the routing protocol (see also: Protocols):

data: lo_clientProxy      TYPE REF TO co_clientProxy,
      lo_routing_protocol TYPE REF TO if_wsprotocol_routing.

CREATE OBJECT lo_clientProxy.
lo_routing_protocol ?=
      lo_clientProxy->get_protocol ( if_wsprotocol=>routing ).

       2.      To execute a receiver pre-identification, declare the following variables and fetch an object for the interface IF_WS_PRE_ROUTING:

Data: l_routing_runtime type ref to IF_WS_PRE_ROUTING.

Data: ls_sender             type SXI_ADDRESS,
      lo_payload            type REF TO IF_WS_PAYLOAD,
      l_routing_via_payload type PRX_BOOLEAN,
      l_receivers_exist     type PRX_BOOLEAN,
* If you have set the receiver manually, you also have to
* provide it for the receiver pre-identification.

      ls_receiver           type SXI_ADDRESS.

       3.      Determine whether any assigned receivers exist; if yes, check whether the receiver determination was assigned conditions.  Call the method RECEIVER_EXIST and transfer the sender (and receiver, if necessary) of the message.

call method l_routing_runtime->receivers_exist
    EXPORTING
       SENDER    = ls_sender
       RECEIVER  = ls_receiver    “only if set manually
    IMPORTING
       ROUTING_VIA_PAYLOAD        = L_ROUTING_VIA_PAYLOAD
       RECEIVERS_EXIST            = L_RECEIVERS_EXIST.

       4.      Evaluate the return values as follows:

¡        If RECEIVERS_EXIST = SPACE, no routing rules exist in the Integration Directory for the specified sender. In this case, you do not need to evaluate the remaining parameters.

¡        If RECEIVERS_EXIST = 'X', one or more receiver determinations exist for the specified sender. Whether the corresponding receivers receive the message depends on whether there are conditions to be evaluated in addition to the receiver determination. The parameter ROUTING_VIA_PAYLOAD shows that there is a receiver determination that is based on the evaluation of the payload. If the parameter is not set, it is a receiver determination without a condition and one or more receivers have been determined.

       5.      If routing rules that are dependent on the payload still have to be evaluated, you can transfer the message payload for further evaluation by calling the method receivers_exist() a second time.

Note

You can also enter the payload in the first call.

Receiver Pre-Identification with Receiver Specification

Receiver pre-identification is normally of no interest to applications that set the receiver themselves (for a description of how receivers are set, see Routing). However, such applications can use the method RECEIVERS_EXIST if they want to establish whether routing rules exist in the Integration Directory for the sender/receiver pair. In any event, you must specify the same sender/receiver pair that you used when setting the receiver.

 

 

 

 

 

End of Content Area