Show TOC Start of Content Area

Procedure documentation Modeling Service Operations  Locate the document in its SAP Library structure

Use

When you create application services and business objects, you can modify their operations.

Improving interfaces of custom find operations in CAF business objects

CAF generates input parameter of type QueryFilter for every parameter in the custom find operation. This type contains elements with xsd:anySimpleType. The type is mapped to the Object type in Java. The clients of such interface may be confused of this Object/xsd:anySimpletype field in the input of the operations. On the other hand, this operation may not be working when it is called from Web Service Navigator, Web Dynpro or Visual Composer. To create find operations with concrete types in the input you can manually implement operations in CAF (in the same business object or in separate application service or EJB) with parameters that are defined with concrete types. In the implementation of this operation you can call the original find operation passing the type concrete type received as input.

Prerequisites

You have created an application service or business object.

More information:

      Creating Application Services

      Creating Business Objects

Procedure

Modeling Application Service Operations

...

       1.      In the Composite Application Explorer, choose with the secondary mouse button the service to which you want to add an operation and from the context menu choose Edit.

       2.      To see a list of the existing operations, open the Operations tab page.

Note

For new application services, the operations list is empty.

       3.      To add a new operation:

                            a.      Choose Add.

A New Operation wizard opens. You can choose between Custom operation and BW Extractor operation.

                            b.      Define the operation details:

Field or Property

Description

Name

Name of the operation

Description

Description of the operation

Transaction Type

Choose the Java EE transaction type.

More information: Setting Transaction Attributes.

Permission Check

If enabled, the operation requires permission to be executed.

If disabled, the operation can be executed by anyone.

More information: Protecting Access to Application Service Operations

Implemented

If enabled, you should write a source code implementation for the operation.

If disabled, you are allowed to create mapping for the operation.

Modeling Business Object Operations

...

       1.      In the Composite Application Explorer, choose with the secondary mouse button the service to which you want to add an operation and from the context menu choose Edit.

       2.      To see a list of the existing operations, open the Operations tab page.

Note

For new business objects, the operation list contains the default CRUD operations. You cannot modify the default operations.

       3.      To add a new operation:

Note

You can create only query operations. Query operations return a collection of instances of the business object based on some query filters over the attribute values of the business object structure.

                            a.      Choose Add.

                            b.      Define query filters for the operation:

Field or Property

Description

Name

Name of the operation

Description

Description of the operation

Parameters

Navigate to and select attributes for the input parameters of the operation. You can enable the following checkboxes:

      Select – to include the attribute in the query filters of the operation

      Multiple – to allow multiple filter values of the attribute

Note

To modify the business objects operation, you can change the Select and Multiple checkboxes in the operation input described in the previous step.     

Result

You can modify the application service operation attributes.

To add an attribute or fault message, do the following:

...

       1.      Select the item from the left structure.

       2.      You can use the following buttons:

    Add to Input – to add the selected attribute as an input parameter.

    Add to Output – to add the selected attribute as an output parameter.

    Add to Fault – to add the selected fault message as an operation exception.

To remove an added attribute or fault message, select it from the right structure and choose Remove.

You can do the following with the service operations you have modeled:

      To edit your operation properties, change the relevant values in the Properties tab page.

You can also edit some of the properties using the list of existing operations.

      To map a not implemented operation to an external one, use the Datasource tab page.

      To write a custom implementation code, use the Implementation tab page.

      To remove an operation, select it and choose Delete.

End of Content Area