Business Objects hide their internal structure via several layers. A business object is described by the following elements: Object ID Unique identifier Key field Number Object name Unique semantic designation Components Differentiated internal structure elements of the object Relationship type: “is part of” Subtypes Specialization of an object Relationship type: “is a” Attribute entered by, entry date, approved by, etc. Methods Implementation of the methods applicable to the object Events Events that generate the object in dependence upon its object status
The BOR is a complete development and runtime environment able to handle the following object types: Business objects: Business objects include objects such as &quot;Customer&quot;, &quot;Material&quot;, and &quot;CompanyCode&quot;. They provide both a high-level business-oriented view of, and a programming interface to, the R/3 System. Technical objects: Technical objects include texts, notes, work items and archived documents, as well as desktop objects like texts, graphics and spreadsheets. These desktop objects can be described in condensed form in the BOR. Meta objects: Meta objects document object types, methods, attributes and events. Each object has an attribute &quot;ObjectType&quot; which refers to the metaobject to which it is assigned. The methods, attributes and events available for a particular object can be retrieved from its &quot;ObjectType&quot;. Business Objects are modeled, abstracted in the Business Object Builder and stored in the Business Object Repository.
In SAP terminology, object classes are described as object types and a single business object is described as an instance. Object types (classes) describe an abstract business object, the data that belongs to it, methods, etc. Object types can be inherited. Inherited objects types contain all the methods and data fields of the parent including additional, specific data and methods. This allows polymorphism, which combines the same attributes from various, specialized objects. Polymorphism can also be used by implementing defined interfaces (attributes and methods) from objects. In this example, recreational and business planes are specific instances of a passenger plane. They are polymorphs relating to the object type class ‘Passenger plane.’ Multiple inheritance is not presently directly supported by the SAP business objects. An object can implement several interfaces. Instances of business objects contain actual data, for example, a customer order. There can be any number of instances of an object type.
In order to work with a business object, an instance must first be created that corresponds to the object type. For this purpose, the necessary metadata are retrieved from the Business Object Repository (BOR) and a runtime object is created. When creating an instance, there are two types of objects: persistent and non-persistent Persistent objects contain data from the R/3 database tables. The data also exists after destroying the runtime object. Persistent objects are uniquely identified by their key fields. Non-persistent objects are not linked to concrete database entries. For example, they are used to display data (list of all persistent business objects for a type), or to create new persistent business objects.
SAP Business Workflow represents the concept and implementation of an object-oriented approach. Objects are concrete, identifiable specific instances of an object type e.g. Object type notification of absence (FORMABSENC) Key field : number Attribute : entered by, entry date, approved by, etc. Methods : create, approve, edit, delete
The workflow architecture is based on Object Types. Special Object Type Attributes point to the fields in the ABAP Dictionary for all business data. Object Type Methods are encapsulation of behavior for performing tasks in processes. Implementation of objects can be changed without workflow definitions or organizational structures having to be modified Object Type Events can have a triggering or terminating effect on tasks or workflows.
New Business Object Type can be created. The following process describes the activities you have to accomplish at this level in order to support the Material Master Workflow exercise of this class. First : Check the functionality of the Business Object Type delivered by SAP. Make sure the display method is supporting your requirements. Otherwise you would have to build a new method for your sub-type. Second : You can create your own sub-type for this Business Object Type. In this case ZBUS1001 was created. Third : Check the attributes of this sub-type. You might have to create a new attribute for your sub-type. This attribute will establish the connection to another business object type, in this case T024L. Fourth : Create a new event for this sub-type.
Object methods: processing objects in a workflow Object attributes: controlling workflow process, formulating conditions in workflow definition; evaluation of runtime Implementation: implementation of method calls and attribute accesses are encapsulated in the program of the object type. Not visible to the caller. All objects have own interfaces for calling methods and/or reading attributes. Event: description of a change in status of an object Events must be “published” via appropriate mechanisms. Application and program knowledge are required for dealing with objects.
You can use DELEGATION to enhance the functionality of the SAP object types. Subtypes will give you the opportunity for: additional attributes additional methods additional events Each object type and all components have one of the four status assigned: modeled: there is no program for this yet. implemented: program is started but not officially finished yet. released: program can be executed by everyone. obsolete: do not use this anymore. Do not change anything in an SAP provided object type, unless the change procedure is described in an SAPNet / OSS note.
Without delegation, you would have to use two different business object types in your workflow. Mixing these two business object types will result in a container binding error at definition time or at runtime. Dataflow binding example of something, which does not work: Task Container Workflow Container WI_Object (ZBUS1001) BUS1001 Dataflow binding Example after delegation: The second task has to be based on the new method ‘Report1' of BUS1001 Task Container Workflow Container WI_Object (BUS1001) BUS1001
Default method: A default method is selected if no further specifications are made when an object of this object type is accessed. Example: Executing an object by double clicking from a display list. For your own object types you can select a default method.
The properties of an object can be described as object attributes. Attributes are used in workflow definition in the formulation of conditions and can therefore also be used for controlling workflows. Data type reference options in attributes : ABAP Dictionary field Definition: reference to database field Runtime: attribute value corresponds to content of table field Object type Definition: reference to object type Runtime: attribute value corresponds to object reference to an object of this type
Method : allowed function on an object Methods encapsulate the familiar and comprehensive functionality of the R/3 System and hence make it available for the workflow system. Information about the implementation used is deposited in the object type definition and is no longer required on the user interface and/or control level. The object methods refer to available ABAP functions (transactions, function modules, dialog modules, etc). Synchronous methods can have a specified result (optional) The possible values of the result can be deposited in a check table. The possible values of this result are hence known in the definition of a workflow as terminating events of that task, which will use this method.
Synchronous and asynchronous methods differ in calling and confirmation. Asynchronous methods : only import parameters Synchronous methods : import and export parameters
Published event: system-wide message about change in status of an object Example: customer order created invoice posted Events should only be used in conjunction with an object type.
The object type SELFITEM provides the functionality to send mail from within the workflow. Check the workflow tutorial for explanation. Use the workflow wizard to insert such a procedure into your workflow. The object type SOFM is more for SAP experts, who want to program functionality around the SAP office folders and documents. The object type STD_TEXT can be used to integrate SAP script text into a mail send out by workflow. (Although the SELFITEM approach is easier.) Use the object type TSTC to execute a transaction in a workflow step. Use the object type TRDIR to execute a report in a workflow step.
08 01 businessobjectsbuilder
Business Objects & Builder <ul><li>Contents: </li></ul><ul><li>Terminology </li></ul><ul><li>Enhancing an object type </li></ul>
Business Objects & Builder: Objectives <ul><li>At the conclusion of this section, you will be able to: </li></ul><ul><li>Define components of a business object type </li></ul><ul><li>Examine and extend a business object type </li></ul><ul><li>Identify purpose of delegation of object type behavior </li></ul>
Business Objects & Builder: Business Scenario <ul><li>During the first workflow design activities, you discovered that SAP ‘standard tasks’ does not support all required functional steps </li></ul><ul><li>To build your own task, you will learn more about the basic components of a task </li></ul><ul><li>In SAP Business Workflow an “Object Type” is the base for all single step tasks </li></ul><ul><li>Explore and extend the material master business object type BUS1001 </li></ul>
Business Object Type Business Object Kernel Internal Structure Specialization Interface Access via: Integrity Representative "is part of" "is a" Consistency requirements (object- related) Business rules (environment- related) Events Attributes ABAP (RFC) COM/DCOM CORBA BAPIs, Methods
Business Object Repository (BOR) Business Workflow ArchiveLink BAPI Modeling BAPI BAPI BO BAPI BO BAPI BAPI BO BO BO BO BO BO BO BO BOR
Object type and Instance Passenger plane Aircraft Specialization Instancing D4711 Pilots: 1 Passengers: 3 Class = Object type Single object = Instance Object AA Hollywood Pilots: 2 Freight: 30.000 kg BA Big Ben Pilots: 2 Passengers: 5 Freight: 200 kg Cargo plane Recreational plane Business plane Class LH Munich Pilots: 2 Passengers: 3 Freight: 80 kg R
Object Types and Runtime Objects Object type Runtime object Persistency Instance BOR R/3 Database tables
Examples of Object Types <ul><li>SAP Object types </li></ul><ul><ul><li>Invoice (BSEG_MMIV) </li></ul></ul><ul><ul><li>Sales Order (BUS2032) </li></ul></ul><ul><ul><li>Delivery note (LIKP) </li></ul></ul><ul><ul><li>Material (BUS1001) </li></ul></ul><ul><ul><li>Bill of material (BUS1002) </li></ul></ul><ul><li>External documents </li></ul><ul><ul><li>Archived documents (TOAV0) </li></ul></ul><ul><ul><li>Purchase order Idoc (IDOCORDERS) </li></ul></ul>
Objects in Workflow Multi step task Workflow definition Task SAP functionality Method Attribute Object type External applications Workflow Work item Execution of an object method Event Workflow manager Work item manager terminating event triggering event Object type ABAP Dictionary Database
New Business Object Type Material: My_part Old Material: Original_part New_part Lab: PM1 Change documents Event ZBUS1001. Old_Material_changed Task Display Material Business Object Type: ZBUS1001 Key: MARA-MATNR Attribute: Laboratory Method: Display Event: Old_Material_changed Business Object Type: T024L Database
Object Type: Elements Object type key fields function module report ABAP coding transaction field reference object reference Export/import parameter result attributes methods events Program
Object Type: Definition of a Subtype ZBUS1001 My_Material BUS1001 Material Supertype Subtype key fields attributes methods events key fields attributes methods events Materialno MaterialType MaterialGroup Division OldMaterial Display Create OrderUnit BasicMaterial Report1 changed Created MaterialGroup Materialno MaterialType Division OldMaterial Edit Create Display Created Edit
Delegation Without Delegation With Delegation between BUS1001 and ZBUS1001 No communication since Workflow system finds two business object types Communication within Workflow possible between those two tasks TASK based on ZBUS1001. Report1 TASK based on BUS1001. Report1 BUS1001 created BUS1001 created
Object Type Definition Key fields: <ul><ul><li>General: relationships to supertype, release, generation </li></ul></ul><ul><ul><li>Change and transport data </li></ul></ul><ul><ul><li>Defaults: for methods and attributes </li></ul></ul><ul><ul><li>Customizing: display persons responsible/delegation </li></ul></ul>Basic Data: <ul><li>Identification of an object </li></ul><ul><li>Data type reference </li></ul><ul><ul><li>Dictionary field: only character based data types, up to 70 characters total </li></ul></ul>Object
Object Type Definition: Attributes <ul><li>Property of an object </li></ul><ul><li>Source of information </li></ul><ul><ul><li>Database field </li></ul></ul><ul><ul><li>Virtual </li></ul></ul><ul><li>Data type reference </li></ul><ul><ul><li>ABAP Dictionary field </li></ul></ul><ul><ul><li>Object type </li></ul></ul><ul><li>Multi-line attributes are possible </li></ul>Object
Object Type Definition: Methods <ul><li>Allowed function on an object </li></ul><ul><li>Properties: </li></ul><ul><ul><li>Dialog: yes - “Change material” no: “Delete request” </li></ul></ul><ul><ul><li>Synchronous: yes - “Execute report” no: “Create material” </li></ul></ul><ul><ul><li>Reference to SAP functionality </li></ul></ul><ul><ul><li>Synchronous have a specified result (e.g., request rejected/approved) </li></ul></ul><ul><ul><li>Exceptions for error handling </li></ul></ul><ul><ul><li>Use method parameters </li></ul></ul>Object
Synchronous and Asynchronous Methods <ul><li>Tasks can have terminating events </li></ul><ul><li>Synchronous method </li></ul><ul><ul><li>Method is called, assumes process control and confirms to caller after processing </li></ul></ul><ul><ul><li>Optional: import parameter </li></ul></ul><ul><ul><li>Optional: result, export parameter, exceptions </li></ul></ul><ul><li>Asynchronous method </li></ul><ul><ul><li>Method is called, runs without connection to caller and does not confirm after processing </li></ul></ul><ul><ul><li>Optional: import parameter </li></ul></ul>asynchronous object method synchronous object method task terminating event terminating event task
Object Type Definition: Event Object System-wide message about change in object status Events are only defined in the object type The SAP application must raise the event, not the object type Event parameters transfer information from event creator to event receiver
Specific Object Types SELFITEM SOFM STD_TEXT Sending SAP Mail Send task description Office document Send SAPoffice document SAP Script standard text Replace text symbols and display text Method Examples : HELP TSTC Call extended help Display help object Transaction Execute transaction TRDIR ABAP program Execute program
Business Object : Summary <ul><li>Workflow architecture is based on object types </li></ul><ul><li>Object type: Key fields, attributes, methods, events </li></ul><ul><li>Business Object Repository (BOR): Collection of SAP and own object (sub)types </li></ul>
SAP Workflow Course PwC Consulting TM refers to the management consulting services businesses of the member firms of the worldwide PricewaterhouseCoopers organisation. 2001 PricewaterhouseCoopers. All rights reserved.