Start of Content Area

Background documentation Custom Service  Locate the document in its SAP Library structure

When you model a data object, predefined flow blueprints are assigned to the data object based on the data object category you specify. These flow blueprints contain standard services that are executed in a particular sequence to process the data object. However, based on your requirements, you can add additional services to a flow blueprint in the form of custom services.

A custom service can be classified into a READ Service or a WRITE Service.

READ Service

This performs a read operation and can be added anywhere in the existing sequence of services. This service can also be added as the last service.

WRITE Service

This performs a write operation on the database tables. However, the position at which you want to add this service in the existing sequence of services depends on the standard service that immediately succeeds this service. You can add a custom service before any of the following standard services:

·        CDS_SERVICE

·        CONFIRMATION_SERVICE

·        CONFLICT_DETECTION_SERVICE

·        KEYMAP_SERVICE_AV

·        KEYMAP_SERVICE_BV

·        MSG_COMPLETION_SERVICE

·        REJECTION_SERVICE

Note

You cannot add a WRITE service as the last service in the sequence of services.

Signature of the Custom Service

The signatures of the READ and WRITE custom services are as follows:

READ Service

Type - 'READ'

    IMPORTING

      mbo_message_comm_hdr    TYPE REFTO SMMW_MSG_COMMHDR_WRAPPER

      mbo_message_body        TYPE REFTO IF_MBO_READ_WRAPPER

    CHANGING

      mbo_message_footer      TYPE REFTO SMMW_MSG_FOOTER_WRAPPER

WRITE Service

Type - 'WRITE'

    IMPORTING

      mbo_message_comm_hdr    TYPE REFTO SMMW_MSG_COMMHDR_WRAPPER

    CHANGING

      mbo_message_body        TYPE REFTO IF_MBO_READWRITE_WRAPPER

mbo_message_footer      TYPE REFTO SMMW_MSG_FOOTER_WRAPPER

The wrapper classes used in these examples are listed below:

·        SMMW_MSG_COMMHDR_WRAPPER

Provides information about the data object message header details

·        SMMW_MSG_FOOTER_WRAPPER

Provides information about the data object message footer details

·        IF_MBO_READWRITE_WRAPPER

Allows you to get the node instance and perform operations, such as set node attributes, add or delete a record, get record count, and so on.

Note

These wrapper classes are generated for all the data objects.

End of Content Area