Show TOC

Function documentation The Factory Class Locate the document in its SAP Library structure

Use

Assume that you want to append an attachment to your message. The Proxy Framework must take this into account when constructing the message. However, if you want to identify the receiver of a message in advance, you can only find this information if you execute logical routing for the maintained data. You must direct any queries to the respective components shortly before the message is sent.

Proxy Framework provides you with the factory class CL_AI_FACTORY, which you can use to generate objects that enable you to use the special services of the Proxy Framework.

Note

You do not need a factory class to process default and initial values.

Prerequisites

To be able to use the factory class, you must first load its class definition:

class cl_ai_factory definition load.

Features

Using the factory class, you can generate the following objects:

Object

Use

Controller Object
(implements the interface
IF_AI_POSTING_CONTROLLER)

 

Using this object, you can do the following: Set the receiver; Call the payload (after a message is sent or received); Append attachments to the message or remove them when the message is received ; guarantee the sequence of asynchronous messages. You can transfer the controller object to your outbound proxy using the parameter CONTROLLER, or access it in the inbound proxy, using the same parameter.

Caution

This parameter is not visible on the tab page Structure; call transaction SPROXY to access the parameter. To see the exact signature of the outbound method and the parameter CONTROLLER, navigate in the Class Builder ( SE24).

Routing API
(implements the interface
IF_ROUTING_LOCAL_RUNTIME)

You require this API to identify the logical receiver in advance during logical routing.

Attachment Object
(implements the interface
IF_AI_ATTACHMENT)

An attachment object that you can append to the message using a controller object.

'Preliminary Payload'

Return of a payload after a simulated proxy call so that you can access the payload before a message is sent. See: Calling the Payload.

Activities

Creating a Controller Object

data: l_controler type ref to if_ai_posting_controller.

l_controller = cl_ai_factory=>create_controller( ).

Creating a Routing API

data: l_routing_runtime type ref to IF_ROUTING_LOCAL_RUNTIME.

l_routing_runtime = cl_ai_factory=>create_routing_runtime( ).

Creating an Attachment Object

To generate an attachment object, use the method create_attachment_from_binary() of the factory class. (See:  Appending Attachments at the Sender.

Creating the Payload Before Sending

To create the payload of a message, use the method create_parameter2xml()of the factory class. (See:  Creating a Payload.

 

 

 

 

 

Leaving content frame