You are on page 1of 34

BOPF Creating BOs,

Nodes & Associations


SAP AG, 2012
Disclaimer

This presentation outlines our general product direction and should not be relied on in
making a purchase decision. This presentation is not subject to your license
agreement or any other agreement with SAP. SAP has no obligation to pursue any
course of business outlined in this presentation or to develop or release any
functionality mentioned in this presentation. This presentation and SAP's strategy and
possible future developments are subject to change and may be changed by SAP at
any time for any reason without notice. This document is provided without a warranty
of any kind, either express or implied, including but not limited to, the implied
warranties of merchantability, fitness for a particular purpose, or non-infringement.
SAP assumes no responsibility for errors or omissions in this document, except if
such damages were caused by SAP intentionally or grossly negligent.

© 2012 SAP AG. All rights reserved. 2


Agenda

Introduction
Creating a Business Object
Creating a Node
 Creation of the Node
 Creation of the Data Model
 Generation of DDIC Elements and Database
 Node-Database Mapping
 Constant Interface Generation
 Locking
 Node Types
Creating an Association

© 2012 SAP AG. All rights reserved. 3


Introduction
Example of a Business Object Instance

Address
(association with business
partner)

Header Data
Invoice no., customer no., etc.

Invoice Items

Product and Product Description

Calculated Price per Item

Calculated Net Amount


Calculated Tax Amount
Calculated Gross Amount
The CUSTOMER_INVOICE business object was developed for this workshop.

© 2012 SAP AG. All rights reserved. 5


Creating a Business Object
Creating a Business Object

New

To create your business object within BOPF, proceed as follows:


1. Start BOPF Design Workbench (transaction /BOBF/CONF_UI).

2. Create a new business object by pressing the ( ) icon.


3. Enter the BOPF name and description.

© 2012 SAP AG. All rights reserved. 7


Open a Business Object

Open

Open and configure existing business objects using Business Object Browser.

© 2012 SAP AG. All rights reserved. 8


Creating a Node
Creation of a Node

 Select the node that needs a new


subnode in the “ Node Structure” section
 Enter the subnode name and its description.

Hint: The root node is created automatically after a business object is created and thus cannot
be created manually.

© 2012 SAP AG. All rights reserved. 10


Creation of the Data Model

Data Structure: Each node has an internal data structure containing persistent fields
Data Structure (tr.): Data structure containing the transient fields of this node
(Transient fields: Fields that are not stored in the database and exist only in the buffer)
Combined Structure: Consists of the data structure, the optional transient data structure, and a
technical key include (necessary, for example, for buffering)
Combined Table Type: Table type for storing the data of multiple instances of a node
(necessary for mass-enabled access). The row type corresponds to the combined structure.
© 2012 SAP AG. All rights reserved. 11
Propose Repository Names (1)

BOPF provides naming proposals for various dictionary objects


Option to select entities and to specify namespaces and prefixes for generated names
Check whether proposed names comply with naming conventions (truncations etc.)

© 2012 SAP AG. All rights reserved. 12


Propose Repository Names (2)

Result of the execution of the “ Propose Repository Names” function

© 2012 SAP AG. All rights reserved. 13


Generation of DDIC Elements (1)

BOPF can generate DDIC elements after


their names are specified in the model

Option to select the elements to be generated:


 Combined data structure includes manually created internal data structure and adds
framework specific fields
 Combined table type uses combined data structure as the row type

© 2012 SAP AG. All rights reserved. 14


Example of Naming Proposals and DDIC Generation

Data Structures Combined Structure


ZCI_S_ROOT_D ZCI_S_ROOT ZCI_T_ROOT
ID .INCLUDE
QUANTITY KEY
QUANTITY_UNIT PARENT_KEY
PRICE_AMOUNT ROOT_KEY
NET_AMOUNT
GROSS_AMOUNT .INCLUDE
TAX_AMOUNT
CURRENCY_CODE …
CONSISTENCY
.INCLUDE
CREA_DATE_TIME
CREA_IDENT_UUID
LCHG_DATE_TIME
LCHG_IDENT_UUID

ZCI_S_ROOT_DT .INCLUDE


 Create the data structures manually


(create the data structure for the transient fields only if there actually are any transient fields)
 Propose repository names for the combined structure and the combined table type
 Generate dictionary elements for the combined structure and the combined table type
© 2012 SAP AG. All rights reserved. 15
Creation of the Database Table

Mark
Mark

 Database table name can be proposed by BOPF (“Extras” -> “ Propose Repository Names“)
 Database table can be generated (“ Extras” -> “ Generate Repository Objects” -> “ Generate
Dictionary Elements”) or created manually
 Remark: Database Index for Parent Key is only generated for Database Systems <> Hana DB
(On Hana DB: please compare to DB guidelines, if manual creation of DB Index makes sense, e.g. > 500k entries expected)

© 2012 SAP AG. All rights reserved. 16


Node-Database Mapping

Storage in Database Table


 Field names in the database must correspond to the internal data structure or a named
include can be used and specified in the database mapping
 Internal fields that do not exist in the database table are called “ transient”
 Example: The item node is a child of the root node, thus we can map both fields (ROOT_KEY
and PARENT_KEY) to one database attribute because they always have identical values.
© 2012 SAP AG. All rights reserved. 17
Constants Interface Generation (1)

2. Generate

1. Enter

© 2012 SAP AG. All rights reserved. 18


Constants Interface Generation (2)

 Each configuration element (e.g. nodes, actions) is uniquely identifiable within BOPF at design
time, as well as during runtime, by a GUID.
 Application-specific content that uses internal model information has to use these GUIDs (e.g.
reuse of implementations).
 BOPF provides the option of generating a constants interface containing all GUIDs.

Hint: You need to regenerate the constants interface after the creation of new configuration
elements or just activate the object.
© 2012 SAP AG. All rights reserved. 19
Locking
Overview

Mark

BOPF is used to lock business object instances


 Explicit locking request only using RETRIEVE calls (with EDIT_MODE parameter)
 Implicit locking using modifications

Option of locking each individual node is pointless.

BOPF’s Approach: Locking Groups


 Consists of one node marked as lockable and its child nodes that are not lockable themselves
 Strategy when a lock is requested for a non-lockable node: Lock closest lockable ancestor
 Lockable nodes also have to be loadable
© 2012 SAP AG. All rights reserved. 20
Locking
Using Groups

Locking Group A

Locking Group B

Rule: All nodes belonging to one loading group must belong to the same locking
group.

© 2012 SAP AG. All rights reserved. 21


Node Types

BOPF supports different types of nodes in the


internal model.

Standard Nodes

Framework Nodes (not shown by default)


contain information about the instances:
 Property nodes (suffix _PROPERTY):
Store dynamic properties
 Lock nodes (suffix _LOCK)
Buffer lock information
 Message nodes (suffix _MESSAGE)
Contain messages from validations
 Delegated nodes (representation of dependent
object)
 Business object representation nodes

© 2012 SAP AG. All rights reserved. 22


Framework Nodes
Overview

Property Node
Message Node
Lock Node

Framework core does not hold any instance specific data, thus framework nodes are used for
storing this data.
Framework nodes not accessible for service consumers, but from BO content
Framework nodes are not stored in the database (exception: message nodes can be stored
optionally in the database)
Framework node structure:
 Exactly one property node for each node
 Exactly one message node for each node
 Exactly one lock node for each lockable node
© 2012 SAP AG. All rights reserved. 23
Framework Nodes
How to display them

Mark

Framework nodes are not visible by default.


To make them visible, go to “Utilities” > “Settings” > “Business Object”.

© 2012 SAP AG. All rights reserved. 24


Framework Nodes
Example

Framework-
Not in database defined
internal data
types

© 2012 SAP AG. All rights reserved. 25


Creating an Association
Creation of an Association

Select the node to which the association is assigned in the “ Node Elements” section
and follow the guided procedure.

© 2012 SAP AG. All rights reserved. 27


Association Type and Category

BOPF offers two different types of associations in the internal model


Composite associations: From parent to child nodes
Categories:
 Regular composition association
 Specialization (not the same as the “specialization” from object orientation)
 Association with delegated node (dependent object)
 Framework associations (link to framework nodes)

General associations: Linked across the composition tree


Categories:
 Foreign key association/reverse foreign key association
 Reverse specialization
 Association To_Parent
 Association To_Root
 Cross-BO association
 Regular association (implementation-specific)

© 2012 SAP AG. All rights reserved. 28


Association Configuration
Overview

Implementation
class for
associations

© 2012 SAP AG. All rights reserved. 29


Association Configuration
Cardinality and Resolving Node

Cardinality of an association: Number of node instances that are connected to


one source instance.

Resolving Node: Associations can be distinguished according to the node that is


used to resolve the association
 Source-resolved associations
Source node contains information necessary for resolving the association
 Target-resolved associations
Target node contains information necessary for resolving the association

© 2012 SAP AG. All rights reserved. 30


Association Configuration
Implementation vs. Binding

The association’s logic can be deposited in two different ways:


Implementation
 Needed for associations with specific business logic that is not covered by existing association bindings
 Implementation of the IF_FRW_ASSOCIATION interface necessary
(not part of this training course)
 Example: Association that links hierarchically ordered items

Association Binding
 Can be easily modeled without any implementation work
 Binding is resolved by the buffer implementation
 Association types supported by binding:
o Compositions (no binding necessary)
o Specialization/reverse specialization
o Foreign key associations/reverse foreign key associations
o To_Parent
o To_Root
o Cross-business object associations

Recommendation: If possible, use association binding to refine the BO model.

© 2012 SAP AG. All rights reserved. 31


Association Configuration
Binding

Specify binding
pattern

Specify
binding details

© 2012 SAP AG. All rights reserved. 32


Thank you
© 2012 SAP AG. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose Google App Engine, Google Apps, Google Checkout, Google Data API, Google Maps,
without the express permission of SAP AG. The information contained herein may be Google Mobile Ads, Google Mobile Updater, Google Mobile, Google Store, Google Sync,
changed without prior notice. Google Updater, Google Voice, Google Mail, Gmail, YouTube, Dalvik and Android are
trademarks or registered trademarks of Google Inc.
Some software products marketed by SAP AG and its distributors contain proprietary
software components of other software vendors. INTERMEC is a registered trademark of Intermec Technologies Corporation.
Microsoft, Windows, Excel, Outlook, PowerPoint, Silverlight, and Visual Studio are Wi-Fi is a registered trademark of Wi-Fi Alliance.
registered trademarks of Microsoft Corporation.
Bluetooth is a registered trademark of Bluetooth SIG Inc.
IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x,
System z, System z10, z10, z/VM, z/OS, OS/390, zEnterprise, PowerVM, Power Motorola is a registered trademark of Motorola Trademark Holdings LLC.
Architecture, Power Systems, POWER7, POWER6+, POWER6, POWER, PowerHA, Computop is a registered trademark of Computop Wirtschaftsinformatik GmbH.
pureScale, PowerPC, BladeCenter, System Storage, Storwize, XIV, GPFS, HACMP,
RETAIN, DB2 Connect, RACF, Redbooks, OS/2, AIX, Intelligent Miner, WebSphere, Tivoli, SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects Explorer,
Informix, and Smarter Planet are trademarks or registered trademarks of IBM Corporation. StreamWork, SAP HANA, and other SAP products and services mentioned herein as well
as their respective logos are trademarks or registered trademarks of SAP AG in Germany
Linux is the registered trademark of Linus Torvalds in the United States and other countries. and other countries.
Adobe, the Adobe logo, Acrobat, PostScript, and Reader are trademarks or registered Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal
trademarks of Adobe Systems Incorporated in the United States and other countries. Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services
Oracle and Java are registered trademarks of Oracle and its affiliates. mentioned herein as well as their respective logos are trademarks or registered trademarks
of Business Objects Software Ltd. Business Objects is an SAP company.
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.
Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL Anywhere, and other Sybase
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin products and services mentioned herein as well as their respective logos are trademarks or
are trademarks or registered trademarks of Citrix Systems Inc. registered trademarks of Sybase Inc. Sybase is an SAP company.
HTML, XML, XHTML, and W3C are trademarks or registered trademarks of W3C®, Crossgate, m@gic EDDY, B2B 360°, and B2B 360° Services are registered trademarks
World Wide Web Consortium, Massachusetts Institute of Technology. of Crossgate AG in Germany and other countries. Crossgate is an SAP company.
Apple, App Store, iBooks, iPad, iPhone, iPhoto, iPod, iTunes, Multi-Touch, Objective-C, All other product and service names mentioned are the trademarks of their respective
Retina, Safari, Siri, and Xcode are trademarks or registered trademarks of Apple Inc. companies. Data contained in this document serves informational purposes only. National
product specifications may vary.
IOS is a registered trademark of Cisco Systems Inc.
The information in this document is proprietary to SAP. No part of this document may be
RIM, BlackBerry, BBM, BlackBerry Curve, BlackBerry Bold, BlackBerry Pearl, BlackBerry reproduced, copied, or transmitted in any form or for any purpose without the express prior
Torch, BlackBerry Storm, BlackBerry Storm2, BlackBerry PlayBook, and BlackBerry App written permission of SAP AG.
World are trademarks or registered trademarks of Research in Motion Limited.

© 2012 SAP AG. All rights reserved. 34

You might also like