Start of Content Area

Function documentation Routing  Locate the document in its SAP Library structure

Use

In SAP Exchange Infrastructure, you configure the message receiver or receivers centrally in the Integration Builder. Therefore, when you call a client proxy you do not need to specify the receiver. Using the routing protocol, you set the message receiver in the application program itself. This may be necessary in B2B scenarios in particular.

Integration

Using the routing protocol, you specify the sender and receiver of a message. ABAP proxy runtime then writes the values transferred by the application program to the message. If a receiver is already specified in the message header, the Integration Server routing runtime proceeds as follows:

...

       1.      If there is no routing configuration for the sender in the message, routing runtime extracts the receiver from the message header.

       2.      If the Integration Directory contains a routing configuration for the message sender, the following options exist:

¡        One of the valid receivers explicitly specifies that the receiver must be taken from the message. The message is sent to all valid receivers, including those in the message.

¡        None of the valid receivers explicitly specify that the receiver must be taken from the message. In this case, the message will only be sent to those receivers that are configured in the Integration Directory.

If there is a routing configuration in the Integration Directory, administrators must explicitly authorize those receivers that are specified in the message header.

Features

You use the following methods either before or after a client proxy call:

Methods of Protocol IF_WSPROTOCOL_ROUTING

Method

Use

GET_SENDER

Query the sender set by proxy runtime following a proxy call.

GET_SERVICE_FOR_THIS_SYSTEM

Query the service that was created for this system in the Integration Directory.

SET_RECEIVERS

Set receivers for the request message.

GET_RECEIVERS

Query the set receivers at a later date (in the case of nested method calls).

GET_PRE_ROUTING

Returns an object to execute a receiver pre-identification.

Receivers in B2B Applications

In B2B applications, receivers are identified by specifying an issuing agency (for example,  Dun & Bradstreet), an identification scheme (for example, D&B D-U-N-S number), and a name (the DUNS number itself). Since many agencies exist, a B2B communication party can on the one hand be identified by a DUNS number, and on the other, by an EAN number (International Article Numbering Association Number). Within SAP Exchange Infrastructure, a communication party contains many different identifiers. However, the content of the message header is most important when identifying the communication party at the message receiver. You can specify this information yourself in the application program.

See also:

Identifiers

Setting the Receiver

In an application program, it is possible that the receiver is already known due to the application data, or it is to be enhanced with B2B information. The example program below shows how you can set such a receiver by using the routing protocol:

 

DATA: interface TYPE REF TO co_sxidag_fsa_query,
      request TYPE sxidag_fsa_query_mt,
      response TYPE sxidag_fsa_response_mt,
      receivers TYPE sxi_addresses,
      receiver LIKE LINE OF receivers,
      routing TYPE REF TO if_wsprotocol_routing.

* create instance

CREATE OBJECT interface.

* fill request data

request-flight_seat_availability_query-flight_id-airline_id = 'LH'.

TRY.

* get routing protocol

  routing ?=  interface->get_protocol( if_wsprotocol=>routing ).

* specify receiver
* (sender will be set to sending business system automatically)

  receiver-partyagency = '016'.   " Dun & Bradstreet Corporation
  
receiver-partytype = 'DUNS'.    " Scheme from Dun & Bradstreet
  
receiver-party = '123456789'.   " DUNS-Number for Company Lufthansa

  receiver-service = 'DEMO_AIRLINE_SYSTEM'.

  APPEND receiver TO receivers.
  routing->set_receivers( receivers = receivers ).

* call client proxy

  CALL METHOD interface->execute_synchronous
    EXPORTING
       output = request
    IMPORTING
       input  = response.

  CATCH cx_ai_system_fault.

  CATCH cx_ai_application_fault.

ENDTRY.

 

 

 

 

 

 

End of Content Area