24
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com © 2012 SAP LABS Applies to: SAP® Business Objects™ Process Control 10.0 Summary This Handbook provides information about the programmed data source. Team: Governance, Risk, and Compliance SAP BusinessObjects Division Created on: March 8, 2012 Version 1.10 Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook for ABAP Developers

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Creating Customer Program Rules Handbook for ABAP Developers

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

© 2012 SAP LABS

Applies to:

SAP® Business Objects™ Process Control 10.0

Summary

This Handbook provides information about the programmed data source.

Team: Governance, Risk, and Compliance SAP BusinessObjects Division

Created on: March 8, 2012

Version 1.10

Creating Customer Program Rules

Handbook for ABAP Developers

Page 2: Creating Customer Program Rules Handbook for ABAP Developers

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

© 2012 SAP LABS

Document History

Document Version Description

1.10 Updated template

1.00 Initial Release

Page 3: Creating Customer Program Rules Handbook for ABAP Developers

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

© 2012 SAP LABS

Typographic Conventions

Type Style Description

Example Text Words or characters quoted from the screen. These include field names, screen titles, pushbuttons labels, menu names, menu paths, and menu options.

Cross-references to other documentation

Example text Emphasized words or phrases in body text, graphic titles, and table titles

Example text File and directory names and their paths, messages, names of variables and parameters, source text, and names of installation, upgrade and database tools.

Example text User entry texts. These are words or characters that you enter in the system exactly as they appear in the documentation.

<Example

text>

Variable user entry. Angle brackets indicate that you replace these words and characters with appropriate entries to make entries in the system.

EXAMPLE TEXT Keys on the keyboard, for example, F2 or ENTER.

Icons

Icon Description

Caution

Note or Important

Example

Recommendation or Tip

Page 4: Creating Customer Program Rules Handbook for ABAP Developers

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

© 2012 SAP LABS

Table of Contents

1. Business Scenario .............................................................................................. 1

2. Background Information .................................................................................... 1

3. Prerequisites ..................................................................................................... 2

4. Creating a Programmed Data Source in the Plug-in System by Creating the Class 3

4.1 Create the Change Log Rule .............................................................................. 3

4.1.1 Define the Filter Structure .................................................................... 3

4.1.2 Defining the Deficiency Structure ......................................................... 3

4.1.3 Defining the Internal Structure ............................................................. 4

4.1.4 Defining the Output Structure .............................................................. 4

4.1.5 Creating the Class .................................................................................. 5

4.1.6 Implementing the RETRIEVE_LOG ......................................................... 5

4.1.7 Implementing the DOPROCESS Method ............................................... 6

4.1.8 Defining the Register Rule ..................................................................... 7

4.2 Creating the Transaction Rule........................................................................... 8

4.2.1 Defining the Filter Structure .................................................................. 8

4.2.2 Defining the Deficiency Structure ......................................................... 9

4.2.3 Defining the Internal Structure ............................................................. 9

4.2.4 Defining the Output Structure ............................................................ 10

4.2.5 Creating the Data Source Class ........................................................... 11

4.2.6 Creating the Class ................................................................................ 11

4.2.7 Creating the Constructor ..................................................................... 11

4.2.8 Implementing the GET Method........................................................... 12

4.2.9 Implementing the PROCESS_DATA Method ....................................... 14

4.2.10 Defining the Register Rule ................................................................... 14

4.3 Defining the Program Rule .............................................................................. 15

5. Copyright .......................................................................................................... 1

Page 5: Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook

April 2012 1

1. Business Scenario

This handbook provides step-by-step instructions for how to create program rules. It is intended to be used by ABAP developers before proceeding with the Using the Programmed Subscenario for Continuous Monitoring User Guide.

2. Background Information

A programmed data source obtains change log or transactional data. The class will extract data and manipulate data in an extended way that can only be done by programming. Below are the examples.

Use transaction SE11 to define your filter, deficiency, and internal structures. The field name and component types should preferably be the same as those in the database table for all structures. This will reduce unnecessary data conversion.

The program is specifically written to specify which fields in the filter and deficiency structures; therefore, they cannot be defined during business rule design. Only the values for the filter and deficiency can be defined.

The continuous monitoring framework provides an infrastructure which will execute the business rule. For each programmed data source, the user needs to define the following:

Filter Structure – Criteria for data retrieval

Deficiency Structure – Deficiency fields

Internal Structure – Placeholder for data manipulation

Class – Retrieved data

The data can be change log or transactional data.

Page 6: Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook

April 2012 2

The following figure depicts the programmed rule execution process flow:

3. Prerequisites

The system requirements for creating customer program rules are as follows:

Process Control 10.0

SAP NetWeaver system (6.20 to 7.10) with the SAP GRC 10.0 NetWeaver Plug-in installed

You have completed the following steps:

You have created and configured regulation(s)

You have created corporation and organization units

You have created the central process, subprocess, and controls

You have assigned proper regulation(s) to the control

You have assigned subprocesses or controls to the corporation or organization unit

You have configured connectors

For more information about configuring connectors in the IMG, refer to the Creating Connectors in PC 10.0 document at http://help.sap.com/pc.

Page 7: Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook

April 2012 3

4. Creating a Programmed Data Source in the

Plug-in System by Creating the Class

4.1 Create the Change Log Rule

The following example demonstrates how to create a programmed data source which monitors the business rule change log by identifying changes. In this example, the data source identifies only that master or configuration data has changed but does not identify new values. See section 4.4, Program Rule Definition for more information about changes. This is an example of the programmed rule LOPURVAP_07C2_01_A.

4.1.1 Define the Filter Structure

1. Create the filter structure by using transaction code SE11.

Since the filter fields are predefined, you cannot manipulate the filters in the business rule.

NOTE: To enable F4 help, use the format <TABLE NAME>_<FIELD NAME>. Each field in the structure will be used as a business rule filter.

4.1.2 Defining the Deficiency Structure

The Deficiency structure defines deficiency fields for the business rule.

1. Enter transaction code SE11.

Page 8: Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook

April 2012 4

2. Create a structure by entering the field name and component type.

4.1.3 Defining the Internal Structure

The Internal structure is a placeholder used for internal processing and stores intermediate results when it is necessary to manipulate the data.

1. Enter the field name and its component type.

4.1.4 Defining the Output Structure

The Output structure defines output fields.

1. Enter the field name and its component type.

NOTE: Structures of the prefix and suffix are automatically included, and do not require definition.

Page 9: Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook

April 2012 5

4.1.5 Creating the Class

1. Enter transaction code SE24 to create the class /GRCPI/CL_GRIA_LOPURVAP_07C2_1.

4.1.6 Implementing the RETRIEVE_LOG

1. Enter transaction code SE24 to create a class. In this example, the class is /GRCPI/CL_GRIA_LOPURVAP_07C2.

2. In the Properties tab, add /GRCPI/CL_GRIA_PROGRAM_C as a superclass.

The method RETRIEVE_LOG will be automatically included in the class. It will retrieve the change log based on the object, object type, and time period.

Page 10: Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook

April 2012 6

4.1.7 Implementing the DOPROCESS Method

The DOPROCESS method is inherited from the superclass /GRCPI/CL_GRIA_PROGRAM_C. Use this method to implement your core business logic.

In this example, it retrieves changes in table T169P (Invoice Verification). It uses the following business process:

Applies filter value for company code (BUKRS)

Retrieves key values of table T1690P from the change log

Uses the retrieved key value to get company code description

Page 11: Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook

April 2012 7

4.1.8 Defining the Register Rule

For each developed class, you first need to register it in the Rule Definition table. It is needed during business rule execution. To register the class, do the following:

1. Enter transaction code SM30 and maintain the /GRCPI/GRIAVPROG view. 2. Create an entry with the following information:

Page 12: Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook

April 2012 8

For more information, see section 4.3, Program Rule Definition.

4.2 Creating the Transaction Rule

This section contains an example of how to create the programmed rule HREMP_14M1_01_A with the type CI.

4.2.1 Defining the Filter Structure

1. Enter transaction code SE11 and create a structure similar to the following.

NOTE: Use the format <TABLE NAME>_<FIELD NAME> to enable F4 help. Each field in the structure will be used as a business rule filter.

Page 13: Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook

April 2012 9

4.2.2 Defining the Deficiency Structure

The Deficiency structure defines deficiency fields for the business rule.

1. Enter transaction code SE11 to create the deficiency structure.

4.2.3 Defining the Internal Structure

The Internal structure is used for internal processing and stores intermediate results.

Page 14: Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook

April 2012 10

4.2.4 Defining the Output Structure

The Output structure defines the output fields.

NOTE: The prefix and suffix structures are included automatically and do not require definition.

Page 15: Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook

April 2012 11

4.2.5 Creating the Data Source Class

NOTE: If you find an existing class, you can skip this step.

1. Enter transaction code SE24 and create the class /GRCPI/CL_GRIA_PA0014.

4.2.6 Creating the Class

1. Enter transaction code SE24 and create the class /GRCPI/CL_GRIA_HREMP_14M1_1.

4.2.7 Creating the Constructor

1. Create the constructor and create an instance of a previously created data source class.

Page 16: Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook

April 2012 12

2. Enter the interface for the class.

4.2.8 Implementing the GET Method

This method will retrieve data from the PA0014 table. First, the GET Method checks for authorization, and then retrieves data from the table.

1. Enter transaction code SE24. 2. Enter the class name.

In this example, the class name is /GRCPI/CL_GRIA_PO0014.

Page 17: Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook

April 2012 13

Page 18: Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook

April 2012 14

4.2.9 Implementing the PROCESS_DATA Method

You can implement your core business logic with this method.

4.2.10 Defining the Register Rule

1. Enter transaction code SM30 and maintain view /GRCPI/GRIAVPROG. 2. Create an entry with the following information.

For more information, see Section 4.3, Program Rule Definition.

Page 19: Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook

April 2012 15

4.3 Defining the Program Rule

Each entry in the Rule Definition table will be a candidate for the programmed data source.

1. Enter transaction code SM30. 2. Enter the view name /GRCPI/GRIAVPROG. 3. Choose Maintain.

The GRCPI/GRIA/PROG table contains the following fields.

Page 20: Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook

April 2012 16

CLSNAME: Class name of program rule

BR_CATEGORY: Business rule category

VAL Value Check

LOG Change log: SAP change log, SAP change document, GRC change log

BR_ANYSTYPE: Business rule analysis type

CC Changes

CN Number of Changes

CI Change Indicator

TN Total number of changes (in PC 3.0, this was called 1 Rule CN)

MF Monitor

MV Monitor Value

SA Absolute

SP Percentage

SZ Absolute and Percentage

EI Set Deficiency Indicator

ER Review Required

CR Review Required for Changes

PA Pattern

BR_FDANYSTYPE: Business rule field analysis type

NA Filter

C Changes

N Number of Changes

B Blank Check

V Value Check

AV Aggregation (in PC 3.0, this was called “Significant amount”)

P Percentage Check

VPO Value and Percentage Optimistic (in PC 3.0, this was called “Include”)

VPP Value and Percentage Pessimistic (in PC 3.0, this was called “Exclude”)

R Review Required

Page 21: Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook

April 2012 17

List of possible combinations:

BR_CATEGORY BR_ANYSTYPE BR_FDANYSTYPE

LOG (Change Log Check) CC C

LOG (Change Log Check) CN N

LOG (Change Log Check) TN N

LOG (Change Log Check) MF B

LOG (Change Log Check) MF V

LOG (Change Log Check) CI C

VALUE (Value Check) SA V

VALUE (Value Check) SA AV

VALUE (Value Check) SP P

VALUE (Value Check) SZ VPO

VALUE (Value Check) SZ VPP

FILTER_TYPE: Filter structure

Page 22: Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook

April 2012 18

DEFICIENCY_TYPE: Deficiency structure

OUTPUT_TYPE: Output structure

INTERNAL_TYPE: Internal structure

OBJECT_TYPE: Business rule handler object type

M Maintenance View

O Object Class (For master data change)

T Table

G GRC Handler

Page 23: Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook

5. Copyright

© 2012 SAP AG. All rights reserved.

SAP Library document classification: PUBLIC

No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice.

Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.

Microsoft, Windows, Excel, Outlook, PowerPoint, Silverlight, and Visual Studio are registered trademarks of Microsoft Corporation.

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 Architecture, Power Systems, POWER7, POWER6+, POWER6, POWER, PowerHA, pureScale, PowerPC, BladeCenter, System Storage, Storwize, XIV, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, AIX, Intelligent Miner, WebSphere, Tivoli, Informix, and Smarter Planet are trademarks or registered trademarks of IBM Corporation.

Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.

Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and other countries.

Oracle and Java are registered trademarks of Oracle and its affiliates.

UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.

Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc.

HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology.

Apple, App Store, iBooks, iPad, iPhone, iPhoto, iTunes, Multi-Touch, Objective-C, Retina, Safari, Siri, and Xcode are trademarks or registered trademarks of Apple Inc.

IOS is a registered trademark of Cisco Systems Inc.

RIM, Blackberry, BBM, BlackBerry Curve, BlackBerry Bold, BlackBerry Pearl, BlackBerry Torch, BlackBerry Storm, BlackBerry Storm2, BlackBerry PlayBook, and BlackBerry App World are trademarks or registered trademarks of Research in Motion Limited.

Google App Engine, Google Apps, Google Checkout, Google Data API, Google Maps, Google Mobile Ads, Google Mobile Updater, Google Mobile, Google Store, Google Sync, Google Updater, Google Voice, Google Mail, Gmail, YouTube, Dalvik, and Android are trademarks or registered trademarks of Google Inc.

INTERMEC is a registered trademark of Intermec Technologies Corporation.

Wi-Fi is a registered trademark of Wi-Fi Alliance.

Bluetooth is a registered trademark of Bluetooth SIG Inc.

Page 24: Creating Customer Program Rules Handbook for ABAP Developers

Creating Customer Program Rules Handbook

Motorola is a registered trademark of Motorola Trademark Holdings LLC.

Computop is a registered trademark of Computop Wirtschaftsinformatik GmbH.

SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects Explorer, 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 and other countries.

Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects Software Ltd. Business Objects is an SAP company.

Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL Anywhere, and other Sybase products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Sybase, Inc. Sybase is an SAP company.

Crossgate, m@gic EDDY, B2B 360°, and B2B 360° Services are registered trademarks of Crossgate AC in Germany and other countries. Crossgate is an SAP company.

All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.