Você está na página 1de 24

Business Objects

Theory and implementation of objects in SAP

Lecture 5

Object Orientation & Object Modelling Describe a system and its requirements by:
Identifying the objects in a system Identifying their processes (or methods, functionality) Identifying relationships between objects.

Many products are now described from this view The concepts of Object Oriented Modelling are used in the Business Object view of SAP

Lecture 5

What is an Object?
A tangible or visible thing. A construct which combines data and behaviour Examples of objects: Concrete: My bicycle, Myself Conceptual: A linked list, A polygon, An Account Business: Bank Account 34267 Invoice 98097 DVD s/n9870123 Customer (Alex) Example of Objects in a banking system: An Account A Teller A Branch A Customer A Transaction A Cheque
Lecture 5 3

Important facts about objects:


Every object has an identity
In the real world the object exists In software the object is referred to as an instance

Classification
Objects with the same attributes (data structure) and operations (behaviour) can be grouped into a class. A class is an abstraction that describes properties relevant to an application. Choice of classes is arbitrary. An object is an instance of a class.

In SAP, this class is referred to as a Business Object or Object Type.


Lecture 5 4

Class Diagram Symbols


Class: An abstraction of a group of objects with the same attributes and behaviours. Class Name
Attribute1 : attribute type Attribute2 : attribute type

Account
AcctName : string AcctBalance : currency

Methods

Deposit(amount) Withdraw(amount) PrintStatement()

Object Instance : A real thing


(Class Name) (Account)

Object Name
attribute values Lecture 5

Joe Smith
$1234.00

Generalisation/Specialisation (is-a): A relationship between classes that identifies subclasses and superclasses. Subclasses can be mutually exclusive or overlap. The attributes and methods of the superclass are inherited by the subclass.
The triangle indicates a generalisation / specialisation relationship

Student
StudentID Name Address Course

Parent or Superclass

UnderGrad
Child, Subclass or Subtype
TimeFraction

Grad Student
DegreeType Supervisor Room
6

Lecture 5

Inheritance
Sharing of attributes and methods based on a class hierarchy. Subclasses inherit all properties of their superclass. In this example, what are the attributes of an UnderGrad? What methods do you think Student would have?

Student
StudentID Name Address Course

UnderGrad
TimeFraction

GradStudent
DegreeType Supervisor Room

Lecture 5

Association Relationships
The line indicates that any student record is associated with a course.

Course
CourseCode CourseTitle CourseDescrip CourseStructure
1 0+

Student
StudentID Name Address Course

Associations indicate that one commonly associates an object of one type with another object. Often with association, the associated classes are of different types of independent classes.
Lecture 5 8

Aggregation(is-a-part-of) or Composition (has-a): A special case of association. One object is composed of other objects. Each object in an association usually can not exist independently.
Order
OrderNumber OrderDate Customer
1 1+

OrderLine
PartNumber Quantity UnitPrice

The diamond indicates aggregation Note: Multiplicity can be shown as for associations
Lecture 5 9

Association Classes
Student
StudentID Name Address Course
0+ 0+

Subject
Subject Code SubjectTitle SubjectDescrip Credits

Note the many to many relationship

Subject-Enrolment
Semester Year Result

The dotted line indicates the association

Subject-Enrolment contains information relevant to a relationship between two classes


10

Lecture 5

Message Request

Sales Report
getTransData(Date) generateReport

Transaction
Amount Date Type

addTrans modifyTrans getTransData

(Note: The control object is requesting data from a persistent object)

Instance Relationship: Indicates an object belongs to a class Person


John Smith
Name Address Phone

Lecture 5

11

Class Diagram
Branch Name Address Manager ChangeManager EditBranch
1

Works-at
1+ 1+

Teller Name Classification ChangeManager EditTeller


1

is-held-at
1+

is-made-at
1+

is-applied-by
1+

Customer Name Address Manager EditCustomer

owns
1 1+

Account Balance InterestDate EditAccount

is-applied-to
1

0+

Transaction Amount Time Date CreateTrans EditTrans

Account-Type Cheque Account Name Address Manager ChangeManager EditBranch Standard Savings Min Balance OverDraft ApplyOverdraft
Lecture 5

Loan Payment PaymentPeriod PaymentDate ApplyOverdraft

Example of Classes in a banking system: Account Teller Branch Customer Transaction 12

Business Objects in SAP


ALL Business Objects have: Attributes
A characteristic or property of an object

Methods
An operation that can be executed on the component These hold the functionality of SAP

Interfaces
Ensure consistency in the system and allow generic programming (The same name is used for the same action eg: IFEDIT).

Events
Status change of an Object that is published throughout the system.
Lecture 5 13

The Business Object Repository


Contains the definition of all Business Objects in SAP The Business Object Repository Browser is used to find object definitions for use in workflows. Transaction Code SWO1 then select Business object repository.

Lecture 5

14

An example of a specific objects definition. (SAGENCY) Available through SWO1 This screen also provides access to tools that allow the object to be extended or tested.

Lecture 5

15

This screen is the first screen one sees when testing an object type. To run a test you need to create an instance of the type. Select the instance tab, then use the search screens to find an agency.

Lecture 5

16

Here is a object of the type SAGENCY. Note the attributes now have values and the methods can be executed to see what they do.

Lecture 5

17

The edit method for SAGENCY on the object Alis Bazar.

Lecture 5

18

An SAP Object Model

Lecture 5

19

SAP Entity (Customer Billing Document Item)

Lecture 5

20

S
Ledger
12 52 7 L edg er figure version

t rp ri

L edg er

e cial

se ledger

e c ia l le d g e r

se

e c ia l r se le d g e r - c m p a n y c d e-re la te d

12560 C V A vera g e a la n c e s p e cia l p u rp os e le d g e r

i ed asset ledger
13062 Fi e d a s s e t le d g e r

A ccounts receivable ledger


12109 A c c ou n ts re c e iva b le le d g e r

A ccounts payable ledger


12108 A c c ou n ts p a ya ble le d g e r

This is provided to as an example of a BOM used in SAP. Use zoom in Power Point to view the detail.

Consolidation ledger
12523 C o n s o lid a tio n led g e r 12524 C o n s o lid a tio n le d g e r c o n s olid a tio n u n it-re la te d 12529 C o n s o lid a tio n le d g e r - c om p a n y c o d e-re la te d

Reconciliation ledger
14012 R e c o n cilia tio n le d g e r

e neral ledger
12107 V G e n e ra l le d g e r

Lecture 5

12525 C V S p e c ia l p u rp os e le d g e r - c om p a n yre la te d

12553 C V C o m p a n y s p e cia l p u rp o s e le d ge r

24 ' ' ( '&1

BA

Business Object Model

e c ia l r se le d g e r tra n s a c ti n t e - a s s ig nm e n t

2 342 0 4 28 4 2 32 0 4

2 7 6 ( '&1

2 32 2  0 4 ) ( ( '&1

%# $ #

   

SAP

14 16 5 C ontrolling trans ac tion led g er

tr lli g rea - c tr lli g led g er

!      

#" D

12531 C V Com pany code s p e cia l p u rp os e le d g e r

12535 C V Com pany code s p e c . p u rp os e le d g e r tra n s a c t. typ e 12534 C V Com pany spec. p u rp o s e le d ge r tra n s a c tio n typ e - a s s ig nm e n t

r ofit center ledger


14025 P ro fit c e n te r le d g e r

21

SA -ERM: No distinction is made between entity types and relationship types. Dependencies are laid out from left to right. Arrow notation is used to show links and cardinality.
1:1 (exactly one to one) 1:cm (Any number of dependants) 1:m (at least one dependant) 1:c (a maximum of one dependant)
Lecture 5 22

SA -ERM: Generalisation / Specialization uses the triangle: Business objects are used to give a high level view of data (and other) objects. Four types of relationship:
Hierarchy - a unilateral existential dependency between information objects Reference - a dependency between a reinterpreted entity and a primary entity. Aggregation - relationship types based on the classical ER model. Specialization - As for the classical ER model.
Lecture 5 23

Ledger

Controlling ledger

Controlling area controlling ledger

Special purpose ledger

Special purpose ledger transaction type assignment

Special purpose ledger company code related Special purpose ledger company related

Company code special purpose ledger Company code special purpose ledger Ledger

Average balance special purpose ledger Lecture 5 24

Você também pode gostar