Вы находитесь на странице: 1из 27

BOPF Actions

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 an Action
Action Configuration
Action Implementation
Action Exporting Parameter (new feature since SAP_BS_FND 747 SP8)

© 2012 SAP AG. All rights reserved. 3


Introduction
Introduction

Motivation
 Business objects provide specific functions that can be used by a user or system.
 In this example, the status of an invoice business object can be changed to paid by the
action invoice_paid.

© 2012 SAP AG. All rights reserved. 5


Definition

Actions are business logic entities assigned to a business object node.

Actions are called actively either


 by a service consumer
 by another business object
 or internally (e.g. by another action or by a determination)

Actions can modify nodes of their own as well as nodes of other business objects.

Actions may have input parameters that are imported from the consumer.

Actions only return messages and failed keys (keys of instances for which the
action has not been executed). In addition, the changes made by the action are
returned (e.g. create, delete, update of a certain node instance).

© 2012 SAP AG. All rights reserved. 6


Creating an Action
Action Categories

BO-specific actions
Framework actions

In the Business Suite BOPF configuration, two action categories exist:


 BO-specific actions: Actions that implement the specific business logic of a certain business
object (e.g. invoice_issued within the CUSTOMER_INVOICE business object)
 Framework actions: Actions like create, update, delete, save, lock, unlock, and validate are
created automatically and therefore they do not have to be implemented.

© 2012 SAP AG. All rights reserved. 8


Showing Framework Actions

Mark

The framework actions are created automatically, therefore no creation and implementation is
needed.
Hint: These actions are not displayed in /BOBF/CONF_UI by default.
(Choose Menu “ Utilities” > “ Settings” > tab “ Business Object” to set them as visible)

© 2012 SAP AG. All rights reserved. 9


Creating a BO-Specific Action

 Choose “ Create Action” in the context menu of the node to which this action is to be
assigned.
 Define the action class that contains the action implementation.

© 2012 SAP AG. All rights reserved. 10


Action Configuration
Action Configuration
Overview

Start the “ Guided Procedure” or use the tabbed screens to configure the settings of
the action.

© 2012 SAP AG. All rights reserved. 12


Action Configuration
Overview

Node:
The node to which the action is assigned
(“ Assigned Node”)

Action cardinality:
Defines on how many node instances the
action can be called at once

Change mode (rule of thumb)


 Persistent action=> “ Exclusive write” (default)
 Action only on transient fields => “ Only Read Mode”

Class/interface: Class that implements this action

© 2012 SAP AG. All rights reserved. 13


Action Configuration
Read and Write Nodes

Choose preconditions for action execution


 Read nodes: Nodes that must all be loaded into the buffer before the action can start
instead of being loaded on demand. Do not use them (and if you do , as “modeled only”)
 Write nodes: Nodes for which the framework has to guarantee that they are all write-locked
before the action is executed. Use write nodes only if your modified nodes are located in
foreign locking groups.
 Modeled only: Ignored at runtime, but configuration entry is only entered as documentation
(e.g. useful to generate documentation or for model checks)

© 2012 SAP AG. All rights reserved. 14


Action Configuration
Node Category Assignment

Node Categories
 Used to bundle node instances with nearly identical business logic into different groups
 Each category has a different set of actions, determinations, associations and so on
 More information about node categories is provided in BOPF Expert Training

In this step, the node categories for which the action is available can be
selected.

© 2012 SAP AG. All rights reserved. 15


Action Configuration
Property Change Trigger

More information about this topic is provided in BOPF Extended Training.

© 2012 SAP AG. All rights reserved. 16


Action Implementation
Action Implementation
Overview
methods RETRIEVE_DEFAULT_PARAM
RETRIEVE_DEFAULT_PARAM importing
IS_CTX type /BOBF/S_FRW_CTX_ACT
(optional) IT_KEY type /BOBF/T_FRW_KEY
IO_READ type ref to /BOBF/IF_FRW_READ
changing
CS_PARAMETERS type ref to DATA
raising /BOBF/CX_FRW .
methods PREPARE
importing
IS_CTX type /BOBF/S_FRW_CTX_ACT
IO_READ type ref to /BOBF/IF_FRW_READ
1. PREPARE IO_CHECK type ref to /BOBF/IF_FRW_CHECK
IS_PARAMETERS type ref to DATA
(optional) exporting
EO_MESSAGE type ref to /BOBF/IF_FRW_MESSAGE
changing
CT_KEY type /BOBF/T_FRW_KEY
raising /BOBF/CX_FRW .
methods EXECUTE
importing
IS_CTX type /BOBF/S_FRW_CTX_ACT
2. EXECUTE IT_KEY type /BOBF/T_FRW_KEY
IO_READ type ref to /BOBF/IF_FRW_READ
IO_MODIFY type ref to /BOBF/IF_FRW_MODIFY
IS_PARAMETERS type ref to DATA
exporting
EO_MESSAGE type ref to /BOBF/IF_FRW_MESSAGE
ET_FAILED_KEY type /BOBF/T_FRW_KEY
raising /BOBF/CX_FRW .

Actions are classes implementing the /BOBF/IF_FRW_ACTION interface.

© 2012 SAP AG. All rights reserved. 18


Action Implementation
Retrieve Default Parameters

methods RETRIEVE_DEFAULT_PARAM
importing
IS_CTX type /BOBF/S_FRW_CTX_ACT
IT_KEY type /BOBF/T_FRW_KEY
IO_READ type ref to /BOBF/IF_FRW_READ
changing
CS_PARAMETERS type ref to DATA
raising
/BOBF/CX_FRW .

Retrieves the default parameters of an action:


 IS_CTX: Context information of the action
 IT_KEY: Table of keys of the instances of the assigned node of the action
 IO_READ: Reference to an object implementing the read interface to read instance data
 CS_PARAMETERS: Reference to the parameters of the action

© 2012 SAP AG. All rights reserved. 19


Action Implementation
Prepare

Preparations for Action Execution


methods PREPARE
importing
IS_CTX type /BOBF/S_FRW_CTX_ACT
IO_READ type ref to /BOBF/IF_FRW_READ
IO_CHECK type ref to /BOBF/IF_FRW_CHECK
IS_PARAMETERS type ref to DATA
exporting
EO_MESSAGE type ref to /BOBF/IF_FRW_MESSAGE
changing
CT_KEY type /BOBF/T_FRW_KEY
raising
/BOBF/CX_FRW.

Examples:
 Adds an additional key to the set of instance keys in CT_KEY that are affected by this action
 Call check and determine to derive a current consistency status for action checks.
 Parameters
 IS_PARAMETERS: Parameters of this action call that were given by the consumer
 EO_MESSAGE: Message object that contains information, error, or warning messages
 CT_KEY: Table of keys of the “ prepared” instances

© 2012 SAP AG. All rights reserved. 20


Action Implementation
Execute

Execution of the Actual Action Logic

methods EXECUTE
importing
IS_CTX type /BOBF/S_FRW_CTX_ACT
IT_KEY type /BOBF/T_FRW_KEY
IO_READ type ref to /BOBF/IF_FRW_READ
IO_MODIFY type ref to /BOBF/IF_FRW_MODIFY
IS_PARAMETERS type ref to DATA
exporting
EO_MESSAGE type ref to /BOBF/IF_FRW_MESSAGE
ET_FAILED_KEY type /BOBF/T_FRW_KEY
raising
/BOBF/CX_FRW .

 IT_KEY: Table of keys of the instances the action is to operate on.


 IS_PARAMETERS: Reference to the action’s parameters supplied by the service consumer.
 EO_MESSAGE: Message container
 ET_FAILED_KEY: Table of keys of node instances for which the action execution was not
possible.

© 2012 SAP AG. All rights reserved. 21


Action Implementation
Context

The action context (IS_CTX) is the input parameter of all action methods and
provides generic model information about the action.

Keys from the constants interface of the business object that is parent of the action in
the model:
 BO_KEY: Key of the business object of which the action is part
 ROOT_NODE_KEY: Key of the root node of that business object
 NODE_KEY: Key of the node to which the action is assigned
 ACT_KEY: Key of the action
 ACT_CAT: Category of the action (e.g. SC_ACTION_LOCK, SC_ACTION_DELETE)
 FACADE: Local client proxy facade
 REFERENCE NODES: Table of BO node references (only relevant for
CREATE_WITH_REFERENCE actions)

Attention: This information is only static from the BO model; there is no instance-
relevant information!

© 2012 SAP AG. All rights reserved. 22


Action Implementation
Context Example

CUSTOMER_INVOICE BO Model
/BOPF/CUSTOMER_INVOICE
Action Context
(IS_CTX) ROOT (232…)
BO_KEY BTD_REFERENCE (124…)
ROOT_NODE_KEY ITEM (232)
NODE_KEY INCREASE_QUANTITY
ACT_KEY ITEM_BTD_REFERENCE (232)
ACT_CAT ITEM_PRODUCT (232)
FACADE ITEM_PRODUCT_DESCRIPTION (232)
REFERENCE_NODES ITEM_TAX_TERMS (232)
PARTY (232)
TOTAL_AMOUNT (232)

© 2012 SAP AG. All rights reserved. 23


Action Exporting Parameter - Configuration

An Action may return any Node data…

…or data of any other type specified as Table Type…

© 2012 SAP AG. All rights reserved. 24


Action Exporting Parameter - Implementation

The signature of the EXECUTE method was enhanced


with a new exporting parameter ET_DATA…

methods EXECUTE
importing
IS_CTX type /BOBF/S_FRW_CTX_ACT
IT_KEY type /BOBF/T_FRW_KEY
IO_READ type ref to /BOBF/IF_FRW_READ
EXECUTE IO_MODIFY type ref to /BOBF/IF_FRW_MODIFY
IS_PARAMETERS type ref to DATA
exporting
EO_MESSAGE type ref to /BOBF/IF_FRW_MESSAGE
ET_FAILED_KEY type /BOBF/T_FRW_KEY
ET_DATA type INDEX TABLE
raising /BOBF/CX_FRW .

Remark: the exporting type, that is defined in the designtime, is a ‘contract’ between the
action caller and the action implementer. The framework won’t check the type at runtime.

© 2012 SAP AG. All rights reserved. 25


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. 27

Вам также может понравиться