Step 1: Identifying and Enhancing Object Types

A Workflow management system is usually used when objects in the system are to be routed and processed in several steps and when this processing is to be actively traced until its completion. To facilitate these operations, it must be possible for the user to assign names to objects, to access objects directly, to evaluate object characteristics and to react to object events.

An object-oriented design has therefore been implemented in SAP Business Workflow, which highlights the objects and their descriptions at the level of the object type definition.

A complete list of all object types which have already been defined is to be found in the Business Object Repository. It contains a description of the elements of each object type. This information is available in the system for search and reference purposes.

At this stage, it is important to identify the object types which are required in this scenario.

Prerequisites

You have already familiarized yourself with the process flow of the scenario and discovered the application functionality that can be used.

You have realized that in the scenario used as an example in this tutorial, an actual object with the object type Material is observed and processed:

·        Changing one field in the master data of this object leads to the initialization of the subsequent processing steps.

·        One example of such a step is the 'display' of the object.

Further step are possible but they must always be directly related to the material.

In addition, you know that an object with type Lab./office for material is involved. Information from the environment of this object is required when searching for the agent responsible.

The two object types Material and Laboratory/Office for Material are shipped with the SAP Business Object Repository.

Procedure

Object type BUS1001 (material)

Follow the instructions below to familiarize yourself with object type BUS1001:

...

       1.      Now branch to the Workflow area menu SAP Business Workflow (Development) (Transaction SWLD, Menu: Tools ® Business Workflow ® Development)

The area menu SAP Business Workflow (Development) is the starting point for all activities that you will perform in the course of this tutorial.

       2.      Select Definition tools ® Business Object Builder.

You are now in the Business Object Builder: Initial Screen.

       3.      In the field Object type, enter:

BUS1001.

       4.      Choose Display.

You go to the screen Display Object Type BUS1001.

Familiarize yourself with the object type definition.

The plus sign in the folder symbol in front of one of the entries Key fields, Attributes, Methods or Events  shows that these elements are available and defined for the object type definition.

Double-click in each case on the folder symbol to display an overview of the available elements!

Key Fields

The key field of object type BUS1001 is called Material (Material number) and refers to the table field MARA-MATNR. This key field uniquely identifies an object of type BUS1001 and enables read-only access to its attributes.

You can display this detailed information about the key field by double-clicking on the entry Material.Material (white background).

Attributes

As standard, a series of attributes are defined for object type BUS1001.

One of the attributes defined for this object type is called Laboratory (laboratory/design office). This attribute returns the object reference to the design office declared in the material master data. The source of this information is the table field MARA-LABOR.

Take note of the detailed information about the definition of the attribute Laboratory, which is displayed when you double-click on the entry Material.Laboratory (white background).

·        Source database field:

This information is derived from the database field MARA-LABOR. A value is assigned to this field within master data maintenance.

·        Data type reference - Object type:

It is not simply the content of this table field that is returned in the attribute. Instead, the table content is “formatted” so that a reference to an object of type T024L (lab. for material) is returned in this attribute, which can then be used to access the attributes of object type T024L.

Methods

An example of a method that is defined for this object type is the method Display (Display), that is used in the scenario.

Object type T024L (laboratory/office for material).

In the R/3 Business Object Repository under the application component Logistics - General, in the area Organizational object types logistics, you will find an object type with the identifying name T024L and the description Laboratory/office for material.

...

       1.      Go to the Business Object Builder.

       2.      In the field Object type, enter:

T024L.

       3.      Choose Display.

You are then on the screen Display object type T024L.

Familiarize yourself with the object type definition.

Familiarize yourself with the object type definition. The plus sign in the small folder to the left of some of the entries signifies that the corresponding elements are present in the object type definition.

Double-click in each case on the folder symbol to display an overview of the available elements!

Key field

The key field of object type T024L is entitled Laboratory and refers to table field T024L-LABOR. This key field uniquely identifies an object of type T024L.

Enhancements to object type BUS1001

As delivered by SAP, the definition of object type BUS1001 is incomplete for the purposes of this tutorial and enhancements must therefore be made.

These enhancements concern two elements of the object type:

·        Events

In one of the following chapters, you will learn how changes to the material master data are broadcast to the entire system using an event.

All events which are to be used must be defined as elements in 'their' object types. It is therefore necessary to define an appropriate event for the object type.

·        Attributes

The name of the last person to change the material master data should be given as an attribute. This attribute has to be added because it is not present in the standard delivery version of the object type.

Create Subtype for Available Object Type

Due to the fact that no changes may be made to object type BUS1001 after delivery from SAP, a customer-specific object type must be created as a subtype to the original object type. This subtype inherits all the attributes and methods of its supertype.

To create a subtype, follow these steps:

...

       1.      Go back to the screen Business Object Builder: Initial Screen and, in the Object type field, enter

BUS1001.

Choose Object type ® Inheritance ® Create subtype. The dialog box Create object type appears.

       2.      Create the new object type with the name ZXX_MARA and give it an ID, name and description of your choice.

Also specify ZXX_MARA as the name of the program that will include the additional or modified implementation of the object type, and Z as the code letter of the application.

       3.      Save your entries.

You are now on the input screen Change object type ZXX_MARA where you can maintain your new object type.

Make sure that the new object type has inherited all the attributes and methods of its supertype (BUS1001). You can recognize inherited elements in that they are green.

Creating an Event

A status change to the material master in the field Basic material is to be reported by the event WrkstChanged.

This event can only be generated if it is defined for the object type. This is not yet the case.

...

       1.      To create a new event, position the cursor on the entry Events (blue background) on the initial screen of object type maintenance (Change object type ZXX_MARA), and choose Edit ® Create.

       2.      As event, enter:

WrkstChanged.

Describe the meaning of the event as clearly as possible using the Name and short description.

       3.      Choose Continue.

       4.      Position the cursor on “your" event and choose Edit ® Change release status ® Object component ® To implemented.

Until now, within the object type definition, you have only described the fact that the event WrkstChanged is intended for use with object type ZXX_MARA. You must ensure that the event is actually created. This is described in one of the following chapters.

Adding attributes

The explanatory long text for the single-step task which should notify the appropriate employee can include the name of the last person who changed the material.

If this is to be the case, a ChangedBy attribute must be added to the object type.

...

       1.      To create a new attribute, position the cursor on the entry Attributes (blue background) on the initial screen of object type maintenance (Change object type ZXX_MARA), and choose Edit ® Create.

       2.      Answer “yes” to the question “Create with ABAP Dictionary field proposals?”

       3.      As table, enter:

MARA and confirm with Continue.

       4.      Select the field AENAM and confirm with Continue.

       5.      Confirm the proposed texts for the attribute ID, its name and its description with Create.

       6.      Position the cursor on “your" attribute and choose Edit ® Change release status ® Object component ® To implemented.

       7.      Select Back.

Implementing and generating an object type

You are on the screen Business Object Builder: Initial Screen.

...

       1.      Choose Object type ® Change status to ® Implemented.

       2.      Then choose Object type ® Generate.

Delegation

To enable you to work through this tutorial several times with different users together in the same system, it has been designed so that you can continue working now with the object type ZXX_MARA, which you have just created as a subtype of the object type BUS1001. This procedure is particularly appropriate for training situations.

For extensions to object types and their use in productive workflow scenarios, SAP recommends a slightly modified procedure, which uses the functionality of delegation in the Business Object Repository.

For further information, please refer to Extending and Adapting Object Types. However, please note that this tutorial does not use the functionality described there.

Result

In this chapter you have learnt how to use the Business Object Repository and looked at object types BUS1001 and T024L in detail. You have created a subtype ZXX_MARA for object type BUS1001 and enhanced the subtype by adding an attribute and an event.