Show TOC Start of Content Area

Procedure documentation Implementing Additional Callable Objects  Locate the document in its SAP Library structure

Use

For some of the functions that you can expose as callable objects, Guided Procedures (GP) requires specific implementation to enable the objects to communicate with the framework.

These are:

·        Web Dynpro components

·        Java objects for background execution

·        Business Server Page (BSP) applications

This is an overview of the general procedure required for implementing each of the above callable object types.

Procedure

...

1. Implement the Design Time Aspects of the Callable Object

The design time part of the callable object implementation defines the object’s metadata – input, output and configuration properties, result states, and process exceptions.

In your component you must:

       1.      Create the technical description of the object.

The technical description is the placeholder for the callable object metadata. It contains the definition of the object’s parameters.

       2.      Define the input and output parameters.

You can create complex parameter structures, and define multiplicity for each node. You can also choose to enable the users to add custom parameters to the object at runtime.

       3.      Define the configuration parameters.

You define the configuration parameters as constants. You can mark a configuration parameter as optional. In addition, you can create a list of values for the users to choose from.

       4.      Define the result states for completing the object’s execution.

You define result states that cover the possible scenarios for the completion of the callable object’s execution at runtime. For example, if the purpose of the callable object is to display data that must be approved or rejected, you define a result state for the approval option and another one for the rejection option.

When the callable object is used in a process, the result states can be used to define the process flow, as a target can be defined for each state. In the example, if the object’s execution has ended with the result state Rejected, the process flow can be redirected back to the action where the user enters data. This way, he or she can change it and resubmit it for approval.

       5.      Define process exceptions.

You add process exceptions to the callable object’s definition to enable error management at runtime. When the callable object is used in a process, you can define its behavior at block level if a particular process exception occurs. For example, in a callable object that searches for a user in the UME you can use this mechanism to process an exception that occurs when the user ID does not exist.

2. Implement the Runtime Logic of the Object

The runtime part of the callable object implementation refers to its execution at runtime. To ensure its proper behavior, you must implement the following aspects:

       6.      Retrieve the input and set the output.

First, you read the input structure of the callable object. The input may be directly entered by the user, or can be retrieved from the output parameters of another object. The second scenario is implemented at process design time using parameter consolidation.

Based on the input parameters, you can implement the required business logic – search for a user, for example. Finally, you set the relevant values to the output parameters that you have defined for the object.

       7.      Complete the processing.

Once the required operations have been carried out and the output parameters are set, you must explicitly notify the GP framework that the execution of the callable object is completed, and set the relevant result state.  

       8.      Set up the exception handling mechanisms.

You implement exception handling for both process and technical exceptions. While process exceptions are predefined in the object’s technical description, technical exceptions are all other errors that might occur when the object is executed – for example, an internal server error.

3. Implement Localization

To enable the internationalization of the callable object that you implement, you must localize your translatable texts. In the Java callable objects for background execution, the localized texts are read using a resource accessor that you must implement.

For more information about the specific aspects of the callable object implementation, see:

      Implementing a Web Dynpro Callable Object

      Implementing a Callable Object for Background Execution

      Implementing a BSP Callable Object

End of Content Area