overview bol framework
TRANSCRIPT
-
8/12/2019 Overview BOL Framework
1/54
-
8/12/2019 Overview BOL Framework
2/54
SAP AG 2002, Business Object Layer, 2
Contents
Introduction
Business Object LayerRuntime
Authorizations
Business Object LayerDesign Time
Mobile Client Application Development
Looking Ahead
-
8/12/2019 Overview BOL Framework
3/54
SAP AG 2002, Business Object Layer, 3
Demand for Mobile Business Solutions
The demand for mobile business solutions increased the
number of mobileonlineandofflineapplications.
EXAMPLE
The mySAP CRM Mobile Sales Client, which was
designed as a flexible complement to R/3, requires a
laptop solution that meets the following criteria:
Thin Easy to maintain Easy to integrate into other PC tools and
applications
-
8/12/2019 Overview BOL Framework
4/54
SAP AG 2002, Business Object Layer, 4
mySAP Mobile Solutions Offer
Quick
identification of
most important
information
Overview and easy
access to details
Backwardand
Forwardfor fast
navigation
Hyperlinks to
related
information
Example: mySAP CRM Mobile Sales
-
8/12/2019 Overview BOL Framework
5/54
SAP AG 2002, Business Object Layer, 5
Mobile Client Application Architecture
Multi Tier Paradigm
Provides a truly scalableand
robust solution that supports
distributed computing over the
Internet.
The application structure mustinclude several independent layers
that communicate with each other
through well-defined interfaces.
Separate Layers make it possible
to provide different types of MobileClients(from Fat to Thin) by
moving the application layers
between the Client and Server
platforms.
-
8/12/2019 Overview BOL Framework
6/54
SAP AG 2002, Business Object Layer, 6
Mobile Client Application Architecture
The Mobile Client Application is based on an object oriented software development
approach. The application is split into three tiersUIL, BOL and BDL
User Interface Layer (UIL)
This layer interprets data for the user.
Business Object Layer (BOL)
This layer validates user input, business
rules, and other standard operations such
as Save, Delete, Revert, and so on. This
layer provides data to the UIL.
BDoc Layer (BDL)
This layer provides an abstraction over
the underlying database and provides the
required object oriented wrapper over
relational data.
-
8/12/2019 Overview BOL Framework
7/54 SAP AG 2002, Business Object Layer, 8
Business Object LayerProminent Features
BOL
UIL
Business Object Layer
User Interface Layer
Interaction Layer
BDoc Layer
BDL
UDB
The Business Object Layer is the central place
where Business Logic is stored and validationof user data against the Business Logic is
performed.
The Business Object Layer has been
designed in such a way that Business Logic
could be written independently of the
persistency layer (BDL).
The Business Object Layer has been designed
to be independent of the presentation of the
data (independent of the UIL).
The Business Object Layer is generic enoughto provide for Customization of the Business
Objects to meet specific Business
Requirements.
-
8/12/2019 Overview BOL Framework
8/54 SAP AG 2002, Business Object Layer, 9
Business Object Layer
FactsCOM/DCOM interface
Business logic via VBA
Benefits
Component based
Standard automation interface
Scalable for all MS Windowsplatforms
Flexible customization
Extendability of Business ObjectModel
BOL
UIL
Business Object Layer
User Interface Layer
Interaction Layer
BDoc Layer
BDL
UDB
-
8/12/2019 Overview BOL Framework
9/54 SAP AG 2002, Business Object Layer, 11
Contents
Introduction
Business Object LayerRuntime
Authorizations
Business Object LayerDesign Time
Mobile Client Application Development
Looking Ahead
-
8/12/2019 Overview BOL Framework
10/54 SAP AG 2002, Business Object Layer, 13
Mobile Client Application
Development
Mobile ApplicationRepository
DevelopmentEnvironment
Application
Developer
R
Mobile Client Application Development (1)
Designing the Mobile Client Application
with the Mobile Application Studio
one tool integrates all development
tasks
rapid application development
based on MCA metamodel
stores metadata of application
framework ina repository
1Repository based
application
development
-
8/12/2019 Overview BOL Framework
11/54 SAP AG 2002, Business Object Layer, 14
DevelopmentEnvironment
Application
Developer
R
Mobile Client Application
Development
Mobile ApplicationRepository
Mobile Client Application Development (2)
Declarative programmingenables multiple client
solution deployment
Generators for multiple
solution targets
R
Smart Client
RuntimeComponents Single-
User
RSmart ClientApplicationGenerator
Application
Deployer
Multi-userApplication Server
RuntimeComponents
Single-User
R
Thin ClientR
Thin ClientApplicationGenerator
Generating the RuntimeComponents
automated
template-based
based on specific versionof development objects inrepository
2
additionalruntime
scenario
RuntimeComponents
add-ongenerator
2a
2b
2c
-
8/12/2019 Overview BOL Framework
12/54 SAP AG 2002, Business Object Layer, 15
Design Time
Design Time and Runtime
Mobile Application Studio
Front EndSet of visual modeling tools,
e.g. for screen elementsand business objects
Application
Repository
Interface
Generator
Mobile
Application
Repository
Screen Elements Business Objects
Runtime
HTML,
VBA DLLs,
Control Files,
metafiles
(arsrep.dat,
msginfo.dat)
Mobile Client Application
User Interface Layer
Business Object Layer
BDoc Layer
UDB
CRM Server
Middleware
CDB
Other
Systems
Synchronizat ion
-
8/12/2019 Overview BOL Framework
13/54 SAP AG 2002, Business Object Layer, 16
Generation using Mobile Application Studio
Generation
MARRT GeneratorGenerates meta information about the modeling components
VBA GeneratorGenerates customized code into VBA Class modules
-
8/12/2019 Overview BOL Framework
14/54 SAP AG 2002, Business Object Layer, 17
Contents
Introduction
Business Object LayerRuntime
Authorizations
Business Object LayerDesign Time
Mobile Client Application Development
Looking Ahead
-
8/12/2019 Overview BOL Framework
15/54 SAP AG 2002, Business Object Layer, 18
Business Scenario: Business Logic Objects
Customer No.Name
BusinessPartner
NameStreet
House No.CityZip Code
Address
Order No.Order DateHeadwordNet valueCurrency
Order
Item No.Quantity
DescriptionCurrencyNet value
OrderItem
Material No.Material Grp.Material Type
Product
1
*
owner
addresses
1
*owner
orders
1
*
order
items
1
*
product
order items
0..1
1
default address
owner
Business Objects Properties of Business Objects Business Object Relations
Reject if NetValue < $1,000,000 !
Business Rule
Examples
-
8/12/2019 Overview BOL Framework
16/54 SAP AG 2002, Business Object Layer, 19
Business Object Layer: Object Model
BusinessRootObjectBusinessObject
BusinessQuery
BusinessCollection
ComboEngine
ListEngine
Attributes
AttributeBusinessFactory
UserDataDictionary
MSAErrorInfoErrors
Legend
Framework Collection
Framework ObjectModeling Components
in Mobile Application Studio
Business Rules could be associated to both BusinessObject and Attribute
-
8/12/2019 Overview BOL Framework
17/54 SAP AG 2002, Business Object Layer, 20
Design Time
Modeling Using Mobile Application Studio
Mobile Application Studio
Front EndSet of visual modeling tools,
e.g. for screen elementsand business objects
Application
Repository
Interface
Generator
Mobile
Application
Repository
Screen Elements Business Objects
Modeling Components
Business Objects
Business Queries
Combo Engines
Business Rules
-
8/12/2019 Overview BOL Framework
18/54
SAP AG 2002, Business Object Layer, 21
Business Objects
Business Object
Represents a physical or logical entity in a business scenario,
such as Customer, Address, or Order.
Framework implements a Generic Business Object exposing
standard methods, properties and event handlers.
Generic BO is extended using VBA where new methods and
properties can be added.
Is characterized by :
Business Object Type
Properties
Methods
Event Handlers
Relations to other Business Objects
Business Rules
User Exits
-
8/12/2019 Overview BOL Framework
19/54
SAP AG 2002, Business Object Layer, 22
Business objectproperties:
Characterize a business objectExample: country, zip code, or street name
characterize an address
Can take simple values (for example, a string
or number)
Comprise the state of a business objectduring runtime
Business Object Properties
Name
City
Street
Zip Code
House No.
Default Address
-
8/12/2019 Overview BOL Framework
20/54
SAP AG 2002, Business Object Layer, 23
Business objectmethods:
Are operations that can be performed on a business object
Define the behavior, business logic, of a business object
Example: Configuration rules for a product
Can be called from other business object methods or from the UI
Are written in Visual Basic for Applications (VBA)
Business Object Methods
-
8/12/2019 Overview BOL Framework
21/54
SAP AG 2002, Business Object Layer, 24
Eventsare messages sent within a program when specific useractions occurfor example, when you create, change, save,or delete a business object.
Eventhandlersthat is, pieces of program codecan beconnected to these events. If an event is fired, thecorresponding code will be executed.
Example: Event Handlers of Business Object BOCAPGEN
Business Object Event Handlers
-
8/12/2019 Overview BOL Framework
22/54
SAP AG 2002, Business Object Layer, 25
EXAMPLES for relationshipoptions
Cardinality
Single:Order Item Order Item Status
Multiple:Order Order Items
Business Object Relationships
Optional in relation
True:Bu siness Partner Contact
False:Bus iness Partner Order
Relation[ship] type
Child:Order Order Items
Normal:Bus iness Partner Order
Action if deleted
Cascaded:Order Order Items
None:Bus iness Partner Contact
-
8/12/2019 Overview BOL Framework
23/54
SAP AG 2002, Business Object Layer, 26
You use Business Rulesto implement constraints on a business objects
state, in order to ensure business object model consistency.
Examples
Ensure that a certain condition is true for a business object at any time, for example, the start
date of an appointment must be before its end date.
Prevent the deletion of a business object, for example,once an order has been uploaded to a
backend system, it must not be deleted in Mobile Sales.
Business Rules
-
8/12/2019 Overview BOL Framework
24/54
SAP AG 2002, Business Object Layer, 27
Business Object SaveRules / DeleteRules
Business Rules:
Are assigned to a business object or business object propertyAre implemented as Boolean functions
Saverules (triggered when you save a business object)
Deleterules (triggered when you delete a business object)
Propertyrules (triggered when you change a business object property)
Are called automatically
-
8/12/2019 Overview BOL Framework
25/54
SAP AG 2002, Business Object Layer, 28
Business Rules: Priorities
EXAMPLE:
The business object BOEMPLOYEEhas four Saverules:
If you assign AreDatesValidpriority 1, and IsLogicalAddressUniquepriority 2,
AreDatesValidruns before IsLogicalAddressUnique.
NOTE: Both business rules could be assigned to another business object aswell; in that case, the priorities could be different.
Every business rule assigned to a business object or business object
property has a priority per category (Save Rules, Delete Rules) which
determines the order in which the business rules are triggered:
O
-
8/12/2019 Overview BOL Framework
26/54
SAP AG 2002, Business Object Layer, 29
Business Object User Exits
User Exits:
Are development objects that represent customer-defined code
Are used to enhance the functionality of the existing code
in accordance with the customer's requirement
Have a name, signature, and VBA code
Using SAP-defined user exits does not modify the existing
application code (no collisions during upgrade)
B i Q
-
8/12/2019 Overview BOL Framework
27/54
SAP AG 2002, Business Object Layer, 30
Business Query
Business Query
Provides a mechanism for retrieving a set of Business Objects
(BusinessCollection) based on Search criteria. Search parameters are modeled as Propertiesof a Business Query.
Properties... Characterize the business objects that result from the query to be executed
Accepts simple values (for example, a string or number)
Values are not stored in the database
Business Query Properties, similar to Business Object Properties, offer an
additional propertyMatch Type.
Exact match
Match At End
Match At Begin
Match Sub String
Match Advanced
Match Exact Empty
B i Q R lt B i C ll ti
-
8/12/2019 Overview BOL Framework
28/54
SAP AG 2002, Business Object Layer, 32
Business Collection (BCOL)
A collection of Business Objects. These objects are not
necessarily instantiated. The BCOL maintains a reference to the
Business Objects belonging to it.
It can expose additional information not part of the Business
Object type the collection represents. This data is read/write but
is not persisted.
Not modeled in Mobile Application Studio. Can be retrieved eitheras a Relation or as a return Value from a Business Query.
They are comparable to COM collection objects.
Methods of a BCOL
Save, create and delete business objects.
Find the business object through index or its ID. The ID can be
viewed as a unique key for that object.
List the contained objects.
Business Query Result: Business Collection
C b E i d Li t E i
-
8/12/2019 Overview BOL Framework
29/54
SAP AG 2002, Business Object Layer, 33
Combo Engine and List Engine
Combo Engine
Component behind the UI dropdown
COMBOINPUT control
Mapping functionality
Attached to a Business Object Property
Modeling
Modeled in Mobile Application Studio
BDoc definition required
Hierarchy information when required
List Engine
Represents BDoc Layer record set
Used internally by the Combo Engine
C t t
-
8/12/2019 Overview BOL Framework
30/54
SAP AG 2002, Business Object Layer, 35
Contents
Introduction
Business Object LayerRuntime
Authorizations
Business Object LayerDesign Time
Mobile Client Application Development
Looking Ahead
M bil Cli t A li ti R ti
-
8/12/2019 Overview BOL Framework
31/54
SAP AG 2002, Business Object Layer, 36
Mobile Client Application - Runtime
Runtime
HTML,
VBA DLLs,
Control Files,
metafiles
(arsrep.dat,
msginfo.dat)
Mobile Client Application
User Interface Layer
Business Object Layer
BDoc Layer
UDB
CRM Server
Middleware
CDB
Other
Systems
Synchronizat ion
-
8/12/2019 Overview BOL Framework
32/54
Business Object Layer: Components
-
8/12/2019 Overview BOL Framework
33/54
SAP AG 2002, Business Object Layer, 38
Business Object Layer: Components
BusinessRootObject
Gateway into the Business Object Layer
Initializes the dependent servicesVBA, Application Repository, BDoc Layer
Creates service components of the Business Object LayerBusiness
Factory, UserDataDictionary, Error Storage Component, Business Object
Manager
BusinessFactory
Creates the components exposed by the Business Object Layer
Business Object
Business Collection
Business Query
Combo Engine
List Engine
Creation of a Business Object: Memory Representation
-
8/12/2019 Overview BOL Framework
34/54
SAP AG 2002, Business Object Layer, 39
Creation of a Business Object: Memory Representation
Business Object Layer
Business
Factory
VBA Host
Business
Object
(Kernel
Object)
MAR
Runtime
Repository
MAR Runtime
Data Access Layer (BDoc Layer)
Application Data (UDB)
RR
R
R
R
R
R
R
Step 1: User asks
the Business Factory
to create a
Business Object
Step 2: Business Factory
creates an instance of
Kernel Business Object
Step 3: Kernel Business
Object asks VBA Host tocreate an instance of
extended Business Object
Step 4: VBA Host returns
an instance of the extended
Business Object
Step 5: Kernel Business
Object asks the Data
Access Layer to fetch the
record set corresponding to
that instance of the BO
Step 6: Data Access Layer
returns the record set
corresponding to that
instance of the BO
Step 7: Kernel Business
Objects pointer is returned
as a return value to the
CreateBusinessObject call
Runtime Components File Names
-
8/12/2019 Overview BOL Framework
35/54
SAP AG 2002, Business Object Layer, 40
Runtime ComponentsFile Names
Business Object Layer
Business
Factory
VBA Host
Business
Object
(Kernel
Object)
MAR
Runtime
Repository
MAR Runtime
Data Access Layer (BDoc Layer)
Application Data (UDB)
RR
R
R
R
R
R
R
Business Object
Layer Framework
sfabof.dll
BDoc Layer
TLRecset.dll,
Tlx.dll,
TLRowset.dllTLResMan.dll
MAR Runtime
RepositoryARSRT.dll
VBA Host
vbahost.dll
The Interpreter of
the Message
Information
Store:
MsgInfoAccess.dl
l
Error
Component:
ErrComp.dll
Contents
-
8/12/2019 Overview BOL Framework
36/54
SAP AG 2002, Business Object Layer, 41
Contents
Introduction
Business Object LayerRuntime
Authorizations
Business Object LayerDesign Time
Mobile Client Application Development
Looking Ahead
Basic Concepts
-
8/12/2019 Overview BOL Framework
37/54
SAP AG 2002, Business Object Layer, 42
Basic Concepts
What isauthorization?
Permission to read, create, modify,and/or delete data
What is arole?
The col lect ion of act iv i t iesthat a person
performs when participating in one or more
business scenarios in an organization.
What is auser?
Users can include end users, system
administrators, and content managers
(that is, project teams and consultants).In the mobile scenario, the user is a
business partner with the role Employee.
Authorization Management: Procedure
-
8/12/2019 Overview BOL Framework
38/54
SAP AG 2002, Business Object Layer, 43
Authorization Management: Procedure
Authorizations are assigned:
On the basis of user roles.
In two steps. An employee is:
Assigned to user role(s)
Granted authorizations
No coding is required; customizing is donevia theAuthorization Management Tool
(AMT).
EMPLOYEE ROLE AUTHORIZATIONn:m
Authorization Levels
-
8/12/2019 Overview BOL Framework
39/54
SAP AG 2002, Business Object Layer, 44
Authorization Levels
Business Object Data
Interaction Component Based
Business Object Based
Field Group Based
You can maintain authorizations at several levels:
EMPLOYEE ROLE AUTHORIZATIONn:m
Authorization Using Interaction Components
-
8/12/2019 Overview BOL Framework
40/54
SAP AG 2002, Business Object Layer, 45
Authorization Using Interaction Components
Current Interaction Components
which can be protected are:
Application Business Component
Tile set
Tile
Application
Tile
Tile Set
Business
Component
Using Tokens to Define Authorizations
-
8/12/2019 Overview BOL Framework
41/54
SAP AG 2002, Business Object Layer, 46
Using Tokens to Define Authorizations
Tokens...
Define the authorization for a class ofbusiness objects regarding read, modify,
delete, create new.
Tokens Can be a collection of Authorization Rules
which define the valid scope, that is, the
authorization for a business objectdepending on its content, or the data it
contains
Are true if:
All assigned authorization rules are true (at
runtime)
OR
No authorization rules have been assigned
Authorization Rules
-
8/12/2019 Overview BOL Framework
42/54
SAP AG 2002, Business Object Layer, 47
Authorization
Rules
AuthorizationVariables
Predefined
Values
User-Dependent
Data
Authorization Rules
Authorization Rules: Grant access rights based on
the data contained in business
objects
Consist of:
Business object field
Comparison type
Contain authorization logic
which is filled by either:
Authorization variables or Predefined values
Authorization Using Field Groups
-
8/12/2019 Overview BOL Framework
43/54
SAP AG 2002, Business Object Layer, 48
Business Object(and Child Objects)
Field Group
Authorization
Rules
Set of
Properties
Authorization Using Field Groups
Afield groupconsists of a set of
business object properties.
You use field groups to set
authorizations for fields.
Field groups can be made
dependent on authorization rules.
In this case, the authorizations:
Depend on field values
Are assigned to field group
instances
Can include variables
Architecture
-
8/12/2019 Overview BOL Framework
44/54
SAP AG 2002, Business Object Layer, 49
UI
BO Factory
BO Kernel
BDoc Layer
R
R
R
R
R
NavigationBar / Interaction
components (during startup)
update rights (after load)
create BO
Attribute valuesAttribute metadata
Attribute rights
create BO
create related BO
Token evaluation
update rights (BO and Attribute rights)get rights (w/o changing BO state) persistence
ACM
AccessControl
Manager
runtime
Architecture
AMT
Authorization
Management
Tool
design time
MAR
Mobile
Application
Repository User Database
Auth tables
UDB
Contents
-
8/12/2019 Overview BOL Framework
45/54
SAP AG 2002, Business Object Layer, 50
Contents
Introduction
Business Object LayerRuntime
Authorizations
Business Object LayerDesign Time
Mobile Client Application Development
Looking Ahead
Where do we go from here
-
8/12/2019 Overview BOL Framework
46/54
SAP AG 2002, Business Object Layer, 51
Where do we go from here
Enhanced Business Logic Layer
Separating UI Validations from Business Validation
Providing infrastructure for type-safe programming paradigm
New Data Access Layer
Common Architecture for all Mobile Solutions
Bring together the Modeling world of all Offline Mobile Solutions
Common design time model
Implement the runtime Model Layer of .NET Web Dynpro
Appendix
-
8/12/2019 Overview BOL Framework
47/54
SAP AG 2002, Business Object Layer, 52
Appendix
Business Documents (BDocs)Data Binding
What Is a Synchronization Business Document (BDoc)?
-
8/12/2019 Overview BOL Framework
48/54
SAP AG 2002, Business Object Layer, 53
Acontainer for messagessynchronized between Mobile Client Applications
and the CRM Server A BDoc message contains information about data changes and is replicated
from the Mobile Client Application to the CRM Server, or vice versa
The CRM Server can distribute the changes to:
Other Mobile Client Applications CRM Online
OLTP R/3
Aninterfaceto the Consolidated Database (CDB)
Access to data is only through a BDoc type.
Every time you make changes to data in the Mobile Client Application, theMobile Client Application must generate a BDoc message and send it to theCRM Server.
What Is a Synchronization Business Document (BDoc)?
BDoc Structure
-
8/12/2019 Overview BOL Framework
49/54
SAP AG 2002, Business Object Layer, 54
For each BDoc, you must define aBDoc type.
A BDoc type defines how the data is organized.
A BDoc message can be considered aninstanceof a BDoc type.
ABDoc messagecontains:
All data pertaining to an objectExample: BDoc for Bus iness Partnercontains address data, attachments,
sales-area-dependent data, etc.
The data of more than one table. The data of a single table within aBDoc is called asegment.
BDoc Structure
BDoc Types
-
8/12/2019 Overview BOL Framework
50/54
SAP AG 2002, Business Object Layer, 55
Synchronization BDocs (sBDocs) Used for the communication of the CRM Server with mobile clients
When changes are stored in the user database, aBDoc messageis produced.
Changes are synchronized with the CRM Server as awhole (all or nothing) via a BDoc message
Mapping of BDoc segments to CDB tables
Designed to access single data records
Stored in the CDB
Allows replication and realignment
Previously called Write BDocs
Mobile Application BDocs Used by mySAP CRM Mobile Client Applications
Processed outside the CRM Server
Data cannot be changed
BDoc messages cannot be created
Designed to access a collection of data records(record set) fulfilling certain criteria
Previously called Read or Modifiable Read BDocs
Messaging BDocs (mBDocs) Used for message exchange with CRM Server applications,
backend and external systems No exchange with mobile clients
Not stored in CDB
yp
UDB
Communication
Station CRM Server
Mobile Clients
UDB
Mobile Clients
CRM Server R/3 Server
CDB
-
8/12/2019 Overview BOL Framework
51/54
Appendix
-
8/12/2019 Overview BOL Framework
52/54
SAP AG 2002, Business Object Layer, 57
pp
Business Documents (BDocs)
Data Binding
Data Binding: What Has to Be Connected?
-
8/12/2019 Overview BOL Framework
53/54
SAP AG 2002, Business Object Layer, 58
Tile Set
Tile
Screen
Element
on UI
UIL
g
LAYERS:
Business
Object
PropertyBOLBusiness
Object
BDoc Segment
FieldSegment BDL
UDBDatabase
Table
FieldDatabase
Table
DBL
Data Binding Between System Layers
-
8/12/2019 Overview BOL Framework
54/54
Screen
Elements
TileTile
SetInput
Field
List
BoxCheck-
boxIcon
BusinessComponentApplication
User
Interface
Layer
Properties Business
Objects
Business Object Layer
g y y
Seg.
Field
Doc
...
BDoc Repository(Part of CRM Server)
Seg. 2 Seg. n
Seg.
Field
Seg.
FieldSeg.
Field
Seg. 1
BDoc
LayerDB Table
Field 1
UDB
Field2
UserDatabase