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

SAP Sourcing / Contract Lifecycle Mgmt

Overview
June 2011

Material # TSO15095P

SAP Class Week of March 19, 2012


Disclaimer

The information in this document is confidential and proprietary to SAP and may not be
disclosed without the permission of SAP. This presentation is not subject to your license
agreement or any other service or subscription agreement with SAP. SAP has no obligation to
pursue any course of business outlined in this document or any related presentation, or to
develop or release any functionality mentioned therein. This document, or any related
presentation and SAP's strategy and possible future developments, products and or platforms
directions and functionality are all subject to change and may be changed by SAP at any time
for any reason without notice. The information on this document is not a commitment, promise
or legal obligation to deliver any material, code or functionality. 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. This document is for informational purposes and may not be incorporated into a
contract. SAP assumes no responsibility for errors or omissions in this document, except if
such damages were caused by SAP intentionally or grossly negligent.

All forward-looking statements are subject to various risks and uncertainties that could cause
actual results to differ materially from expectations. Readers are cautioned not to place undue
reliance on these forward-looking statements, which speak only as of their dates, and they
should not be relied upon in making purchasing decisions.

© 2011 SAP AG. All rights reserved. 2

SAP Class Week of March 19, 2012


Ineffective Strategic Sourcing Processes
Results in the Lack of Sustainable Savings

Poor strategic sourcing process results in long cycle times, lost


savings opportunities, and slow time to value
Lack of Process Management
Limited Supplier Qualification
„ Limited ability to conduct simple and or
complex sourcing activities „ Difficulty in identifying, evaluating and,
„ Lack of a standard sourcing process across qualifying suppliers
spend categories „ Lack of on boarding and engagement
process

Ineffective Sourcing Event


Management
„ No automated RFI, RFQ, and
or RFP sourcing capabilities
„ Inability to effectively manage
auctions and supplier
engagement

Slow Time to Value


„ Adoption to new tools can be slow
„ Lack of deployment flexibility Poor Negotiation and Award Process
„ Limited process and data integration to ERP
„ Ineffective ability to collaborate with
suppliers efficiently
„ Limited tools to examine, score and award
proposals
© 2011 SAP AG. All rights reserved. 3

SAP Class Week of March 19, 2012


Effective Strategic Sourcing Process
Delivers Sustainable Savings

Effective strategic sourcing process reduced cycle times, increased


savings opportunities and rapid time to value
Enable Effective Process Management
Deliver Supplier Qualification
„ Streamline complex sourcing processes
and automate tasks „ Efficiently identify, evaluate and qualify new
„ Pre-configured processes, templates suppliers
enabling standardization and reduced „ Enables straightforward onboarding
cycle times process inclusive of specific attributes e.g.
sustainability criteria

Manage Sourcing Events


„ Automated RFI, RFQ, and
or RFP sourcing capabilities
„ Effectively manage, track
auctions and supplier
engagement

Rapid Time to Value


Comprehensive Negotiation
„ Enables fast adoption and Award Process
„ Delivers rapid on demand deployment „ Effective ability to collaborate with
„ Provides process and data integration to suppliers efficiently
ERP „ Extensive tools for bid optimization, scoring,
and award selection

© 2011 SAP AG. All rights reserved. 4

SAP Class Week of March 19, 2012


SAP Sourcing
Delivers the Strategic Sourcing Process

Effectively Managing Today’s Important Procurement


Needs with Rapid Time to Value

„ Ena
Enables the strategic sourcing
pro
process across all categories of
spend
spe

„ Del
Delivers sourcing strategy and project
ma
management capabilities

„ Ma
Manages supplier identification,
qualification and on boarding
qua

„ Pro
Provides extensive RFI, RFQ, RFP
and Auction tools and templates

„ Ena
Enables effective bid negotiation,
eva
evaluation and awards
On Demand „ Drives rapid time to value via On
Demand Deployment and ERP
integration

© 2011 SAP AG. All rights reserved. 5

SAP Class Week of March 19, 2012


Ineffective Contract Lifecycle Management
Results in Increased Compliance Risks
Poor Contract Lifecycle Management Results in Significant Legal Risk,
Financial Impact, and Slow Time to Value
Weak Contract Management Ineffective Contract Creation
■ Poor contract compliance (PO, invoice, SLAs) ■ Lack of tight controls (e.g., for non-standard
■ Belated renewals management contracts / language)
■ Lack of performance information hinders re-sourcing or resale efforts ■ Legal risk

Operational
Contracts

Procurement Le
Legal
L e Sales

Disconnected Negotiation Processes


Financial ■ Inconsistent and email-intensive processes
■ Risk of not including correct stakeholders
■ Long negotiation and approval cycle times

Poor Contract Visibility Slow Time to Value


■ Organizationally dispersed contracts „ Adoption to new tools can be slow
■ Redundant contracts „ Lack of deployment flexibility
■ No visibility into commitments (financial, legal) „ Limited process and data integration to ERP
■ Inability to track regulatory compliance or
understand contract history

© 2011 SAP AG. All rights reserved. 6

SAP Class Week of March 19, 2012


Effective Contract Lifecycle Management
Delivers Optimized Contract Value
Improved Contract Lifecycle Management Reduces Legal and
Financial Risk, and Delivers Rapid Time to Value
Improved Contract Management
■ Improved contract compliance (PO, invoice, SLAs)
■ Timely renewals management Effective Contract Creation
■ Visibility to performance information enables proactive
relationship management ■ Tighter controls (e.g., for non-standard contracts /
language)
■ Minimized legal risk

Operational
i
Contracts

S
Sales
Procurement

Financial Leg
Legal Streamlined Negotiation Processes
■ Streamlined and controlled processes
■ Inclusion of the right stakeholders
■ Abbreviated negotiation and approval
cycles

Full Contract Visibility Rapid Time to Value


■ Single repository for contracts „ Enables fast adoption
■ Elimination of redundant contracts „ Delivers rapid on demand deployment
■ Visibility into commitments (financial, legal) „ Provides process and data integration to
■ Ability to track regulatory compliance and understand ERP
contract history
© 2011 SAP AG. All rights reserved. 7

SAP Class Week of March 19, 2012


SAP Contract Lifecycle Management
Supports the Entire Contract Lifecycle
Effectively Managing Today’s Important Procurement
Needs with Rapid Time to Value

„ Automates the contract creation


cycle from draft to reviews and
approvals
„ Includes contract authoring with
clause and template libraries
„ Creates a contract repository with
access-controlled search and
reporting
„ Includes standard integration with
SAP ERP-MM for procurement
contract compliance
„ Deep bi-directional integration
within the source to contract
process
„ Drives rapid time to value via On-
Demand Deployment and
integration into ERP

© 2011 SAP AG. All rights reserved. 8

SAP Class Week of March 19, 2012


SAP CLM application footprint

SAP Sourcing

Project &&
Project Supplier Contracts
Contract
Sourcing
Sourcing& /
Process
Process Qualification
Supply Mgmt.& Repository & &
Management
Evaluation
Negotiation
Management
Management Performance Negotiation
Compliance(CLM)

„ Standardize sourcing „ Supplier self-registration „ Simple to complex RFx „ Centralize contracts


process: steps, tasks, and self-maintenance events „ Contract authoring
owners, due dates, etc. „ Single entry point for all bid „ Business scenario award „ Standard templates and
„ User dashboards and contract activities optimization clause library
„ Centralize all sourcing „ Management of prospective „ Reverse and forward „ Collaboration and
project management supplier database auctions approval workflows

© 2011 SAP AG. All rights reserved. 9

SAP Class Week of March 19, 2012


SAP Contract Lifecycle Management OnDemand -
OnDemand Services

Standard Services
ƒ Customer success manager
ƒ Onboarding and enablement
ƒ Hosting
ƒ Training
ƒ On-going support
ƒ 2 new innovation waves per year

Additional Services
ƒ Event day support
ƒ Supplier support
ƒ Contracting support
ƒ Legacy contract migration
ƒ Supplier management risk profiling
ƒ Consulting services

© 2011 SAP AG. All rights reserved. 10

SAP Class Week of March 19, 2012


Contract Lifecycle Management OnDemand
OnDemand vs. OnPremise | What to Choose?

Partner-based
SaaS (multi-tenant
OP Hosted hosted) OnDemand

Strategic Common practice is


Own-practice is better
Differentiation better

Economics of Buy CAPEX OPEX

Speed of
Not critical Critical
implementation

Security concerns Critical Not critical

Landscape
High Low
complexity

Fast access to
Not critical Critical
innovation

© 2011 SAP AG. All rights reserved. 11

SAP Class Week of March 19, 2012


SRM Portfolio
Enables the Complete Source to Pay Process

Qualify Strategic Procurement


Source

Enables the complete source


Negotiate to contract process and the
Strategic:
Analyze/ consistent improvement in
Source to Pay

Strategize SPM & purchasing activities


E-Sourcing
Award
Contract
Requisition or
Spot Source Operational
Invoice Procurement
Approve Operational:
Enables complete procure to
ERP & SRM pay process from the daily
Receive requisition, including spot
sourcing, to the order and pay
Assign process for all goods and
Order
services
© 2011 SAP AG. All rights reserved. 12

SAP Class Week of March 19, 2012


SAP Sourcing to ERP Summarized Integration

SAP Sourcing Business Suite 7

Strategic Contract Contracts


Supplier Requisition Order Invoice
Sourcing Lifecycle
Mgmt
Mgmt

Legend

User action
System activity

© 2011 SAP AG. All rights reserved. 13

SAP Class Week of March 19, 2012


SAP Procurement Solutions Deliver Choices
for Deployment

SAP
„ Delivers on-premise,
hosted, and on-demand
On-premise:
deployment options
SAP
„ Enables a common
experience across all
procurement solutions
On-demand: Business process „ Supports additional choice of
SAP outsourcing (BPO): deployment while extending
Enabled through partners existing investments
Partners
„ Deliver BPO offerings and
other flexible deployment
options

© 2011 SAP AG. All rights reserved. 14

SAP Class Week of March 19, 2012


SAP Sourcing / Contract Lifecycle Mgmt
Setup page
Aug 2011

SAP Class Week of March 19, 2012


Setup functionality

ƒ “Setup” is the area of the application where most application


configuration and setup is done
ƒ The setup area consists of four major sections
ƒ System Setup
ƒ Master Data
ƒ Document Setup
ƒ System Administration
ƒ Access to the various areas of setup is controlled through the
security profiles and access rights of a particular
user…typically end users, for example, won’t have access to
much (or anything) within setup.
ƒ Access is also impacted by deployment mode (e.g., Public
OnDemand users do not have access to all functionalities)
ƒ There are many possible users of the setup components,
however:
ƒ Key user
ƒ Business analyst
ƒ Technical configuration user
ƒ System administrator

© 2011 SAP AG. All rights reserved. 18

SAP Class Week of March 19, 2012


Setup area

System Setup Master Data Document System


Setup Administration
Typical User(s) Technical Key User, Key User, System Admin,
Configuration Business Analyst Business Analyst Technical,
User, Key User
Key User
Description Various technical Master and Document User and security
configurations configuration data configuration data management,
such as: reporting, to support the to support the import and export
custom fields, user business process and tools, and various
interface, scripting, documents functional use of system monitoring
and workflow the business functions
documents
Key Objects Query Definitions Product Category Document Report Internal User
Extension Material Configuration Accounts
Definition Purchasing Document Types Security Profiles
Localized Organizations Configurable Import Data
Resources Purchasing Phase Definitions
Page Groups Contract
Customizations Company Codes Document
Script Definition Libraries
WYSIWYG
© 2011 SAP AG. All rights reserved. 19

SAP Class Week of March 19, 2012


Demo

ƒ Demo Setup page

ƒ Highlight extension definition and localized resources


on System Setup tab

ƒ Highlight organizational setup data on Master Data tab

ƒ Highlight Projects area on Document Setup tab

ƒ Highlight Internal User Accounts and Security Profiles


on System Administration tab

© 2011 SAP AG. All rights reserved. 20

SAP Class Week of March 19, 2012


SAP Sourcing / Contract Lifecycle Mgmt
Localized Resources
Aug 2011

SAP Class Week of March 19, 2012


Agenda

ƒ Localized Resources
ƒ General
ƒ Extensions
ƒ Definition
ƒ Attributes
ƒ Collections
ƒ Difference in attribute / collection storage
ƒ Browsing Extension tables
ƒ Some DO’s and DON’Ts

© 2011 SAP AG. All rights reserved. 24

SAP Class Week of March 19, 2012


Setup functionality

ƒ Used throughout the user interface to support multiple


languages
ƒ Each user interface label is a localized resource
ƒ A localized resource is uniquely identified by:
ƒ A “bundle”
ƒ A “resource id”
ƒ A localized resource has a
ƒ Default Value
ƒ Override Value
ƒ Values per each installed language pack
ƒ The application comes delivered with 1000’s of
localized resources
ƒ New localized resources are created in an
implementation as needed
ƒ Localized resources are maintained in: Setup >
System Setup > User Interface > Localized Resources

© 2011 SAP AG. All rights reserved. 25

SAP Class Week of March 19, 2012


Example Localized Resource

ƒ Bundle = cterms
ƒ Resource ID: cterm.value
ƒ Default Value: Value (what is shown if locale-specific
entry is not provided)
ƒ Locale-Specific Entries: translations for each language

Tip: English is not a language pack…it is the default

© 2011 SAP AG. All rights reserved. 26

SAP Class Week of March 19, 2012


Where are localized resources used? (1/2)

ƒ User interface labels


ƒ Field labels
ƒ Tabs
ƒ Buttons
ƒ Column Headers

ƒ Error message text

© 2011 SAP AG. All rights reserved. 27

SAP Class Week of March 19, 2012


Where are localized resources used? (2/2)

ƒ Value List Values

ƒ Names of certain objects e.g.


ƒ queries
ƒ reports

ƒ Extension attribute names

© 2011 SAP AG. All rights reserved. 28

SAP Class Week of March 19, 2012


Localized Resources Best Practices

Re-use SAP provided localized resources when possible


ƒ Search by bundle (cterms) or value

Create new localized resources when the value doesn’t


exist
ƒ Always use a consistent bundle name for easy searching and
migration (recommendation: “custom”)
ƒ The resource id can be used to help name the usage of the
localized resource (for example, the module area, extension
area, etc.)
ƒ Translations are your responsibility

When modifying a localized resource value, you should


plan to modify each of the translations as well

© 2011 SAP AG. All rights reserved. 29

SAP Class Week of March 19, 2012


Extensions – General

ƒ Extensions are custom fields / collections


that can be added to any business
document or master data object (including
User Defined)

ƒ This is accomplished by creating an


extension definition for the class to be
extended and then adding the attributes
(fields) to that definition.

ƒ The fields / collections are stored in


dynamically created tables.

© 2011 SAP AG. All rights reserved. 30

SAP Class Week of March 19, 2012


Extensions – Extension Definition

ƒ In Setup Æ System Setup Æ


Configuration Æ Extension
Definition

ƒ Using the Extended Class


Name dropdown, select “The
Class” (object) to be extended

© 2011 SAP AG. All rights reserved. 31

SAP Class Week of March 19, 2012


Extensions – Extension Attributes

Adding an attribute:

ƒ Internal Name – Database Column


ƒ Attribute Display name – Field name in the UI
(localized resource)
ƒ Data Type – data type since this equates to column
qty and type it is not changeable once saved

NOTE: Display After, Required and Read Only are better supported as page customizations
© 2011 SAP AG. All rights reserved. 32

SAP Class Week of March 19, 2012


Extension – Attributes

ƒ String: Character string up to 256 characters can be


sized as needed (256 by default)
ƒ Integer: Basic whole number ( 1 356 etc )
ƒ Decimal: Floating point value. Precision can be
specified
ƒ Boolean: True / False equates to a check box in the UI
ƒ Date Time: Includes both date and time information
ƒ Date: Includes only date
ƒ URL: A link to either local files or to other internet
accessible content
ƒ Object Reference: Reference to another business
document or master data object
ƒ Value List: Drop down lists either standard or custom
ƒ Attachment: File attachment (stored as a BLOB)
ƒ Amount: Decimal value followed by a unit of measure
ƒ Price: Decimal value followed by a currency
ƒ Text: A rich text field (AKA big text) allows formatting
and larger capacity up to 4K characters
© 2011 SAP AG. All rights reserved. 33

SAP Class Week of March 19, 2012


Extensions - Attributes

ƒ The attribute display name will be the field text in the UI

NOTE: the Database Table name is shown as well

© 2011 SAP AG. All rights reserved. 34

SAP Class Week of March 19, 2012


Extensions - Attributes
By default extensions are
positioned at the end of the
header page fields

© 2011 SAP AG. All rights reserved. 35

SAP Class Week of March 19, 2012


Exercise 1

Objective
ƒ Familiarize yourself with the process of creating extensions

Exercise
ƒ Based on your group and object assignments, Create Date/Time extension(s) that will
capture a “validity range”.

© 2011 SAP AG. All rights reserved. 36

SAP Class Week of March 19, 2012


Extensions – Extension Collections

What are Collections?

ƒ Collections are tables of rows and columns

ƒ The extension includes the definition of the columns of the table

ƒ The user adds rows to the table (collection)

© 2011 SAP AG. All rights reserved. 37

SAP Class Week of March 19, 2012


Extensions – Extension Collections

ƒ Extension collections are groups of attributes that allow for multiple occurrences o
ƒ The fields (a table of values) initially the collection name and internal name must be
specified

© 2011 SAP AG. All rights reserved. 38

SAP Class Week of March 19, 2012


Extensions – Extension Collections

ƒ Subsequent additions to the collection are achieved by selecting “use existing collection”
and picking the proper collection

© 2011 SAP AG. All rights reserved. 39

SAP Class Week of March 19, 2012


Extensions – Extension Collections

ƒ Notice the separation in the single attributes and the collection. Also notice the extra
attributes. By default these are hidden but can be exposed by….

© 2011 SAP AG. All rights reserved. 40

SAP Class Week of March 19, 2012


Extensions – Extension Collections

ƒ Selecting the attribute, and changing the visibility from none to Internal Only, External
Only or Internal and External

© 2011 SAP AG. All rights reserved. 41

SAP Class Week of March 19, 2012


Resulting Extension Collection

ƒ The results of the field and collection created

© 2011 SAP AG. All rights reserved. 42

SAP Class Week of March 19, 2012


Extensions - Storage Differences / Attributes / Collections

Attributes
ƒ There is 1 table for all single attributes of an extension
definition . Each object instance has a row in the table
that contains a reference to the parent Relationship 1-1

Collections
ƒ Each collection has its own dynamic table since there
N entries for a collection per document. Relationship
1- N

© 2011 SAP AG. All rights reserved. 43

SAP Class Week of March 19, 2012


Extensions – Browsing the extension tables

© 2011 SAP AG. All rights reserved. 44

SAP Class Week of March 19, 2012


Extensions –
Browsing the extension tables – Attribute View

© 2011 SAP AG. All rights reserved. 45

SAP Class Week of March 19, 2012


Extensions –
Browsing the extension tables- Collection view

Note
ƒ 7-9 reference to parent object

ƒ 11-13 The object ref to user attribute

ƒ 22 The string attribute (defaulted)

© 2011 SAP AG. All rights reserved. 46

SAP Class Week of March 19, 2012


Extensions – Do’s and Don’ts

ƒ Do consider and plan carefully. Even ƒ Don’t make a single extension field
though you can make mistakes go away Required or Read Only in the attribute
by making the extension inactive the data definition. Do that with a page
and infrastructure remain in the DB customization instead. NOTE: collection
fields cannot be affected by page
customizations should making them
ƒ Do define the value list type before adding
Required or Read Only in the extension
the extension using the value list type
definition is necessary

ƒ Don’t rely on the display after to position


multiple extensions on a page. Again use
page customizations. Do use the display
after to place the extension on the correct
tab.

© 2011 SAP AG. All rights reserved. 47

SAP Class Week of March 19, 2012


Exercise 2

Objective
ƒ Familiarize yourself with the process of creating extension collections.

Exercise
ƒ Based on your group and object assignments, create an extension Collection to capture
Savings Entries. This should include:
ƒ A savings amount entry
ƒ Who entered the entry
ƒ A display of when it was entered
ƒ A field to entry comments

© 2011 SAP AG. All rights reserved. 48

SAP Class Week of March 19, 2012


SAP Sourcing / Contract Lifecycle Mgmt
Page Customizations
Aug 2011

SAP Class Week of March 19, 2012


Page Customizations

SAP Class Week of March 19, 2012


Configurations – Page Customization
Any of the Standard fields / extensions in any
object in SAP Sourcing can be customized
ƒ Hide
ƒ Change Field Label
ƒ Hide Field Label
ƒ Make editable/read-only
ƒ Change Field position
ƒ Make required
ƒ Add Pre and Post Text
ƒ Add Description (mouse over tool tip)
ƒ Change Checkbox Label
ƒ Hide Checkbox Label
ƒ Make Price Currency read-only
ƒ Object Picker (Query Group)
ƒ Add to Quick Create

Dividers between fields can also be customized

© 2011 SAP AG. All rights reserved. 53

SAP Class Week of March 19, 2012


Customization Descriptions

ƒ Hide - Remove the field from the UI – (Don’t try this on required fields)
ƒ Change Field Label - Change the text of a field – (Localized Resource)
ƒ Hide Field Label - Leave the field and just hide the label
ƒ Make editable/read-only – Make a field read-only
ƒ Change Field position – Move the filed in a relative position in the UI
ƒ Make required – Force the field to be set. (becomes part of validation)
ƒ Add Pre and Post Text – Allows for clear instruction on field content
ƒ Add Description (mouse over tool tip) same as above but temporary
ƒ Change Checkbox Label – Specialized version for checkboxes
ƒ Hide Checkbox Label – Specialized version for checkboxes
ƒ Make Price Currency read-only – Price editable Currency fixed
ƒ Object Picker – UI specific changes to pickers ( ! auto complete )
ƒ Add to Quick Create – Add this field to the Quick Create UI

© 2011 SAP AG. All rights reserved. 54

SAP Class Week of March 19, 2012


Configurations – Page Customization

Step 1: Locate the Page's UI


Metadata
ƒ Go to the object you want to
change
ƒ Click on the Reference Guide
Link
ƒ In the Class Reference page
that comes up, toggle to UI
View
ƒ Locate the page where you
want to make the change

© 2011 SAP AG. All rights reserved. 55

SAP Class Week of March 19, 2012


Configurations – Page Customization
Step 2: Create a Page Customization
ƒ Use the UI ID field obtained from the Reference Guide. Or by using the dropdowns in the
Page Customization UI if this is the first time this page is being modified. An example
might be projects.projects.ui.buyside.default

© 2011 SAP AG. All rights reserved. 56

SAP Class Week of March 19, 2012


Configurations – Page Customization

Step 3: Add Element


Customization
ƒ Find Field ID of field to be
changed
ƒ Add many different fields or
one field many times
ƒ If text is used, you will create
a localized resource

© 2011 SAP AG. All rights reserved. 57

SAP Class Week of March 19, 2012


Configurations – Page Customization
Step 4: Test Your Changes

Before After

© 2011 SAP AG. All rights reserved. 58

SAP Class Week of March 19, 2012


Live Demo

ƒ Requirement: Change the Description Field in all


Projects to:
ƒ Have a field label of Project Scope
ƒ Make it required
ƒ Add a tool tip that describes what the description field should
include

© 2011 SAP AG. All rights reserved. 59

SAP Class Week of March 19, 2012


Configurations – Conditional Page Customizations

ƒ Page Customizations can be conditional ƒ Dimension Field: The field ID on which the
using “dimension” capabilities conditional logic is based

ƒ If Dimension Field (which is of type ƒ Dimension Field Type: The data type
Dimension Field Type) has the value (class) of the Dimension Field
Dimension Value, then apply the page
customization override
ƒ Dimension Value: The value which will
make the condition true and apply the
ƒ Example: If DOC_TYPE (which is of type page customization override
Project Type) has the value Category
Project, then apply the page customization
override

N
NOTE: Page customizations are applied when you enter the business document only;
tthey are not applied on page refresh, save, etc. So, the dimension field should be a
value that is set before entering the business document.
v

© 2011 SAP AG. All rights reserved. 60

SAP Class Week of March 19, 2012


Another Example of Conditional Page Customizations

Example Requirement: “Hide the extension field


Financial Impact (FIN_IMPACT) for all users except
members of the Financial Audit Team”
ƒ Solution: Create 2 page customization overrides in the
page customization:

ƒ Field: FIN_IMPACT, Hidden property: No, Dimension


Field: <%USER_GROUP%>, Dimension Field Value:
Financial Audit Team group
ƒ The above makes the field visible for the specified group

ƒ Field: FIN_IMPACT, Hidden property: Yes


ƒ The above makes the field invisible for all other conditions

© 2011 SAP AG. All rights reserved. 61

SAP Class Week of March 19, 2012


UI Configurations – Page Customization Exercises

Objective: Become familiar with general and dimensioned page customizations

Exercise 1 Exercise 2
ƒ Create a page customization override on ƒ Create a series of page customizations to
the project object that makes the change the order of the first 3 fields.
description field a required value.

© 2011 SAP AG. All rights reserved. 62

SAP Class Week of March 19, 2012


WYSWIG Customization

SAP Class Week of March 19, 2012


WYSIWYG Capabilities

ƒ Easy user friendly way to create page customizations. Drag and drop for positioning, Click
on field to see / set options
ƒ Supports: (Standard and Extension Fields)
ƒ Positioning of fields
ƒ Hiding fields
ƒ Making fields required
ƒ Making fields read only
ƒ Overriding field labels*
ƒ Adding tool tips*
ƒ Adding Pre Post Text*
ƒ Provides access to Value lists in that UI, and a link to add extensions
NOTE: Only users with create access to localized resources

© 2011 SAP AG. All rights reserved. 64

SAP Class Week of March 19, 2012


Access to WYSIWYG customizations

Access to these customizations is dependent on the current users access to the master
data object or Business document.

© 2011 SAP AG. All rights reserved. 65

SAP Class Week of March 19, 2012


WYSIWYG UI

© 2011 SAP AG. All rights reserved. 66

SAP Class Week of March 19, 2012


WYSIWYG actions

ƒ Field positioning – select (CLICK and HOLD) the field


and a movement indicator will appear. Drag the field to
the desired location release the mouse. Save changes

N
Note: For objects that support Document Types select the
D
Document Type to apply the changes to.

ƒ Field label and other modifications. – Click on the field


label. A small window with the available options
appears. Complete the needed modifications. Save
changes

ƒ Each save creates or modifies an actual page


customization. In cases where objects have internal
and external visibility we automatically generate the
buyside and sellside customizations.

© 2011 SAP AG. All rights reserved. 67

SAP Class Week of March 19, 2012


Limitations

ƒ By default customizations are dimensioned by type. If the user didn’t want this behavior or
dimension by another means, this requires direct modification of Page Customization

ƒ If internal and external visibility needs to be different on a document that supports both
these differences need to be maintained manually

ƒ No access to newer more advanced customizations


ƒ Object picker
ƒ Modifying content of collection displays

ƒ No access to UDO’s

ƒ No ability to perform tab label changes or tab description changes

© 2011 SAP AG. All rights reserved. 68

SAP Class Week of March 19, 2012


UI Configurations – WYSIWYG Exercises

Objective
ƒ Become familiar with general and dimensioned page customizations

Exercise 1
ƒ Create a WYSIWYG override on your assigned project type that makes the description field
a required value and changes the description label to “Project type” description

Exercise 2
ƒ Create a series of WYSIWYG actions to change the order of the first 3 fields back to where
they were originally.

© 2011 SAP AG. All rights reserved. 69

SAP Class Week of March 19, 2012


SAP Sourcing / Contract Lifecycle Mgmt
Reports and Queries
November 2011

SAP Class Week of March 19, 2012


Course Assumptions & Objectives

Assumptions
ƒ Proficient and comfortable with SQL
ƒ Basic understanding of SAP Sourcing and its use

Objectives
ƒ Gain a deeper understanding of query development in
SAP Sourcing
ƒ Learn about specific objects and how to query them
ƒ Learn tips and tricks that will assist with advanced
query development
ƒ Workshop where you can develop your own queries
with the guidance of SAP professionals

© 2011 SAP AG. All rights reserved. 73

SAP Class Week of March 19, 2012


Agenda

1. Introduction to Queries
2. SAP Sourcing Query Infrastructure
3. Reference Materials
4. Developing Queries
5. Additional Reporting Capabilities
6. Group Workshop
7. Schema Review
8. Advanced Reporting Concepts
9. Appendix
10. Common Errors
11. Customer Support Expectations

© 2011 SAP AG. All rights reserved. 74

SAP Class Week of March 19, 2012


Introduction to Queries

SAP Class Week of March 19, 2012


Introduction to Queries – Overview

ƒ Queries are a major part of SAP Sourcing as they provide customizable access to data.
SAP Sourcing Query Infrastructure

ƒ A typical query is a single SQL SELECT statement. SAP Sourcing adds powerful
functionality that enhances the query development and results presentation, and provides
the integration of the SQL statement with the application.

ƒ Key query capabilities are as follows:


ƒ Formatting (Formatting of each results column, incl. Links, Pictures, etc.)
ƒ Filtering (One or more user supplied parameters with wild card support)
ƒ Paging, Sorting and Searching (Support for sorting and searching within the returned result set)
ƒ Totaling (Ability to generate column totals while still returning detailed results)
ƒ Attribute/Token Substitution (Substitution significantly simplifies the development and enhances the
usability of common query features)
ƒ Charting (Automatic generation of various chart types from the query results)

ƒ The following slides show examples for the use of Queries in SAP Sourcing.

© 2011 SAP AG. All rights reserved. 76

SAP Class Week of March 19, 2012


Introduction to Queries – List Pages

List Pages
ƒ Queries are used to generate List Pages
ƒ Example: All Projects Query in the example below
ƒ Project Management > Projects > All Projects

© 2011 SAP AG. All rights reserved. 77

SAP Class Week of March 19, 2012


Introduction to Queries - Object Pickers

Object Pickers
ƒ Queries are used for Object Pickers
ƒ Example: “Search Organizational Units by
Name” Query in the “Organizational Unit”
picker shown below

© 2011 SAP AG. All rights reserved. 78

SAP Class Week of March 19, 2012


Introduction to Queries – Workbench Channels

Workbench Channels
ƒ Queries are used as content of Workbench Channels
ƒ Example: “My Projects” Query in the example below (“Projects List Channel”)

© 2011 SAP AG. All rights reserved. 79

SAP Class Week of March 19, 2012


Introduction to Queries – Query Groups

Query Groups (used for menus, lists, pickers and other selection areas)
ƒ Queries are part of Query Groups
ƒ Example: “All Projects” Query in the “FCI-ProjectBuyList” Group or the Query “Search
Organizational Units by Name” in the “FCI-BusinessUnitBuyPicker” Group

Query Group used on a menu Query Group used on a list Query Group used on a picker

© 2011 SAP AG. All rights reserved. 80

SAP Class Week of March 19, 2012


Introduction to Queries - Reports

Reports (used on reports tab, document reports, desktop channels)


ƒ Queries are providing the data for tables and charts in Reports
ƒ Example: “Historical Usage” Query in the example below (“Historic Usage” Report)

© 2011 SAP AG. All rights reserved. 81

SAP Class Week of March 19, 2012


Introduction to Queries – Document Reports

Document Reports (Run from Reports menu on a specific document)


ƒ Queries are providing the data for tables and charts in Document Reports
ƒ Example: “Project Schedule Summary” and “Project Schedule Extract” Queries in the
example below (“Project Schedule Extract” Report)

© 2011 SAP AG. All rights reserved. 82

SAP Class Week of March 19, 2012


Introduction to Queries - Dashboards

Dashboards
ƒ Queries are used to provide the data for Dashboards
ƒ Example: “Contract Dashboard - Search Master Agreements and Agreements” Query in the
example below (“Contract Performance” Dashboard)

© 2011 SAP AG. All rights reserved. 83

SAP Class Week of March 19, 2012


Query infrastructure

SAP Class Week of March 19, 2012


SAP Sourcing Query Infrastructure
Availability per Deployment Mode and Licensing

Capability Licensed Licensed Private Public Public


OnPremise Hosted OnDemand OnDemand OnDemand
(Premium) (Premium) (Standard)
Creation of Custom Queries Yes Yes Yes Yes* No
Creation of Custom Reports Yes Yes Yes Yes* No
Creation of Custom Dashboards Yes** Yes** Yes** Yes* No
Customization of Query Groups Yes Yes Yes Yes* No
Customization of Reports Page Yes Yes Yes Yes Yes
Customization of Document Report Yes Yes Yes Yes Yes
Toolbar
Creation of Report Channels Yes Yes Yes Yes Yes

* Requires additional service from SAP Service Delivery since the Key User is not authorized to perform these tasks themselves
in the Public Edition.

** SAP Business Objects Dashboard Design tool is required to adjust Dashboards

© 2011 SAP AG. All rights reserved. 85

SAP Class Week of March 19, 2012


SAP Sourcing Query Infrastructure – Setup (1/2)

Most of the elements of the SAP Sourcing Query Infrastructure can be configured in the Setup
> System Setup > Queries and Reports

The availability of some of the links (e.g. Query Definitions, Query Groups, etc.) is depending
on (tenant) security settings.

© 2011 SAP AG. All rights reserved. 86

SAP Class Week of March 19, 2012


SAP Sourcing Query Infrastructure – Setup (2/2)

ƒ Document Reports are configured in the Setup > Document Setup > General > Document
Report Configurations.

ƒ Desktop Channels are configured in the Setup > System Setup > Workbench > Desktop
Channels

© 2011 SAP AG. All rights reserved. 87

SAP Class Week of March 19, 2012


SAP Sourcing Query Infrastructure – Query Definition

Query Definition
ƒ Includes annotated SQL (or calls stored procedures), results, filters, chart details
ƒ Allows you to Preview (NOTE: Charts not shown in preview)

© 2011 SAP AG. All rights reserved. 88

SAP Class Week of March 19, 2012


SAP Sourcing Query Infrastructure - Report

Report
ƒ Collection of report elements, which can be queries or dashboards
ƒ Used on reports tab, document reports, or desktop channels
ƒ Can be emailed to users

© 2011 SAP AG. All rights reserved. 89

SAP Class Week of March 19, 2012


SAP Sourcing Query Infrastructure – Report (Setup)

Setup > System Setup > Queries and Reports > Reports

Report Elements Tab


ƒ Used to add query definitions and Xcelcius definitions to a
report and to reorder the display of the report results.

Reports Page Layout Tab


ƒ Definition of the default layout of a report page when it is
viewed as a PDF. This is not applicable to an Xcelsius
definition.
ƒ Changing the page layout will override both the hard-coded
defaults and the report pages' system properties for this report.

Reports Access List Tab


ƒ List of users, groups and companies who are authorized to
edit and/or execute the report

© 2011 SAP AG. All rights reserved. 90

SAP Class Week of March 19, 2012


SAP Sourcing Query Infrastructure – Query Group

Query Group
ƒ Collection of Query Definitions
ƒ Used for Menus, List Pages, Pickers and other selection areas

© 2011 SAP AG. All rights reserved. 91

SAP Class Week of March 19, 2012


SAP Sourcing Query Infrastructure
Query Group (1/3)

Setup > System Setup > Queries and Reports > Query Group

Standard Query Groups are available for all business objects. Leaving no need to create
custom query groups

Custom Queries can be to added to a standard Query Group and optionally replace standard
queries

Query Groups are used for different purposes depending on the value of the their “Query Use”
field (see next slide for more details)

In general, the internal names of the query groups follow a pattern:


ƒ *buypick* - Buyside pickers
ƒ *buylist* - Buyside lists
ƒ *sellpick* - Sellside pickers
ƒ *selllist* - Sellside lists

© 2011 SAP AG. All rights reserved. 92

SAP Class Week of March 19, 2012


SAP Sourcing Query Infrastructure
Query Group – Setup (2/3)

Query Use: List


ƒ Every business object has one query group of
type List which is used to bundle queries which
are used to display the business object on list
pages with varying result fields and filter
parameters.

Query Use: Picker


ƒ Every business object has one query group of
type Picker which is used to bundle queries
which are used to display the business object on
Object Pickers

Query Use: Selection


ƒ Every business object can have multiple query
groups of type Selection. Those query groups
are used for special purposes like object
migration and export or as menu entries and
should generally not be customized.

© 2011 SAP AG. All rights reserved. 93

SAP Class Week of March 19, 2012


SAP Sourcing Query Infrastructure
Query Group – Setup (3/3)

Adding Custom Queries to Standard Query Groups


ƒ Default Query – Query which will be executed on lists or pickers by default
ƒ Use for auto complete – Query which will be used for auto completion in pickers (user types
in the picker field, rather than opening up the picker window)
ƒ Remove Query From Selection List – Queries can not be selected by the end user. Often
used to replace standard queries with custom queries by removing the standard query
ƒ Include in SRM Navigation – Queries are listed in the navigation menu

© 2011 SAP AG. All rights reserved. 94

SAP Class Week of March 19, 2012


SAP Sourcing Query Infrastructure – Reports Page

Reports Page (Analysis Reports Setup)


ƒ Setup your own sections
ƒ Attach reports

© 2011 SAP AG. All rights reserved. 95

SAP Class Week of March 19, 2012


SAP Sourcing Query Infrastructure
Reports Page – Setup (1/2)

ƒ Setup > System Setup > Queries and Reports > Analysis Reports Setup

ƒ The content of the reports page is implemented as a hierarchy with sections and groupings
(categories, subcategories)

Main Category

Sub Category 1

© 2011 SAP AG. All rights reserved. 96

SAP Class Week of March 19, 2012


SAP Sourcing Query Infrastructure
Reports Page – Setup (2/2)

Sub Category 2

ƒ The actual reports are items of sub category 2

Categories of all levels are only appearing in the UI if they are containing reports which are not
hidden and can be accessed by the current user

© 2011 SAP AG. All rights reserved. 97

SAP Class Week of March 19, 2012


SAP Sourcing Query Infrastructure – Document Report

Executed from the “Reports” toolbar within a business object


ƒ Add new reports to the toolbar
ƒ Remove or hide existing reports

© 2011 SAP AG. All rights reserved. 98

SAP Class Week of March 19, 2012


SAP Sourcing Query Infrastructure
Document Report – Setup (1/2)

ƒ Setup > Document Setup > General > Document Report Configuration
ƒ The Document Report Configuration is used to manage the list of reports that appears in
the dropdown list for the Reports toolbar.
ƒ Locate and click the link for the business object whose reports should be customized (e.g.
“Project Document Report Configuration” to customize the report toolbar for Projects.

© 2011 SAP AG. All rights reserved. 99

SAP Class Week of March 19, 2012


SAP Sourcing Query Infrastructure
Document Report – Setup (2/2)

ƒ Use “Add [Internal/External] Report” to add (custom) reports to the report menu which will
be available for internal (buy-side) or external (sell-side) users.
ƒ Check “Open New Window” to open a report in a new (popup) Window
ƒ This option should not be used when the report has links to further reports or documents. Links
typically require breadcrumbs, but breadcrumbs are not supported in a popup window.
ƒ Use “Hidden” to hide (standard) reports

© 2011 SAP AG. All rights reserved. 100

SAP Class Week of March 19, 2012


SAP Sourcing Query Infrastructure -
Workbench Channels
Queries and Reports are mainly used in two type of channels
ƒ Report Channel (left side of screen)
ƒ List Page Channel (right side of screen)

© 2011 SAP AG. All rights reserved. 101

SAP Class Week of March 19, 2012


SAP Sourcing Query Infrastructure
Workbench Channels – Report Channel
ƒ The reports which is shown in channel is often a summary, just a chart or contains data
which is optimized for the width of a channel. In addition it may limit the number of visible
rows to fit all data in the channel without scrolling.

ƒ “More Details” is linking to a second report which will be opened using the entire screen
size. Most often containing the same data but with more details (columns) and/or more
rows.

ƒ 4 Customizable Report Channels are delivered by default (“Report 1” to “Report 4”).


Additional ones can be created using Setup > Desktop Channel

© 2011 SAP AG. All rights reserved. 102

SAP Class Week of March 19, 2012


SAP Sourcing Query Infrastructure
Workbench Channels – List Page Channel

ƒ Using queries out of the “List” query group of business objects


ƒ Provides
ƒ Saved Search capability
ƒ Filter Parameter customization
ƒ Actions like “New”
ƒ Search within the result set
ƒ Sorting
ƒ Column personalization

© 2011 SAP AG. All rights reserved. 103

SAP Class Week of March 19, 2012


SAP Sourcing Query Infrastructure
Relationship between infrastructure key elements
Refers to 1
Desktop or more Workbench
Channel Page

Refers to 1 Analysis
Page

Refers to 1 or more

Document
Report
Refers to 1 or more Report
Has 1 or more

Picker
Has 1 or more
Query Query Is of type
Definition Group
List Page
L

© 2011 SAP AG. All rights reserved. 104

SAP Class Week of March 19, 2012


Exercise Note

The following 3 exercises require that users edit the same object (e.g.,
analysis reports setup). As a result, it is recommend that some students
begin with exercise 1, some with exercise 2, and some with exercise 3. this
will limit the delays while students wait for other students to complete their
changes.

© 2011 SAP AG. All rights reserved. 105

SAP Class Week of March 19, 2012


Exercise 1

Objective
ƒ Familiarize yourself with the Query Definition, Report,
and Analysis objects

Exercise
ƒ Find the Query Definition named: FCI-ProjectSummary
ƒ Duplicate the Query Definition – You will need to enter
the Internal Name
ƒ Add the Query Definition to a new Report
ƒ Add the Report to the Reports Page

© 2011 SAP AG. All rights reserved. 106

SAP Class Week of March 19, 2012


Exercise 2

Objective
ƒ Familiarize yourself with the Query
Definition and Query Group

Exercise
ƒ Find the Query Definition named: FCI-
DocProject
ƒ Duplicate the Query Definition, giving it a
new display name (new localized
resource)
ƒ Add the Query Definition to the FCI-
ProjectBuyList Query Group
ƒ Hide the SAP Sourcing standard FCI-
DocProject (only 1 student will be able to
do this
ƒ View the Projects list to see the new query
used

© 2011 SAP AG. All rights reserved. 107

SAP Class Week of March 19, 2012


Exercise 3

Objective
y Familiarize yourself with the Query Definition, Reports,
and Document Report Configuration

Exercise
y Find the Query Definition named: FCI-
ProjectScheduleExtract
y Duplicate the Query Definition
y Add the Query Definition to a new Report
y Find the Project Document Report Configuration
y Add the new Report to the Project Document Report
Configuration
y View the report in a Project (NOTE: The project must
have a schedule for the report to be useful)

© 2011 SAP AG. All rights reserved. 108

SAP Class Week of March 19, 2012


Exercise Review

ƒ Query Definition

ƒ Query Groups

ƒ Reports

ƒ Document Report Configuration

© 2011 SAP AG. All rights reserved. 109

SAP Class Week of March 19, 2012


Reference Material
Queries

SAP Class Week of March 19, 2012


Reference Materials

Reference Guide
ƒ Access via “Reference Guide” Link
ƒ Class Reference
ƒ Lists ALL classes
ƒ Enables navigation from class to class
ƒ Shows database schema and column types
ƒ Includes class id (number) and logical name (string) that are used in classes
ƒ Database ERD

Demonstrate reference guide and information available in it

© 2011 SAP AG. All rights reserved. 111

SAP Class Week of March 19, 2012


Reference Materials

On-Line Help
ƒ Access via “Help” Link or via SAP Help Portal
http://help.sap.com/content/documentation/sbs/docu_sbs_esourcing.htm
ƒ Guide

Browse Full Schema


ƒ Setup > System Setup > Queries and Reports > Browse Full Schema

Browse Extension Schema


ƒ Setup > System Setup > Queries and Reports > Browse Extension Schema

© 2011 SAP AG. All rights reserved. 112

SAP Class Week of March 19, 2012


Exercise 4

Objective
ƒ Familiarize yourself with the RG

Exercise
ƒ Find the table name for Projects
ƒ Identify the table name to which the
Internal Category data member refers
ƒ Find the class logical name for RFxs
ƒ Find the class id for Vendors

© 2011 SAP AG. All rights reserved. 113

SAP Class Week of March 19, 2012


Exercise 4 - Solution

Objective
ƒ Familiarize yourself with the RG

Exercise
ƒ Find the table name for Projects:
ƒ FCI_PRO_PROJECTS
ƒ Identify the table name to which the Internal Category data member refers
ƒ FCI_MAS_INTERNAL_CAT
ƒ Find the class logical name for RFxs
ƒ rfx.RFXDoc
ƒ Find the class id for Vendors
ƒ 607

© 2011 SAP AG. All rights reserved. 114

SAP Class Week of March 19, 2012


Developing Queries

SAP Class Week of March 19, 2012


Developing Queries - Query Definition key Components

Query
ƒ SQL statement to be executed. Includes query attributes for advanced capabilities

Result Fields
ƒ Definition of result fields and their visibility and sort order

Filter Prompts
ƒ Definition of filter prompts

Chart Definition
ƒ Definition of chart(s)

Access List
ƒ List of users, groups and companies who are authorized to edit and/or execute the query

© 2011 SAP AG. All rights reserved. 116

SAP Class Week of March 19, 2012


Developing Queries – Query Definition (Query Tab)

ƒ Inactive – Indicates whether query is active or not


ƒ Display Name – The name that will be displayed in the user interface when the query is
executed
ƒ Internal Name – Unique identifier for the query. Typically a word with no spaces and
starting with CUSTOM- (e.g., CUSTOM-ProjectsByOwner)
ƒ Description – A description of the query
ƒ Query String – The annotated SQL for the query
ƒ Stored Procedure – Indicates whether the query string is using a stored procedure
ƒ Execution Type – Always choose SQL. It means that the specified SQL statement defined
in the Query String will be executed
ƒ Max Rows Returned – The maximum number of rows returned by the query – assists with
performance if the query potentially will return a lot of rows
ƒ Rows Per Page – The number of result rows that will be displayed per page
ƒ Category – A categorization of the query (no logic dependent on this)
ƒ Workbook Template – An Excel spreadsheet template used for Export Excel capability
ƒ Java Hooks – Only show for Java queries. For SAP use only.

Open query with name FCI-ProjectActivityByPhaseChart and show query tab

© 2011
1 SAP
S AG
AG. All rights reserved. 117

SAP Class Week of March 19, 2012


Developing Queries – Query Definition
Result fields (Column Type independent)

Database Column Name – The SQL for the column (can be a simple column name, a complex
sub-select, or anything in between)

Column ID – Unique identifier of a column


ƒ The Column ID is the same as the Database Column Name field when the database
column name is a simple column name
ƒ Use a unique string for all other column definitions (e.g. SQL functions, static values, etc.)

Database Column Name


Examples: Column ID Usage
T1.DISPLAY_NAME T1.DISPLAY_NAME Simple column name
607 AS CLASSID ClassId Static value for all rows
UPPER(T1.DISPLAY_NAME) UpperDisplayName Column name with formatting
Concatenated values, with the
T1.LAST_NAME <%+%>
FullName FIRST_NAME column value not
COALESCE(T1.FIRST_NAME,'')
required
COALESCE(T1.TOTAL_EXPECTED_PRICE, 0) TotalExpectedPrice Define a value to use for null data
SUM(COALESCE(T1.TOTAL_EXPECTED_PRIC
SumTotalExpectedPrice SQL sum function
E, 0))

© 2011 SAP AG. All rights reserved. 118

SAP Class Week of March 19, 2012


Developing Queries - Query Definition
Result Fields (Column Type independent)

ƒ Display indicator – Allows fields to be hidden (useful when wanting to setup special
columns for sort order)
ƒ Column Header Resource – The string displayed for the column in the result set
ƒ Hide column header – Allows column headers to be hidden (recommended for columns
that contain some action icons, like Delete or Edit)
ƒ Column Type – The type of data being returned (also specialized column types for drill
downs, hyperlinks, etc.)
ƒ Repeating Column – Columns with this indicator in a pivot query will be expanded to
multiple columns
ƒ Default Display – Indicates whether this column will be displayed to the end user by
default
ƒ Sort Order – Indicates the number within the sort for this column only applies when the
<%ORDERBY%> token is part of the Query String.
ƒ Ascending Indicator – Indicates whether the sorting direction should be ascending or
descending

© 2011 SAP AG. All rights reserved. 119

SAP Class Week of March 19, 2012


Developing Queries - Query Definition
Result Fields (Column Type dependent)

ƒ Display Widths – Width of the table column in either characters or pixels


ƒ Applies to all but Quantity Unit Object ID, Class ID, Object ID, Monetary Currency
ƒ Show Image – Display of an image together or instead of the value being returned
ƒ Applies to String, String Resource, Enumeration, URL
ƒ Resolve Token(s) in Value – Indicates that the value of the string field in the query results
might contain one or more tokens that must be resolved.
ƒ Applies to String, String Resource, URL
ƒ Total Indicator – Used for numeric columns – allows for totals on the page
ƒ Applies to Number, Monetary Amount, Quantity Amount
ƒ Show Seconds – Include seconds along with hours and minutes in the formatted time
value
ƒ Applies to DateTime, Time
ƒ Convert Scale To – Allows reduction of decimal places
ƒ Applies to Number
ƒ Link Image Source – A way to have an image displayed in the results (e.g., red, yellow,
green indicator)
ƒ Applies to URL

© 2011 SAP AG. All rights reserved. 120

SAP Class Week of March 19, 2012


Developing Queries Query Definition
Result Fields (Column Type dependent)

ƒ Enum Type Name


ƒ Applies to Enumeration
ƒ Currency Conversion Source
ƒ Applies to Monetary Currency
ƒ Conversion Unit
ƒ Applies to Quantity Unit Display Name
ƒ Dimension ID – Used in Spend Reports – not covered
today
ƒ Applies to String, Date

Open query with name FCI-


ProjectActivityByPhaseChart and show results tab

© 2011 SAP AG. All rights reserved. 121

SAP Class Week of March 19, 2012


Developing Queries
Query Definition – The SQL
ƒ Query Strings will commonly be structured like:
SELECT <%RESULTS%>
FROM <%SCHEMA%>.TABLE1 T1, <%SCHEMA%>.TABLE2 T2
WHERE T2.PARENT_OBJECT_ID = T1.OBJECTID
AND UPPER(T1.DISPLAY_NAME) LIKE <%?(ParameterName)%>
AND T1.INACTIVE = 0 AND T1.IS_TEMPLATE = 0
AND T1.CONTEXTID = <%CONTEXT(class.logical.name)%>
<%ORDERBY%>

ƒ <%RESULTS%> token will be replaced by SQL generated based on the defined result
fields
ƒ <%SCHEMA%> token ensures that the proper database schema is used
ƒ <%?(ParameterName)%> token refers to the filter prompt with the defined parameter name
(value of the Column ID field)
ƒ <%ORDERBY%> token enforces desired ordering as defined on the Result Fields tab
ƒ Ensure that each table is joined to avoid Cartesian joins
ƒ Filter out Cancelled and Closed documents with INACTIVE = 0
ƒ Filter out document templates with IS_TEMPLATE = 0
ƒ Ensure documents from the correct context are included with <%CONTEXT%> token
ƒ Use UPPER to allow filtering to be case-insensitive. Also make sure to check “Convert to
Upper Case” for the Query Parameter.
© 2011 SAP AG. All rights reserved. 122

SAP Class Week of March 19, 2012


Exercise 5

Objective
ƒ Create a basic query

Exercise
ƒ Create and preview a query
definition for Projects that
retrieves the project name

© 2011 SAP AG. All rights reserved. 123

SAP Class Week of March 19, 2012


Exercise 5 - Solution
Query Header

© 2011 SAP AG. All rights reserved. 124

SAP Class Week of March 19, 2012


Exercise 5 - Solution

Query Result Fields


and Details

© 2011 SAP AG. All rights reserved. 125

SAP Class Week of March 19, 2012


Developing Queries
Query Definition – Include Extensions

The query string must include the extension table


ƒ <%EXT_TABLE(projects.projects)%> T3
OR
ƒ <%EXT_TABLE(projects.projects,CollectionName)%> T4

The extension table must be joined


ƒ T3.PARENT_OBJECT_ID = T1.OBJECTID (no outer join required)
OR
ƒ <%EXT_TABLE(projects.projects, CollectionName)%> T4 RIGHT OUTER JOIN
<%SCHEMA%>.FCI_PRO_PROJECTS T1 ON (T4.PARENT_OBJECT_ID =
T1.OBJECTID)

Column names can be found in Browse Extension Schema (they don’t always match the
extension attribute internal name)

© 2011 SAP AG. All rights reserved. 126

SAP Class Week of March 19, 2012


Exercise 6

Objective
ƒ Create a query using an extension table

Exercise
ƒ Modify the query created in Exercise 5
adding in a string extension field
(PROContractor) to the result set

© 2011 SAP AG. All rights reserved. 127

SAP Class Week of March 19, 2012


Exercise 6 – Solution

Query

© 2011 SAP AG. All rights reserved. 128

SAP Class Week of March 19, 2012


Exercise 6 – Solution

Result Fields
and Details

© 2011 SAP AG. All rights reserved. 129

SAP Class Week of March 19, 2012


Developing Queries
Query Definition – SQL Common Patterns

Basic join concepts and keys


ƒ Schema is generated automatically using advanced development tools
ƒ Most tables have common columns due to the object oriented nature of the application

Key columns
ƒ OBJECTID
ƒ Numeric identifier for this object
ƒ CONTEXTID
ƒ SAP Sourcing has the concept of multiple enterprises being able to reside in the same Oracle
database
ƒ Used in where clause with <%CONTEXT()%> token
ƒ UNIQUE_DOC_NAME
ƒ Unique key for the object
ƒ In many cases this is automatically generated by a numbering table or some other mechanism
ƒ DISPLAY_NAME
ƒ Human readable name for object

© 2011 SAP AG. All rights reserved. 130

SAP Class Week of March 19, 2012


Developing Queries
Query Definition – SQL Common Patterns (continued)

Key columns (cont.)


ƒ IS_TEMPLATE
ƒ For those objects that are template based indicates that the object is a template when set to 1.
Normally your queries will have a selection criteria with this set to 0 (no templates)INACTIVE
ƒ Other than legal documents SAP objects are not deleted from the system. They can be hidden by
marking them as inactive. When this column is set to 1 it means the object is in an inactive state.
Normally queries will have a selection criteria with this set to 0 (only active objects)
ƒ PARENT_OBJECT_ID
ƒ If the object is a subordinate, RFx Vendors as an example, this column contains the parent’s objectid.
ƒ XXXX_OBJECT_ID
ƒ If the object has a reference to another object these columns will contain that object’s objectid. XXXXX
will give you a hint as to what other object it is referring. LOCATION_OBJECT_ID as an example
refers to a location object

© 2011 SAP AG. All rights reserved. 131

SAP Class Week of March 19, 2012


Developing Queries
Query Definition – Filter Prompts

ƒ Parameter Name
ƒ A string with no spaces. If the same name is used multiple times, the parameter will only be displayed
once
ƒ Prompt Message Resource
ƒ The string the user will see next to the prompt in the user interface
ƒ Default Value
ƒ The default value for the prompt (has specialized value when doing Object Reference prompts)
ƒ Get Token
ƒ Use data from the current or parent business object as default value
ƒ Data Type
ƒ The type of prompt field
ƒ Value List Type
ƒ For value list prompts, indicates which value list to use
ƒ Default Operator
ƒ Default operator used for this parameter

© 2011 SAP AG. All rights reserved. 132

SAP Class Week of March 19, 2012


Developing Queries - Query Definition
Filter Prompts (Checkbox Options)

ƒ Convert to Upper Case – Used for case insensitive comparison


ƒ Prefill value from Cache – Always check
ƒ Optional – Typically used with <%AND_OP()%> token
ƒ Hidden – The prompt is hidden from the user (typically used on drilldown reports or hard-
coded prompts)
ƒ Locked – The prompt cannot be changed by the user (typically used on drill down reports)
ƒ Show By Default – Indicates that this filter parameter should be included in a search in the
Advanced List page by default
ƒ Fixed Operator – The operator can not be changed by the end user (applies to list page
queries only)

Open query with name FCI-ProjectActivityByPhaseChart and show filters tab

© 2011 SAP AG. All rights reserved. 133

SAP Class Week of March 19, 2012


Developing Queries
Query Definition – Filter Prompts

ƒ Filter prompts allow the results of the query to be limited

ƒ Filter prompts are typically going to be used by a user, but can be “hard-coded”

ƒ Basic filter prompt data types:


ƒ String, Integer, Big Decimal, Date, Date Time, and Boolean

ƒ Advanced filter prompt data types:


ƒ Value List: Must choose the list to use
ƒ Enumeration: Must choose the enumeration type
ƒ Object Reference: The Default Value must be of the form:
ƒ NULL:<class id>:NULL
ƒ For example, to have a Vendor object reference filter, the default value would be:
ƒ NULL:607:NULL

© 2011 SAP AG. All rights reserved. 134

SAP Class Week of March 19, 2012


Exercise 7

Objective
ƒ Add an object reference filter to a query

Exercise
ƒ Modify the query created in Exercise 5/6,
adding in a Filter Prompt of type Object
Reference to filter for projects by the owner
(a user)

© 2011 SAP AG. All rights reserved. 135

SAP Class Week of March 19, 2012


Exercise 7 – Solution

Query

© 2011 SAP AG. All rights reserved. 136

SAP Class Week of March 19, 2012


Exercise 7 – Solution

Filter Prompt and Details

© 2011 SAP AG. All rights reserved. 137

SAP Class Week of March 19, 2012


Developing Queries - Query Definition
Optional Filter Prompts (“AND” Token)

ƒ Execution:

SQL: <%AND("UPPER(T1.DISPLAY_NAME) LIKE <%?(DisplayName)%>")%>


ƒ Filter Prompt:

ƒ Check “Convert to Upper Case” to enable case insensitive comparison


ƒ Check “Optional”
ƒ Check “Fixed Operator”, it is mandatory for this token

© 2011 SAP AG. All rights reserved. 138

SAP Class Week of March 19, 2012


Developing Queries - Query Definition
Optional Filter Prompts (“AND_OP” Token)
ƒ Execution:

SQL: <%AND_OP("UPPER(T1.DISPLAY_NAME)",<%?(DisplayName)%>)%>
ƒ Filter Prompt:

ƒ Check “Convert to Upper Case” to enable case insensitive comparison


ƒ Check “Optional”
ƒ Uncheck “Fixed Operator” to let the end user choose the operator
© 2011 SAP AG. All rights reserved. 139

SAP Class Week of March 19, 2012


Developing Queries - Query Definition
Token Review

Online Help
ƒ SAP Sourcing > Setup > System Setup > Queries and Reports > Query Definition: Attribute
Substitution

Show the online help and tokens

© 2011 SAP AG. All rights reserved. 140

SAP Class Week of March 19, 2012


Developing Queries - Review

ƒ What is a Class Id? Class Name? Where are these used?


ƒ What are extensions?
ƒ What token is used to access an extension table?
ƒ How many extension tables will an object (e.g., projects) have?
ƒ Name a place where the end-user will access a report?
ƒ What are the key objects used to configure reports?
ƒ Name a place where the query developer will go to get assistance on the database
schema?
ƒ What naming conventions are used? How does this help?
ƒ What is a localized resource? How is it used?

© 2011 SAP AG. All rights reserved. 141

SAP Class Week of March 19, 2012


Additional Reporting Capabilities

SAP Class Week of March 19, 2012


Additional Reporting Capabilities
Query Definition – Linking to an Object

Three columns must be created in the results fields of the query


ƒ Object ID T1.OBJECTID
ƒ Class ID 1100 (1100 = Project)
ƒ Display Name T1.DISPLAY_NAME

Alternative: the LOAD_PAGE token can be utilized, but is not commonly used

Show the FCI-AllProjects query for an example

© 2011 SAP AG. All rights reserved. 143

SAP Class Week of March 19, 2012


Additional Reporting Capabilities
Query Definition – Using Aggregate functions

Group By can be used in a query along with aggregate functions:


ƒ MIN
ƒ MAX
ƒ COUNT
ƒ SUM

Example:
SELECT T1.DISPLAY_NAME, COUNT(T2.OBJECTID) FROM FCI_RFX_DOC T1,
FCI_RFX_VENDOR T2 WHERE T2.PARENT_OBJECT_ID = T1.OBJECTID GROUP BY
T1.DISPLAY_NAME

© 2011 SAP AG. All rights reserved. 144

SAP Class Week of March 19, 2012


Exercise 8

Objective
ƒ Create a query using an aggregate function
ƒ Use the string concatenation token

Exercise
ƒ Create a project query that has two columns:
ƒ Project Status, including the total number of projects in that status
ƒ Value: the sum of all projects in the status
ƒ The results will look like:

© 2011 SAP AG. All rights reserved. 145

SAP Class Week of March 19, 2012


Exercise 8 – Solution

Query

© 2011 SAP AG. All rights reserved. 146

SAP Class Week of March 19, 2012


Exercise 8 – Solution

Result Fields

© 2011 SAP AG. All rights reserved. 147

SAP Class Week of March 19, 2012


Additional Reporting Capabilities
Report Drill Downs

ƒ Report drill downs are very useful for allowing navigation to increasing levels of detail
ƒ For example, a summary report may show the total number of projects by category.
Clicking on the number of projects (a drill down) could show a listing of the individual
projects

Show the RFx Summary Report by Workflow Phase report (Enterprise Sourcing WB)

ƒ Report drill downs are formed using two query columns


ƒ URL: This will be the string displayed to the user which will be hyperlinked.
ƒ Internal Page: This will be a string result that forms the actual URL. For a drill down report, it will look
like:
‘/analysis/report?queryGroupName=<name>&<parameter>=<value>&<%SOURCE_OBJREF_PAR
AM%>&link_crumb=true’
ƒ For example:
‘/analysis/report?queryGroupName=CUSTOM-DrillDown&Category=‘ ||
T1.INTERNAL_CAT_OBJECT_ID || ‘:603:’ || T1.INTERNAL_CAT_OBJECT_NAME ||
‘&<%SOURCE_OBJREF_PARAM%>&link_crumb=true’

© 2011 SAP AG. All rights reserved. 148

SAP Class Week of March 19, 2012


Additional Reporting Capabilities
Charting-Overview

ƒ SAP Sourcing supports various chart types (Variations of Bars, lines, Pies, Radars)

ƒ Charts are possible through a Chart Definition

Show the RFx Summary Report by Workflow Phase report (Enterprise Sourcing WB)

© 2011 SAP AG. All rights reserved. 149

SAP Class Week of March 19, 2012


Additional Reporting Capabilities
Charting - Overview
ƒ Chart Definitions can be added to the Query Definition which provides for a user selectable
drop down
ƒ Query Definitions can be associated with a Report
ƒ Reports can be shown in various UI elements such as Desktop Channels or Report pages

Desktop
Report
Channel

Query
Query
Definitions
Query
Definitions
Definitions

Chart
Charts Chart
Charts Definitions
Chart
Charts Definitions
Definitions

© 2011 SAP AG. All rights reserved. 150

SAP Class Week of March 19, 2012


Additional Reporting Capabilities
Charting - Features

ƒ 2 different formats of charts: Flash and Jpeg image


ƒ Runtime selection of charts and chart definition on a
Report
ƒ User Personalization of charts
ƒ Drill down on charts
ƒ Export to PDF
ƒ Linear and Logarithmic scaling mode
ƒ Support of 2 dimension charts
ƒ SAP Standard and SAP Business Objects Flash based
color palettes
ƒ 12 different types of charts

© 2011 SAP AG. All rights reserved. 151

SAP Class Week of March 19, 2012


Additional Reporting Capabilities
Charting

ƒ Charts do not show during query definition preview


ƒ Charts are developed over a single numeric value
ƒ Data must be a numeric column
ƒ Data Labels and Series must be Strings
ƒ Series provide additional dimensions
ƒ Developer must sort and group the results of the query
for the chart
ƒ Developer must specify the max number of data points
ƒ Data over this max this can be bucketed into an
“Other” category

© 2011 SAP AG. All rights reserved. 152

SAP Class Week of March 19, 2012


Additional Reporting Capabilities
Charting – Chart Definition

ƒ Chart Type
ƒ Chart types in this drop down are dynamically shown
based on the selection of two combinations:
ƒ 1 dimension, 1 measure
ƒ 2 dimensions, 1 measure
ƒ Chart selected here would be treated as default chart.
Multiple chart types would be shown at run time and end
users can change from the default chart to the chart of
there choice.
ƒ Disable Multiple Chart Selection
ƒ Users can not change the chart type
ƒ Column Containing Label for Data
ƒ The non numeric result fields defined in the query. This is
default dimension.
ƒ Column Containing Data
ƒ The column which provides the numeric data for the chart
elements. This is a measure.
ƒ Each row in the result set that does not have a value for the
data column will not be represented in the chart. If none of
the rows has a value for the data column, the chart is
suppressed.
© 2011 SAP AG. All rights reserved. 153

SAP Class Week of March 19, 2012


Additional Reporting Capabilities
Charting – Chart Definition

ƒ Maximum Number of Data Points


ƒ Maximum number of data points to be used in the chart
ƒ Use “Other” Category and Sort Data
ƒ This field is used if the number of rows returned exceeds the value in
the “Maximum Number of Data Points” field. Check to aggregate the
additional rows into a single “Other” category in the chart.
ƒ Column Containing Label for Series
ƒ The Result Field column used to label the series elements. This is
another dimension value.
ƒ Maximum Number of Series
ƒ Maximum number of series to be used in the chart.
ƒ Use “Other” Series and Sort Data
ƒ Same as above for “Maximum Number of Series”
ƒ Legend
ƒ None: Suppresses the legend.
ƒ East: Displays the legend at the right edge of the chart.
ƒ Scaling Mode
ƒ Linear: Useful when the data covers a small range of values for e.g. 1
to 50 in the division of 1, 2, 3, 4, etc.
Logarithmic: Helpful when the data covers a large range of values

© 2011 SAP AG. All rights reserved. 154

SAP Class Week of March 19, 2012


Additional Reporting Capabilities
Charting - Example

Developer must organize the


result to fit the chart
ƒ If I want Project’s budgeted value
by Status I will SUM the value and
GROUP BY status. (example)
ƒ If I want Project’s budgeted value,
by Status and Priority I would
include the priority in the GROUP
BY condition. (example)

© 2011 SAP AG. All rights reserved. 155

SAP Class Week of March 19, 2012


Schema review

SAP Class Week of March 19, 2012


Schema Review
Vendor

Key tables
ƒ FCI_MAS_VENDOR
ƒ FCI_MAS_CONTACT

Interesting columns
ƒ EXTERNAL_ID is the primary key and also refers to the SAP number

Joins
ƒ FCI_MAS_CONTACT.PARENT_OBJECT_ID Æ FCI_MAS_VENDOR.OBJECTID

© 2011 SAP AG. All rights reserved. 157

SAP Class Week of March 19, 2012


Schema Review
RFX

Key tables
ƒ FCI_RFX_DOC
ƒ FCI_RFX_VENDOR
ƒ FCI_RFX_RESPONSE
ƒ FCI_ONT_LINE_ITEM

Interesting columns
ƒ FCI_RFX_DOC.CURRENT_PHASE is an enum
ƒ FCI_RFX_DOC. DUE_DATE_DATETIME

Joins
ƒ FCI_RFX_VENDOR.PARENT_OBJECT_ID Æ FCI_RFX_DOC.OBJECTID
ƒ FCI_RFX_RESPONSE.PARENT_OBJECT_ID Æ FCI_RFX_DOC.OBJECTID
ƒ FCI_ONT_LINE_ITEM.PARENT_OBJECT_ID Æ FCI_RFX_DOC.OBJECTID

© 2011 SAP AG. All rights reserved. 158

SAP Class Week of March 19, 2012


Schema Review
Contract

Key tables
ƒ FCI_CONTRACT – Master Agreement
ƒ FCI_AGREEMENT – Sub Agreement
ƒ FCI_CONTRACT_LINEITEM – Line items (for both objects)

Interesting columns
ƒ VENDOR_OBJECT_NAME – Vendor
ƒ EFFECTIVE_DATE_DATE
ƒ EXPIRATION_DATE_DATE

Joins
ƒ FCI_AGREEMENT.PARENT_OBJECT_ID --> FCI_CONTRACT.OBJECTID
ƒ FCI_CONTRACT_LINEITEM.PARENT_CLASS_ID = xxx AND
FCI_CONTRACT_LINEITEM.PARENT_OBJECT_ID = yyy.OBJECTID

© 2011 SAP AG. All rights reserved. 159

SAP Class Week of March 19, 2012


Schema Review
Auction

Key tables
ƒ FCI_AUCT_AUCTION_EVENT
ƒ FCI_AUCT_BIDDERS
ƒ FCI_AUCT_LINE_ITEMS

Joins
ƒ FCI_AUCT_BIDDERS.PARENT_OBJECT_ID ->
FCI_AUCT_AUCTION_EVENT.OBJECTID
ƒ FCI_AUCT_LINE_ITEMS.PARENT_OBJECT_ID ->
FCI_AUCT_AUCTION_EVENT.OBJECTID

© 2011 SAP AG. All rights reserved. 160

SAP Class Week of March 19, 2012


Schema Review
Project

Key tables
ƒ FCI_PRO_PROJECTS
ƒ FCI_PRO_SCHEDITEMS
ƒ FCI_PRO_VENDOR

Interesting columns
ƒ FCI_PRO_PROJECTS.PLANNED_xxx_DATE
ƒ FCI_PRO_PROJECTS.ACTUAL_xxx_DATE
ƒ FCI_PRO_VENDOR.VENDOR_OBJECT_NAME
ƒ FCI_PRO_SCHEDITEMS.DISPLAY_NAME

Joins
ƒ FCI_PRO_SCHEDITEMS.PARENT_OBJECT_ID Æ FCI_PRO_PROJECTS.OBJECTID
ƒ FCI_PRO_VENDOR.PARENT_OBJECT_ID Æ FCI_PRO_PROJECTS.OBJECTID

© 2011 SAP AG. All rights reserved. 161

SAP Class Week of March 19, 2012


Schema Review
Common Tables

Key tables
ƒ FCI_DOC_LINK
ƒ FCI_DOC_COLLABORATOR

Interesting columns
ƒ PARENT_CLASS_ID: Identifies class that a record is used with

Joins
ƒ FCI_DOC_LINK.PARENT_CLASS_ID = xxx AND FCI_DOC_LINK.PARENT_OBJECT_ID =
yyy.OBJECTID
ƒ FCI_DOC_COLLABORATOR.PARENT_CLASS_ID = xxx AND
FCI_DOC_COLLABORATOR.PARENT_OBJECT_ID = yyy.OBJECTID

© 2011 SAP AG. All rights reserved. 162

SAP Class Week of March 19, 2012


Review

ƒ What is a Class Id? Class Name? Where are these used?


ƒ What are extensions?
ƒ What token is used to access an extension table?
ƒ How many extension tables will an object (e.g., projects) have?
ƒ Name a place where the end-user will access a report?
ƒ What are the key objects used to configure reports?
ƒ Name a place where the query developer will go to get assistance on the database
schema?
ƒ What naming conventions are used? How does this help?
ƒ What is a localized resource? How is it used?
ƒ What capability is used to add parameters to reports?
ƒ How are parameters added to reports?
ƒ Where should you go to add a chart to a report?
ƒ What technique is used to enable a hyperlink to an SAP Sourcing document (e.g., Project,
RFx, Contract) from within a query?
ƒ What technique is used to enable a hyperlink to a drill-down report?

© 2011 SAP AG. All rights reserved. 163

SAP Class Week of March 19, 2012


Advanced Reporting Concepts

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Database Functions

There are four types or groups of database functions recommended for use:
ƒ SAP Sourcing User Defined functions which provide a common interface to commonly
available database functionality for which a common interface is not available. Example
datetime functions
ƒ SAP Sourcing defined replaceable tokens which provide a common interface to common
database functionality where only the name varies among database platforms.
ƒ SAP Sourcing defined user defined functions which provide application specific
functionality.
ƒ A small set of database built-in functions which are believed to be syntactically and
semantically equivalent across the range of supported Database Management System
(DBMS)

A list of supported functions and token can be found in the embedded Excel Worksheet.

Although it is possible to use DBMS provided functions it is recommended to refrain from using
functions whose syntax and semantics may vary from DBMS to DBMS or which are not
universally supported such as OLAP functions; “ROWNUM” and “RANK” being prime examples.

© 2011 SAP AG. All rights reserved. 165

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Currency Conversions

The query definition provides a couple different ways to perform currency conversions

Approach 1:
ƒ Monetary Currency columns can be converted to the User Currency, Organization
Currency, or a specified Currency

Approach 2:
ƒ The SAP Sourcing FCI_DOC_CUR_CONVERT function can be used

© 2011 SAP AG. All rights reserved. 166

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Showing a Comma Separated List of Values

ƒ In certain cases, it is convenient to show a comma separated list of values in a single cell in
a result set

ƒ For example, show all of the collaborators (comma separated) on a document when
querying over a list of documents

ƒ SAP Sourcing includes or Oracle function to do this:


– FCI_GET_COMMA_LIST

This function can cause performance issues with a query – it should be used judiciously

There is an Oracle function, WM_CONCAT, that also can be used

© 2011 SAP AG. All rights reserved. 167

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Access Lists

ƒ Access Lists allow security to be setup for reports

ƒ Very similar to document collaborators

ƒ Example: Report should only be available to System Administrators -> Add the System
Administrators User Group to the Access List of the Report

ƒ An empty Access List means the report is available to all users

ƒ A populated Access List means the report is restricted to the listed users

© 2011 SAP AG. All rights reserved. 168

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Scheduled Tasks

Scheduled Tasks can be used to email reports on a scheduled basis


ƒ Report Execution Task
ƒ Configure Schedule
ƒ Choose Report
ƒ Choose Action:
ƒ Alert (populates workbench page alerts channel)
ƒ PDF (emailed)
ƒ Excel (emailed)
ƒ CSV (emailed)
ƒ Integration Export (put on server – usually requires additional configuration with SAP)
ƒ Choose Recipients
ƒ Populate Filter Parameters

© 2011 SAP AG. All rights reserved. 169

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Defaulting a Value List Value in Filter Parameters

ƒ Some requirements necessitate that a specific value list value be the default value in a
report

ƒ For example, suppose a report could be run for a year, where the filter prompt was a year
value list. It likely would be desirable for the value list to default to the current year.

ƒ Unfortunately, there is no way to have it auto populate the year based on the date.

ƒ But, the year can be defaulted by using the default value on the filter prompt

ƒ The value for the default value MUST BE THE DISPLAY NAME ID from the value list value
(not the display name resource)

ƒ To default the VLV filter to “none”, use the following construct in the default value: <Internal
Id>:616:NULL (e.g., for MA Status: 10:616:NULL)

© 2011 SAP AG. All rights reserved. 170

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Default Date Parameters

ƒ Date filters can sometimes be improved with default values

ƒ To have the date filter default to the current day, use the token <%TODAY%> for the default
value

ƒ To have the date filter default to a specific date, the default date value MUST BE
FORMATTED AS:
ƒ YYYY/MM/DD

ƒ This can be useful or YTD filtering

NOTE: The construct <%TODAY%> - x could also be used in the WHERE clause of the SQL to
subtract days from today

© 2011 SAP AG. All rights reserved. 171

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Portable SQL

As of SAP Sourcing 7.0 the following Database Management Systems (DBMS) are supported:
ƒ IBM DB2 9.7
ƒ Oracle 10.2 (SP 04) and 11.x

SQL Constructs
ƒ There are differences in the SQL constructs among DMBS vendors . The Word document
provides guidelines for writing SQL which is portable across the set of Database
Management Systems (DBMs) supported by the SAP Sourcing product .These guidelines
are not exhaustive.

Database Stored Procedures


ƒ There is no universally adopted stored procedure language among DBMS vendors.
ƒ The use of stored procedures in the standard product is a significant impediment to adding
support for additional DBMS to the SAP Sourcing product.
ƒ The only exception is in cases where a database stored procedure is used to implement
one of the standard supported database functions when necessary to accommodate
differences in SQL supported by a particular DBMS vendor’s functions.
© 2011 SAP AG. All rights reserved. 172

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Filtering using a specific Value List Value

ƒ In many cases, the query requirements


necessitate that a query explicitly filter data
by a specific value list value

ƒ For example, a query that retrieves only


projects that are “Pending”

ƒ Two ways to do this:


ƒ Use a filter prompt that is locked/hidden and
has the value list value as the default
ƒ Hard code the filtering into the query

ƒ SAP recommends the first approach as it


is easier to maintain

© 2011 SAP AG. All rights reserved. 173

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Queries used in Menus

ƒ (Custom) Queries can be added to Menus by adding them to the Query Groups which are
used in the Menu.

ƒ The corresponding query groups need to be located by inspecting the “SRM Navigation
Group“ inside the “System Navigation Tabset (Buyside)” System Toolbar.

© 2011 SAP AG. All rights reserved. 174

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
URL Parameters & Report Format Directives

ƒ URL Parameters are used for drill down reports to pass parameter values

ƒ URL Parameters also can be used to configure report layout

ƒ &reportFormatDirectives=
ƒ suppressTableGrid
ƒ suppressTableColumnHeaders
ƒ suppressTableToolbar

ƒ Search online help for: URL Parameters

© 2011 SAP AG. All rights reserved. 175

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Report Format Configuration

ƒ Allows for some advanced configuration of results


ƒ Vertical display
ƒ Side by Side

ƒ Example: Master Agreement Cover Page

ƒ Configured via an XML file that is uploaded to the File Attachment Container

ƒ Search online help for: query results layout

© 2011 SAP AG. All rights reserved. 176

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Workbook Templates

ƒ Workbook Templates: Excel workbook templates can be setup for a report “Export to Excel”
option

ƒ The option exists on both the Query Definition and the Report (most likely the one to use)
via the “Workbook Template” field

ƒ The Workbook Template is a reference to a File Attachment Container (Setup > User
Interface > File Attachment Containers), which contains the Excel workbook: create the File
Attachment Container first, the reference it on the Report

ƒ The Excel workbook can contain additional sheets, formulas, and VBA

ƒ Example for Project Summary Extract Report attached

© 2011 SAP AG. All rights reserved. 177

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Images – Images can be displayed in the result set

Technique 1: The results contain a value list value and it is desirable to show an image
for that value.
ƒ Each value in the value list value should have a corresponding localized resource with a
“.image” suffix
ƒ The value of the localized resource for the “.image” should be something like
“/customimages/xxx.jpg”
ƒ Each image should be uploaded as a file attachment container with the path name like
“/customimages/xxx.jpg”
ƒ The query should select the “DISPLAY_NAME_ID” of the value list value using column type
“String Resource”
ƒ Attached XLS creates a VLV and Project extension

Load these as file attachment containers

© 2011 SAP AG. All rights reserved. 178

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Images – Image Query

ƒ QUERY STRING:
ƒ SELECT <%RESULTS%> FROM <%SCHEMA%>.FCI_PRO_PROJECTS T1 JOIN
<%EXT_TABLE(projects.projects)%> T2 ON T2.PARENT_OBJECT_ID = T1.OBJECTID
LEFT OUTER JOIN <%SCHEMA%>.FCI_MAS_VALUE_LIST_VALUE T3 ON
T2.STAR_RATING_OBJECT_ID = T3.OBJECTID WHERE T1.INACTIVE = 0 AND
T1.IS_TEMPLATE = 0 AND T1.CONTEXTID = <%CONTEXT(projects.projects)%> AND
T1.DOC_OWNER_USER_OBJECT_ID = <%CURRENT_USER_ID%>

ƒ QUERY COLUMNS:
ƒ T1.OBJECTID
ƒ 1100
ƒ T1.UNIQUE_DOC_NAME
ƒ T3.DISPLAY_NAME_ID

© 2011 SAP AG. All rights reserved. 179

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Images (continued)

Technique 2: The results contain a string which


resolves to a image path.
ƒ Each image should be uploaded as a file attachment
container with the path name like
“/customimages/xxx.jpg”

ƒ The query should have a column which resolves to


the image path

© 2011 SAP AG. All rights reserved. 180

SAP Class Week of March 19, 2012


Developing Queries Query Definition
Optional Filter Prompts (“DYN_*” Tokens)
Execution:

ƒ SQL:
SELECT <%RESULTS%> FROM <%SCHEMA%>.FCI_PRO_PROJECTS T1
<%DYN_JOIN%>
WHERE T1.IS_TEMPLATE=0 AND T1.CONTEXTID=<%CONTEXT(projects.projects)%>
<%AND_OP("UPPER(T1.DISPLAY_NAME)",<%?(DisplayName)%>)%>
<%DYN_FILTER%>
ƒ These tokens are used to enable the Advanced List Page (adding/removing columns/filters)
ƒ Both tokens have to be in the SQL.
ƒ At least one manually entered condition should be placed before the <%DYN_FILTER%>
token, because the first term in the resolved token will be AND.
ƒ Extensions will automatically be included in the list of available fields
ƒ The list of available fields can not be modified
NOTE: These tokens will not work with UNION statements (e.g., there is no way to use these
tokens in the combined Master Agreement / Sub-Agreement UNION queries).

© 2011 SAP AG. All rights reserved. 181

SAP Class Week of March 19, 2012


Exercise 9

Objective
ƒ Create a query which is utilizing optional filter Prompts

Exercise
ƒ Modify a query from one of the previous exercises
ƒ Add at least one query parameter with the “AND” and
at least one with the “AND_OP” token
ƒ Utilize the “DYN_JOIN” and “DYN_FILTER” tokens
ƒ Add the Query Definition to the FCI-ProjectBuyList
Query Group

ƒ NOTE: All students will need to update the same query


group, so make your updates quickly and close out of it
so other students can make the same edits

© 2011 SAP AG. All rights reserved. 182

SAP Class Week of March 19, 2012


Additional Reporting Capabilities
Query Definition – Localization

The following Master Data objects have localized names and descriptions:
ƒ Material, Plant, Location, Currency, External Category, Internal Category, Unit of Measure,
Payment Terms, Currency Code, UOM ISO, Company Code, Inco Term, Transaction Type,
Purchasing Organization, Purchasing Group, Vendor Account Group, ERP Region, Logical
System

Show the FCI-SearchMaterialByNameBP query and a localized material

Three tokens are used to support filter and display of localized Master Data using the
language of the end user
ƒ <%MS_JOIN%> – This token should be placed in the FROM clause.
ƒ If <%DYN_JOIN%> is present, don’t use <%MS_JOIN%> since it will automatically insert a
<%MS_JOIN%> token
ƒ Example:
SELECT <%RESULTS%> FROM <%SCHEMA%>.FCI_MAS_MATERIAL
<%MS_JOIN%> WHERE
<%MS_NAME_FILTER(T1,masterdata.Material,SearchMaterial)%>
© 2011 SAP AG. All rights reserved. 183

SAP Class Week of March 19, 2012


Additional Reporting Capabilities
Query Definition – Localization (continued)

<%MS(column_name,class_name)%> – this token is used to get the localized value of a


Multi String field in the result set based on the current user’s language.
ƒ The Column Type should be Display Name or just a String.
ƒ The first parameter of the <%MS%> token (column name) is used as the Column ID.
ƒ If this token is present, it’s required that the query string has token <%MS_JOIN%> or
<%DYN_JOIN%>, but not both.

This token can also be used in the filter to enable searching localized values based on the
current user’s locale:
ƒ Example:
<%AND_OP("UPPER(<%MS(T1.NAME_MSDEFAULT,masterdata.Material)%>)",<%?(Se
archMaterial)%>)%>
© 2011 SAP AG. All rights reserved. 184

SAP Class Week of March 19, 2012


Additional Reporting Capabilities
Query Definition – Localization (continued)

<%MS_NAME_FILTER(table-alias,class_name,param-name)%> – this token provides a


convenient way to search a string in the localized name and description columns.
ƒ If this token is present, it’s required that the query string has token <%MS_JOIN%> or
<%DYN_JOIN%>, but not both.
ƒ Example: <%MS_NAME_FILTER(T1,masterdata.Material,SearchMaterial)%>

© 2011 SAP AG. All rights reserved. 185

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Queries in Menus – Setup

ƒ Setup > System Setup > User Interface > System Toolbars
ƒ Search for “eso.system.toolbar.navigation”
ƒ Click on “System Navigation Tabset (Buyside)”
ƒ Collapse “Spend and Compliance”
ƒ The name of the used Query Group follows
ƒ “Dyn(amic) entry for” (e.g. “FCI-ProjectBuyList”)
j y
ƒ Locate and edit the Query Group
roup

ƒ Add the (custom) Query to the Query Group and


check the “Include in SRM Navigation” flag

© 2011 SAP AG. All rights reserved. 186

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Stored Procedures

{CALL
<%SCHEMA%>.CUSTOM_SAVINGS_EXPORT_QRY.CUSTOM_SAVINGS_EXPORT(?,'<%
EXT_TABLE(projects.projects)%>',
'<%EXT_TABLE(projects.projects,PROJ_SAVINGS)%>',
<%CONTEXT(projects.projects)%>)}

ƒ Note that the first parameter (the ?) is the cursor and is mandatory

ƒ Note also quotes around the tokens that are VARCHAR2. This cause an obscure error if
you omit.

Only available for use by on-premise deployments on SAP Sourcing because


database access is required

© 2011 SAP AG. All rights reserved. 187

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Other Interesting Standard Queries

ƒ File Sharing (FCI-BuyAttachChannel, My Agreements and Contract Documents): Querying


and hyperlinking attachments

ƒ Pivot Reporting (using CHART_SERIES_LABEL) (FCI-RFxResponseAnalysisPivot): RFx


Response Analysis Report

ƒ Oracle Analytic Functions (FCI-CumSavingsProjects)

ƒ Optional Filter Prompts (VLV or Object Reference) (FCI-WorkItemActivityByDocument)

© 2011 SAP AG. All rights reserved. 188

© SAP

SAP Class Week of March 19, 2012


Dashboards (Optional) –
Separate Course Coming
Soon

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Dashboards – Overview

ƒ Dashboards are interactive reports.


ƒ The end user can search, filter and manipulate SAP Sourcing data based on the
capabilities defined by the dashboard designer.
ƒ Dashboards consist of Adobe Flash ® files created with SAP Business Objects Xcelsius
Designer which are embedded in the SAP Sourcing UI.
ƒ SAP Business Objects Xcelsius Designer is required to create Dashboards.

Desktop
Report
Channel

Query
Query
Definitions
Query
Definitions
Definitions

Dashboard Dashboard
(Adobe Flash File) Definition
© 2011 SAP AG. All rights reserved. 190

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Dashboards – Features

ƒ Rich set of chart types and UI components for best data visualization.

ƒ Interactive.

ƒ Support of “What-if” analysis.

ƒ Data refresh on schedule or on demand.

ƒ Passing of filter values to queries from dashboard.

ƒ Links from dashboard to the transactional page.

ƒ Multiple query results in one or multiple charts or UI components.

ƒ Combine external data sources with query results from SAP Sourcing.

© 2011 SAP AG. All rights reserved. 191

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Dashboards – Creation
(1) Query
1) Definition of (multiple) queries to be used for the Definitions
Dashboard.
2) Creation of Xcelsius dashboard in SAP Business
Objects Xcelsius designer. SAP Business Objects (2) Xcelsius
Xcelsius 2008 is required client tool for Xcelsius Designer
design.
3) Preview of Dashboard in Xcelsius designer with live (3) Preview
data.
4) Export of Dashboard to Adobe ® Flash (.SWF) file
which will be used for Dashboard Definition in SAP
Sourcing. (4) Adobe Flash
File
5) Creation of Dashboard Definition inside SAP Sourcing
by providing Dashboard information and uploading the
Adobe ® Flash (.SWF) and the Xcelsius source file (in (5) Dashboard
.XLF format). Definition
6) Definition of Report by providing metadata about the
reports, adding Dashboard definition as one of the
report elements, and specifying access list for users. (6) Report

© 2011 SAP AG. All rights reserved. 192

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Dashboards – Best Practices (Consistent UI)

Consistent UI
ƒ Use “Phase” theme for all dashboards. Choose “Phase” theme at the beginning of your
dashboard project to avoid having to reapply custom colors
ƒ The font for all labels, tabs, legends and texts should be Arial 11. For dashboard title, the
font size could be up to Arial 14.
ƒ Bold texts for dashboard title and section title only. Do not bold texts for column headers,
tabs, buttons, and error messages.
ƒ For a full page dashboard, set Canvas size to 900 (width) by 600 (height) which works with
most browsers and screen resolutions.
ƒ Refer to SAP Sourcing application form and table for layout. All field labels should be right
aligned whereas all table headers should be left aligned.

© 2011 SAP AG. All rights reserved. 193

SAP Class Week of March 19, 2012


Advanced Reporting Concepts
Dashboards – Best Practices (Performance)
Good Performance
ƒ Design and use queries suitably for the usage with Xcelsius. Do not set the maximum of
rows larger than 2000. The default value is 512.
ƒ Define the query so it does not exceed a maximum number of rows and columns, which is
given by the fixed result area of Xcelsius. Smaller queries are better.
ƒ Display key value and description for all characteristics that are used for filter and
selections in order to support language-independent dashboard design
ƒ One Excel sheet for each query used in the Xcelsius dashboard. If you have Master-Child
relationship between charts, which can be realized using Drill-Down feature of Xcelsius,
then you can have these two charts in the same excel sheet.
ƒ Do not allow multiple currencies or units of measure a key figure in your query results, as
Xcelsius does not support mixing multiple currencies or units of measure in a result. Use
one fixed currency or unit of measure, or use a variable filtering on a single currency or unit
of measure.
ƒ Remove unnecessary UI controls to reduce size of .SWF file as much as possible
ƒ Remove unused data in Excel in Xcelsuis to reduce size of .SWF file.
ƒ Aggregate and calculate data in queries, but not in the Xcelsius Dashboard.
ƒ Use the button Connection Refresh of components Web Connectivity to trigger initial
request for query results. This avoids a long delay upon initialization of the dashboard. Do
not use the Refresh options in Data Manager
© 2011 SAP AG. All rights reserved. 194

SAP Class Week of March 19, 2012


Group workshop (optional)

SAP Class Week of March 19, 2012


Workshop Exercise

ƒ We will break into 3 groups

ƒ Each group will develop a


report (details to follow)

ƒ Each group will “present” what


they did to the class

© 2011 SAP AG. All rights reserved. 196

SAP Class Week of March 19, 2012


Workshop Exercise
Group 1

Developer a vendor report with the following columns:


ƒ Supplier Name
ƒ Minority indicator on supplier
ƒ Big Text extension field
ƒ Price extension field
ƒ # RFxs supplier is invited to
ƒ # Projects supplier is on

Column 5 should link to the report developed by Group 2

Column 6 should link to the report developed by Group 3

© 2011 SAP AG. All rights reserved. 197

SAP Class Week of March 19, 2012


Workshop Exercise
Group 2

Develop an RFx report with the following columns:


ƒ RFx Name
ƒ RFx Phase
ƒ Due Date
ƒ # suppliers
ƒ # of diverse suppliers
ƒ Owner name
ƒ Owner email address
ƒ Internal Category
ƒ Extension (you choose)

This report will be used by Group 1 as a drill down report

© 2011 SAP AG. All rights reserved. 198

SAP Class Week of March 19, 2012


Workshop Exercise
Group 3

Develop a Project report with the following columns:


ƒ Project Name
ƒ Status
ƒ Owner
ƒ # of Collaborators
ƒ Project Description
ƒ Estimated Value (total this column)
ƒ Extension (you choose)

This report will be used by Group 1 as a drill down report

© 2011 SAP AG. All rights reserved. 199

SAP Class Week of March 19, 2012


Appendix

SAP Class Week of March 19, 2012


Appendix
Drill Down Report Example

Standard report showing charting and report drill down

ƒ Top Level Report Internal Name: FCI-AuctionsRFxsCompletedByMonth

ƒ Top Level Report Queries:

ƒ FCI-AuctionsRFxsCompletedByMonthChart (Shows Chart Use)

ƒ FCI-AuctionsRFxsCompletedByMonthData

ƒ RFx Drill Down Query: FCI-RFxsComplByMonDrillDown

© 2011 SAP AG. All rights reserved. 201

SAP Class Week of March 19, 2012


Appendix
Common Errors

Error:
ƒ ORA-00933: SQL command not properly ended

ƒ SQL String:
SELECT T1.DISPLAY_NAME FROM FCI_MAS_VENDOR T1 WHERE
<%CONTEXT(masterData.Vendor)%> AND INACTIVE=0

ƒ PROBLEM: Context token did not resolve correctly (this is known because the token is still
in the SQL statement). The class name is case sensitive and should be:
masterdata.Vendor. Notice, also, that the value of the context token is not compared to
T1.CONTEXTID

Error:
ƒ The Number result set item for Suppliers by Name in row 1, column 1 could not be
prepared for display. getBigDecimal Failed on value (Plant Oregon) in column 1

ƒ SQL String:
SELECT T1.DISPLAY_NAME FROM FCI_MAS_VENDOR T1 WHERE CONTEXTID=-
2147483548 AND T1.INACTIVE=0

ƒ PROBLEM: The first column, T1.DISPLAY_NAME, is configured as a column type of


Number and should be of type String. This is changed on the result column page.

© 2011 SAP AG. All rights reserved. 202

SAP Class Week of March 19, 2012


Appendix
Common Errors (Continued)

Error:
ƒ ORA-00942: table or view does not exist

ƒ SQL String:
SELECT T1.OBJECTID, 900 AS CLASSID, T1.DISPLAY_NAME,
T1.DUE_DATE_DATETIME, T1.DOC_OWNER_USER_OBJECT_NAME FROM
rfx.RFXDoc T1 WHERE T1.CONTEXTID=-2147483548 AND T1.IS_TEMPLATE=0 AND
T1.INACTIVE=0 ORDER BY 4 DESC

ƒ PROBLEM: The class name was used instead of the table name. Table names begin with
“FCI_” or “ODP_”

Error:
ƒ Result field items are grouped incorrectly based on column type. See product
documentation for correct ordering of result field column types.

ƒ PROBLEM: This error happens on save of a query definition. This means that 1 of a set of
group columns is not the correct type. For example, if you are doing a drill down to a
document using 3 columns (Object ID, Class ID, and Display Name), one of the column
types is not specified correctly. This error will also happen when showing price or quantity
columns
© 2011 SAP AG. All rights reserved. 203

SAP Class Week of March 19, 2012


Appendix
Common Errors (Continued)

Error:
ƒ ORA-00920: invalid relational operator

ƒ SQL String:
SELECT T1.OBJECTID, 900 AS CLASSID, T1.DISPLAY_NAME,
T1.DUE_DATE_DATETIME, T1.DOC_OWNER_USER_OBJECT_NAME FROM
rfx.RFXDoc T1 WHERE T1.CONTEXTID-2147483548 AND T1.IS_TEMPLATE=0 AND
T1.INACTIVE=0 ORDER BY 4 DESC

ƒ PROBLEM: Notice that CONTEXTID is not compared to the value of the CONTEXT token.
The equals sign is missing.

Error:
ƒ ORA-00904: "T"."DOCUMENT_DESCRIPTION": invalid identifier 1

ƒ SQL String:
SELECT T1.OBJECTID, T1.STATUS_OBJECT_ID,
T1.DOC_OWNER_USER_OBJECT_NAME, T.DOCUMENT_DESCRIPTION FROM
FCI_PRO_PROJECTS T1

ƒ PROBLEM: The table alias T1 is not used with the column. T.DOCUMENT_DESCRIPTION
should be changed to T1.DOCUMENT_DESCRIPTION

© 2011 SAP AG. All rights reserved. 204

SAP Class Week of March 19, 2012


Appendix
Common Errors (Continued)

Error:
ƒ ORA-00937: not a single-group group function

ƒ SQL String:
SELECT T1.OBJECTID, 1100, T1.DISPLAY_NAME, T2.DISPLAY_NAME,
T1.DOC_OWNER_USER_OBJECT_NAME, T1.DOCUMENT_DESCRIPTION, Count
(T3.OBJECTID) FROM FCI_PRO_PROJECTS T1, FCI_MAS_VALUE_LIST_VALUE T2,
FCI_DOC_COLLABORATOR T3 WHERE T1.STATUS_OBJECT_ID = T2.OBJECTID AND
T1.OBJECTID = T3.PARENT_OBJECT_ID AND T3.PARENT_CLASS_ID = '1100'

ƒ PROBLEM: Missing Group By statement from query.

Error:
ƒ The query is not sorted but columns are setup with sort

ƒ PROBLEM: The <%ORDERBY%> token is likely missing

© 2011 SAP AG. All rights reserved. 205

SAP Class Week of March 19, 2012


Appendix
Common Errors (Continued)

Error:
ƒ ORA-01008: not all variables bound

ƒ SQL String:
SELECT P.OBJECTID, 1100, P.DISPLAY_NAME, PE.PROCONTRACTOR, 'SAP',
'http://www.sap.com' FROM FCI_PRO_PROJECTS P, FCI_DYN_$2147483472 PE
WHERE P.INACTIVE = 0 AND P.IS_TEMPLATE = 0 AND P.CONTEXTID = -2147483548
AND PE.PARENT_OBJECT_ID = P.OBJECTID AND UPPER(P.DISPLAY_NAME) LIKE
UPPER(?) AND UPPER(P.DOC_OWNER_USER_OBJECT_NAME) LIKE UPPER(?)
ORDER BY 3

ƒ PROBLEM: The number of ?’s in the query is more than the number of filters configured on
the Filter Prompts tab in the query definition

© 2011 SAP AG. All rights reserved. 206

SAP Class Week of March 19, 2012


Appendix
Common Errors (Continued)
Error:
ƒ ORA-01789: query block has incorrect number of result columns

ƒ SQL String:
SELECT T1.UNIQUE_DOC_NAME, DECODE( FCI_DOC_CHECKCOLLAB(T1.OBJECTID, 1004,-2147483544,'-
2147483537'),0,null,'/contracts/contracts_summary,' || T1.OBJECTID || ':1004?rqaction=load&link_crumb=true&hook=contract_uirq'), NULL AS
UNIQUE_DOC_NAME, NULL AS AGREEMENT_LINK, T1.DISPLAY_NAME, T1.VENDOR_OBJECT_NAME, T3.DISPLAY_NAME_ID,
T1.INT_CAT_OBJECT_NAME, T1.BUSINESS_UNIT_OBJECT_NAME, T1.EFFECTIVE_DATE_DATE, T1.RENEWAL_REMINDER_DATE,
T1.EXPIRATION_DATE_DATE, T1.LAST_AUDIT_DATE, T1.NEXT_AUDIT_DATE, NVL(T2.EXPECTED,0) +
NVL(T1.TOTAL_EXPECTED_PRICE, 0), NVL(T1.TOTAL_EXPECTED_CURRENCY,'USD'), NVL(T2.SAVINGS,0) +
NVL(T1.TOTAL_SAVINGS_PRICE, 0), T1.CURRENCY_OBJECT_NAME, T1.DOC_OWNER_USER_OBJECT_NAME, DECODE(
FCI_DOC_CHECKACTIVECOLLAB(T1.OBJECTID, 1004,-2147483544,'-2147483537'), 0, 'SILENT', NULL), CEXT.SW_SUPP_HOURS FROM
FCI_CONTRACT T1, FCI_DYN_$2147483468 CEXT, FCI_MAS_VALUE_LIST_VALUE T3 , (SELECT NVL(SUM(TOTAL_EXPECTED_PRICE),0)
AS EXPECTED, NVL(SUM(TOTAL_SAVINGS_PRICE),0) AS SAVINGS, PARENT_OBJECT_ID FROM FCI_AGREEMENT WHERE INACTIVE=0
AND IS_TEMPLATE=0 AND CONTEXTID = -2147483548 GROUP BY PARENT_OBJECT_ID) T2 WHERE T1.INACTIVE = 0 AND
T1.IS_TEMPLATE=0 AND T1.CONTEXTID = -2147483548 AND T1.STATUS_OBJECT_ID = T3.OBJECTID AND
T1.OBJECTID=T2.PARENT_OBJECT_ID(+) AND ( FCI_DOC_CHECKCOLLAB(T1.OBJECTID, 1004,-2147483544,'-2147483537') = 1) AND
((0=0) OR (T1.DOC_OWNER_USER_OBJECT_ID=-2147483544)) AND CEXT.PARENT_OBJECT_ID = T1.OBJECTID UNION ALL SELECT
T1.UNIQUE_DOC_NAME, NULL, T2.UNIQUE_DOC_NAME, DECODE( FCI_DOC_CHECKCOLLAB(T2.OBJECTID,1003,-2147483544,'-
2147483537'),0,null,'/contracts/agreements/agreements_summary,' || T2.OBJECTID ||
':1003?rqaction=load&link_crumb=true&hook=agreement_uirq'), T2.DISPLAY_NAME, T2.VENDOR_OBJECT_NAME, T3.DISPLAY_NAME_ID,
T2.INT_CAT_OBJECT_NAME, T2.BUSINESS_UNIT_OBJECT_NAME, T2.EFFECTIVE_DATE_DATE, T2.RENEWAL_REMINDER_DATE,
T2.EXPIRATION_DATE_DATE, T2.LAST_AUDIT_DATE, T2.NEXT_AUDIT_DATE, NVL(T2.TOTAL_EXPECTED_PRICE, 0) AS TOTALVALUE,
NVL(T2.TOTAL_EXPECTED_CURRENCY,'USD'), NVL(T2.TOTAL_SAVINGS_PRICE, 0), T1.CURRENCY_OBJECT_NAME,
T2.DOC_OWNER_USER_OBJECT_NAME, DECODE( FCI_DOC_CHECKACTIVECOLLAB(T2.OBJECTID, 1003,-2147483544,'-2147483537'), 0,
'SILENT', NULL) FROM FCI_CONTRACT T1, FCI_AGREEMENT T2, FCI_MAS_VALUE_LIST_VALUE T3 WHERE T2.INACTIVE = 0 AND
T2.IS_TEMPLATE=0 AND T2.CONTEXTID = -2147483548 AND T2.STATUS_OBJECT_ID = T3.OBJECTID AND T1.OBJECTID =
T2.PARENT_OBJECT_ID AND T2.PARENT_CLASS_ID = 1004 AND T2.PARENT_COLLN_ID = 1 AND (
FCI_DOC_CHECKCOLLAB(T2.OBJECTID, 1003,-2147483544

ƒ PROBLEM: This query is using a Union over the Contract and Sub-Agreements objects.
The error is because the number of columns selected in the first select of the union does
not match the number of columns selected in the second select of the union.
© 2011 SAP AG. All rights reserved. 207

SAP Class Week of March 19, 2012


Appendix
Customer Support Expectations

Customer support will …


ƒ address questions only from individuals that have been trained on reporting
ƒ field questions regarding the information provided in the reference guide relative to the
database schema
ƒ field questions about the use and configuration of the Query, Query Group, Report, and
Analysis Page objects
ƒ field questions about the use and purpose of specific query definition tokens in standard
reports

Customer support will NOT …


ƒ field questions regarding SQL
ƒ fix queries that are not working
ƒ develop new queries
ƒ make suggestions on how to write or construct a query
ƒ field questions regarding the database schema that are not covered in the reference guide

© 2011 SAP AG. All rights reserved. 208

SAP Class Week of March 19, 2012


Appendix
Basic SQL Concepts
ƒ This Appendix covers the most commonly used SQL concepts in Sourcing. For
demonstration purpose we will use two tables – TEACHER and STUDENT

Table 1: TEACHER Table 2: STUDENT


TEACHER_NAME STUDENT_NAME TEACHER_NAME
ROB JOHN ROB
GARY MARY -
FRANK ALEX VIKRAM
VIKRAM MIKE -

© 2011 SAP AG. All rights reserved. 209

SAP Class Week of March 19, 2012


Appendix
Basic SQL Concepts
INNER JOIN is the default join type. Returns rows where there is at least one match in both
Teacher and Student tables
SELECT
T1.TEACHER_NAME,
T2.STUDENT_NAME
FROM
TEACHER T1 INNER JOIN STUDENT T2
ON T1.TEACHER_NAME = T2.TEACHER_NAME

Result:

TEACHER_NAME STUDENT_NAME
ROB JOHN
VIKRAM ALEX

© 2011 SAP AG. All rights reserved. 210

SAP Class Week of March 19, 2012


Appendix
Basic SQL Concepts
LEFT OUTER JOIN returns all rows from the left table (TEACHER table), even if there are no
matches in the right table (STUDENT table)
SELECT
T1.TEACHER_NAME,
T2.STUDENT_NAME
FROM
TEACHER T1 LEFT OUTER JOIN STUDENT T2
ON T1.TEACHER_NAME = T2.TEACHER_NAME

Result:
TEACHER_NAME STUDENT_NAME
ROB JOHN
VIKRAM ALEX
FRANK -
GARY -

© 2011 SAP AG. All rights reserved. 211

SAP Class Week of March 19, 2012


Appendix
Basic SQL Concepts
RIGHT OUTER JOIN returns all rows from the right table (STUDENT table), even if there are
no matches in the left table (TEACHER table)
SELECT
T1.TEACHER_NAME,
T2.STUDENT_NAME
FROM
TEACHER T1 RIGHT OUTER JOIN STUDENT T2
ON T1.TEACHER_NAME = T2.TEACHER_NAME

Result:
TEACHER_NAME STUDENT_NAME
ROB JOHN
VIKRAM ALEX
- MIKE
- MARY

© 2011 SAP AG. All rights reserved. 212

SAP Class Week of March 19, 2012


Appendix
Basic SQL Concepts
What happens if teacher and student Result:
tables are not joined? CARTESIAN JOIN TEACHER_NAME STUDENT_NAME
ROB JOHN
SELECT
ROB MARY
T1.TEACHER_NAME, ROB ALEX

T2.STUDENT_NAME ROB MIKE


GARY JOHN
FROM
GARY MARY
TEACHER T1, STUDENT T2
GARY ALEX
GARY MIKE

Note: In Sourcing, queries should FRANK JOHN


FRANK MARY
always be joined. Queries with
FRANK ALEX
Cartesian joins could result in FRANK MIKE
significant performance impact VIKRAM JOHN
VIKRAM MARY
VIKRAM ALEX
VIKRAM MIKE

© 2011 SAP AG. All rights reserved. 213

SAP Class Week of March 19, 2012


SAP Sourcing / Contract Lifecycle Mgmt
Business Rule Designer and Scripting
November 2011

SAP Class Week of March 19, 2012


Agenda & Expectations

Agenda
ƒ Section 1: Business Rule Designer
ƒ Section 2: Introduction to Scripting
ƒ Section 3: Integration APIs (IAPIs)
ƒ Section 4: Script Definition Details
ƒ Section 5: Coding Best Practices
ƒ Exercises throughout

Expectations
ƒ SAP Sourcing Scripting requires coding in a Java-like language called Beanshell; as a
result, students must be capable with a high-level programming language (Java preferable)
to complete the exercises successfully

© 2011 SAP AG. All rights reserved. 217

SAP Class Week of March 19, 2012


Section 1: Business Rule Designer

SAP Class Week of March 19, 2012


Business Rule Designer (BRD)

What is BRD?
ƒ Tool to incorporate simple custom business logic
ƒ Intended to be used by business users that understand the business requirement

How is BRD useful?


ƒ User driven configuration of business rules and logic
ƒ Customer unique business rules can improve data quality
ƒ Able to utilize custom data (extensions) added to the application
ƒ Example usages of BRD are:
ƒ Validate a field to enforce policies
ƒ Ensure data is completed appropriately
ƒ Pre-populate data to improve usage of the application
ƒ Ensure data imports are providing sufficient data
ƒ Enable custom “user actions” on business documents

© 2011 SAP AG. All rights reserved. 219

SAP Class Week of March 19, 2012


BRD

„ Business Requirements are addressed by three components:


„ SAP Delivered Functionality
+
BRD
„ Configuration Options
+
„ Extensions & Custom Logic (BRD is here)

SAP Delivered Configuration Extensions &


Functionality Options Custom Logic

Business Requirement

© 2011 SAP AG. All rights reserved. 220

SAP Class Week of March 19, 2012


BRD Examples

„ Generate an error if the Project risk is red and the reason is not provided
Validate
Create / Update Project is at Project Risk is
REASON is End
Project Risk set to RED
populated
„ Rule design for Project Validated
„ Rule checks if risk = red and reason is empty
BRD

„Ensure Check for Diversity flag is checked before proceeding to next RFx phase

Enter Review Check for Enter Open for


Create RFx End
Phase Diversity Response

„ Rule design for RFx Validated


„ Rule checks if the Check
„ for Diversity flag is checked BRD

© 2011 SAP AG. All rights reserved. 221

SAP Class Week of March 19, 2012


How to create a Business Rule in BRD

Rule Design is accessed from


ƒ Setup > System Setup > Integration > Rule Design

Rule Designs structure


ƒ Rule Design contains…
ƒ One or more Rules, which…
ƒ Has the logic

Rule Designs
ƒ Context: Document Lifecycle Event, Field Validation, Toolbar, Field Data Edit, Import
ƒ Class

Demo of Rule Design to ensure Risk Reason is provided when Risk is set to Red

© 2011 SAP AG. All rights reserved. 222

SAP Class Week of March 19, 2012


Demo Screen Shots

Rule Design creation

© 2011 SAP AG. All rights reserved. 223

SAP Class Week of March 19, 2012


Demo Screen Shots

Rule Design creation

© 2011 SAP AG. All rights reserved. 224

SAP Class Week of March 19, 2012


Demo Screen Shots

Rule Design creation

© 2011 SAP AG. All rights reserved. 225

SAP Class Week of March 19, 2012


Rule Design Contexts –
“where can rule designs be initiated in the system”
When a rule design is created, the “context” for the rule must be selected. The
choices are:

ƒ Document Lifecycle
ƒ Loaded
ƒ Created
ƒ Duplicated
ƒ Pre Phase Change
ƒ Post Phase Change
ƒ Validated
ƒ Saved
ƒ Pre-Publish to ERP
ƒ Field Validation
ƒ Field Data Edit
ƒ Toolbar
ƒ Import Lifecycle
ƒ Process Row

© 2011 SAP AG. All rights reserved. 226

SAP Class Week of March 19, 2012


When are the actual events fired?

ƒ Field Data Edit: Executed when user clicks Save and field has changed; prior to
system and script validation; not called on new document; errors stop execution
of system and script validation.
ƒ Validated: Executed when user clicks Save AND there are changes to the
document; after system validation
ƒ Field Validation: Executed after system and script validation; only called if field
has been changed (or on a new document).
ƒ Saved: Executed after save to database, but prior to transaction commit; only
executed if validations did not result in error.
ƒ Created: Executed when a document is created.
ƒ Duplicated: Executed when a document is duplicated (NOTE: Create from
Template results in a Duplicated event, not Created)
ƒ Loaded: Executed when a document is loaded from the database.
ƒ Process Row: Executed on the object before it is validated

© 2011 SAP AG. All rights reserved. 227

SAP Class Week of March 19, 2012


BRD Details

Rule Designs consist of individual conditions and actions configured in the Rule
Definition (a Rule Design can have multiple Rule Definitions)
ƒ addCompanyCollaborator
ƒ addGroupCollaborator
ƒ addUserCollaborator
ƒ and
ƒ changeOwner
ƒ changePhase
ƒ clear field
ƒ endif
ƒ generateError
ƒ if
ƒ or
ƒ set
ƒ then

© 2011 SAP AG. All rights reserved. 228

SAP Class Week of March 19, 2012


Exercise 1

Objective
ƒ Create a Business Rule Design

Exercise
ƒ Create your own Project Type (this will
allow each user to create a similar
validation script)
ƒ Use the BRD to create a validation that
ensures that either both the estimated
value and budgeted values are empty or
populated.
ƒ An error should be generated if one is
populated and the other is not

© 2011 SAP AG. All rights reserved. 229

SAP Class Week of March 19, 2012


Exercise 1 – Solution

Create a new Project Type for yourself


Create a Project Validated Business Rule for your project type
Ensure the rule has logic as shown

© 2011 SAP AG. All rights reserved. 230

SAP Class Week of March 19, 2012


BRD Additional Information

ƒ BRD introduced in Wave 7 / 7.0

ƒ Behind the scenes, a BRD is converted into a Script Definition.

ƒ Limitations of the BRD include


ƒ Only basic conditions and actions are possible
ƒ There is no ability to work with collections
ƒ Access to the previous/current/next phase information is not available

The script definition code generated by the BRD should not be used as a
starting point for script definition code. It uses different coding
techniques.

© 2011 SAP AG. All rights reserved. 231

SAP Class Week of March 19, 2012


Section 2: Introduction to Scripting

SAP Class Week of March 19, 2012


Introduction to Scripting

What is Scripting?
ƒ A way to add functionality to the system without changing code (NOTE: Source code is not
provided with the system and cannot ever be modified by services, a customer, or a
partner)
ƒ The functionality is implemented by adding computer code into the system

Why use Scripting?


ƒ It is a way to implement customer specific functionality
ƒ It is a way to extend the capabilities of the system
ƒ It is a way to fill product gaps without changing the code of the system

It is generally a best practice to pursue the use of configuration options before


implementing scripts. Configuration options are easier to maintain long term.

© 2011 SAP AG. All rights reserved. 233

SAP Class Week of March 19, 2012


Scripting and SAP Sourcing/CLM Deployment Modes

ƒ Licensed On-Premise: Scripting available

ƒ Licensed Hosted: Scripting available

ƒ Private OnDemand: Scripting available

ƒ Public OnDemand: Available as a SAP Value Added


service only

ƒ BRD is available regardless of model, but could


depend on OnDemand package

© 2011 SAP AG. All rights reserved. 234

SAP Class Week of March 19, 2012


Introduction to Scripting, technically speaking

ƒ Source code fragments are added into the system using the open source BeanShell
Scripting Language (“Lightweight Scripting for Java”)

ƒ Custom code interacts with standard Sourcing/CLM objects using Integration APIs (IAPIs)

ƒ The custom code is initiated on various “user initiated” events, for example:
ƒ Saving a document (user chooses save)
ƒ Opening a document (user chooses a document link on a list page)
ƒ Creating a document (user chooses the create button)

ƒ The custom code is not available to be scheduled (as a background process)

ƒ The custom code is associated with an object class (e.g., Projects) and a even (e.g.,
Validated)

ƒ Scripts can be found in: Setup > System Setup > Integration > Script Definition

© 2011 SAP AG. All rights reserved. 235

SAP Class Week of March 19, 2012


Common Scripting Use Cases

Validations
ƒ Required fields based on some criteria
ƒ Field values dependent on other field values
ƒ Ensuring field content is valid
ƒ Ensuring specific data is populated before transitioning to a new document phase

Updating read-only fields


ƒ Performing a calculation and putting the result in a read-only field
ƒ Pulling data from another location and showing it in a read-only field as a convenience

Integration
ƒ Making a call to a web service to push or pull data
ƒ Putting data into a specific location for the purposes of integration

User actions
ƒ Implement business process or workflow like functionality through “actions” performed by
the user
© 2011 SAP AG. All rights reserved. 236

SAP Class Week of March 19, 2012


What is not possible in Scripting?

Customizing the appearance of a document


ƒ User interface layouts are done with WYSIWYG and Page Customizations
ƒ Scripting does not allow you to hide/show fields, for example, based on some condition

Operations that require additional interaction with a user


ƒ It is not possible to create a popup, for example, that asks for user confirmation

Scripting cannot be used to manipulate the user interface of an object

Scripting should also not be used when the operation requires significant
processing time
ƒ Scripts are executed in real-time
ƒ Lengthy operations will impact the user experience

© 2011 SAP AG. All rights reserved. 237

SAP Class Week of March 19, 2012


What can / has been done with Scripting?

Now is a good time to discuss


ideas for scripts from the
students…

© 2011 SAP AG. All rights reserved. 238

SAP Class Week of March 19, 2012


Section 3: Integration APIs (IAPIs)

SAP Class Week of March 19, 2012


Integration APIs (IAPIs)

ƒ IAPIs are a programming interface available for most Sourcing/CLM business


documents and master data

ƒ Simple data fields typically have set/get methods

ƒ Collections can be retrieved, iterated over, added to, and have elements remove

ƒ Collection members will have set/get methods

ƒ Example: ProjectIBeanIfc – the IAPI for the Project object in Sourcing


ƒ void setDisplayName(String name) – sets the name of the Project
ƒ String getDisplayName() – gets the name of the Project
ƒ OrderedSubordinateCollectionIfc getCollaborators() – gets the list of
collaborators on the Project
ƒ Each element in the collection is an object of type CollaboratorIBeanIfc

© 2011 SAP AG. All rights reserved. 240

SAP Class Week of March 19, 2012


Integration APIs (IAPIs)

Full JavaDocs available for IAPIs in the Sourcing/CLM Reference Guide

The JavaDocs link is available on the Index page of the Reference Guide

JavaDocs can also be found from within the class information for an object
ƒ Example: In the user interface, go to an RFx, choose Reference Guide >

View the reference guide in the system


© 2011 SAP AG. All rights reserved. 241

SAP Class Week of March 19, 2012


Internal APIs

Use of Internal APIs is not supported

ƒ They are for internal use only

ƒ They are undocumented

ƒ They are subject to change without notice

ƒ They are unsupported

ƒ They can result in corrupt data when used incorrectly

If there is a need for an object not covered in the IAPI JavaDoc, contact
Customer Support to enter a request.

© 2011 SA
SAP AG. All rights reserved. 242

SAP Class Week of March 19, 2012


Exercise 2

Objective
ƒ Familiarize the user with the Sourcing/CLM
JavaDocs

Exercise
ƒ What class and method would be used to
set the Product Category value on an
RFx?
ƒ What method calls would be required to
get the numeric value of the Estimated
Value of a Project?
ƒ What method calls would be required to
get the number of collaborators on an
Auction? What classes would be used?

© 2011 SAP AG. All rights reserved. 243

SAP Class Week of March 19, 2012


Exercise 2 - Solutions

What class and method would be used to set the Product Category value on an
RFx?
ƒ RfxDocIBeanIfc, setIntCategory

What method calls would be required to get the numeric value of the Estimated
Value of a Project?
ƒ getEstimatedValue() which returns a PriceIfc
ƒ getPrice() on the PriceIfc which returns a BigDecimal
ƒ doubleValue() on BigDecimal to get the value

What method calls would be required to get the number of collaborators on an


Auction? What classes would be used?
ƒ AuctionEventIBeanIfc
ƒ getCollaborators() which returns an OrderedSubordinateCollectionIfc
ƒ size() on OrderedSubordinateCollectionIfc to get the number of collaborators

© 2011 SAP AG. All rights reserved. 244

SAP Class Week of March 19, 2012


Section 4: Script Definition Details

SAP Class Week of March 19, 2012


BeanShell Scripting Language

ƒ Provides an interpreter which supports full Java syntax

ƒ For the most part, using standard procedural Java code is fine
ƒ Some minor syntax options:
ƒ && can also be done with @and
ƒ || can also be done with @or
ƒ “for” syntax options as well

ƒ Variable typing is optional

ƒ Plenty of information is available at: http://www.beanshell.org

© 2011 SAP AG. All rights reserved. 246

SAP Class Week of March 19, 2012


Scripting Contexts
“where can scripts be initiated in the system”

ƒ When a script is created, the “context” for the script must be selected. The choices are:

ƒ Document Lifecycle
ƒ Loaded
ƒ Created
ƒ Duplicated
ƒ Pre Phase Change
ƒ Post Phase Change
ƒ Validated
ƒ Saved
ƒ Pre-Publish to ERP
ƒ Collection Validation
ƒ Field Validation
ƒ Field Data Edit
ƒ Toolbar
ƒ Import Lifecycle
ƒ Init, Pre-Process Row, Should Process Row, Process Row, Ok to Save, Save, Final

© 2011 SAP AG. All rights reserved. 247

SAP Class Week of March 19, 2012


When are the actual events fired?

ƒ Field Data Edit: Executed when user clicks Save and field has changed; prior to
system and script validation; not called on new document; errors stop execution
of system and script validation.
ƒ Validated: Executed when user clicks Save AND there are changes to the
document; after system validation
ƒ Field Validation: Executed after system and script validation; only called if field
has been changed (or on a new document).
ƒ Collection Validation: Executed after system and script validation and after field
validations.
ƒ Saved: Executed after save to database, but prior to transaction commit; only
executed if validations did not result in error.
ƒ Created: Executed when a document is created.
ƒ Duplicated: Executed when a document is duplicated (NOTE: Create from
Template results in a Duplicated event, not Created)
ƒ Loaded: Executed when a document is loaded from the database.

© 2011 SAP AG. All rights reserved. 248

SAP Class Week of March 19, 2012


When are the actual import events fired?

ƒ Init: Executed at the beginning of file processing. No record or document data is available.

ƒ Pre-Process Row: Allows access to the inbound data before the document has been
created

ƒ Should Process Row: Gives the opportunity to reject the import of a particular row.

ƒ Process Row: Gives the opportunity to manipulate the newly created “doc” before it is
saved. Executed after creation, but before document lifecycle validated script.

ƒ Ok to Save: Gives the opportunity to reject a document

ƒ Save: Executed after the document is saved.

ƒ Final: Executed at the end of the file processing. No record or document data is available.

© 2011 SAP AG. All rights reserved. 249

SAP Class Week of March 19, 2012


Access to information through variables

Certain variables are made available to the script to provide contextual access to
information and business documents in the system

Variables pre-populated by Sourcing vary by context:

y Always populated
– doc: the document on which the script is executing
– session: the current users session

y Pre- and Post-Phase change events:


– current_phase: the current phase
– other_phase: the previous/next phase
– phase_advancing: set to true if the phase change is moving forward, false otherwise

y Document Duplication
– otherDoc: the document being duplicated

© 2011 SAP AG. All rights reserved. 250

SAP Class Week of March 19, 2012


Access to information through variables (cont’d)

ƒVariables pre-populated by Sourcing vary by context:

ƒ Field Data Edit


ƒ field: the field object being validated
ƒ newFieldValue: the new field value
ƒ fieldValue: the old field value

ƒ Collection Validation
ƒ collection: the collection object being validated

ƒ Import Lifecycle (except Init and Final)


ƒ import_record: the ImportRecordIfc class

© 2011 SAP AG. All rights reserved. 251

SAP Class Week of March 19, 2012


Configuring a Script Definition – General

Script definitions are available from:


ƒ Setup > System Setup > Integration Script Definition

Important fields on the script definition


ƒ Context and Target
ƒ External Id: Not really used anywhere
ƒ Display Name: Meaningful name of the script
ƒ Script Version: Not really used…informational only (no versioning capability)
ƒ Class: The object class that triggers the script
ƒ Instance Type: Typically this will be “Document Only” (Scripts typically not relevant to
templates)
ƒ Document Type: Allows for associating the script with a specific document type
ƒ Script: The code

Show the Script Definition user interface

© 2011 SAP AG. All rights reserved. 252

SAP Class Week of March 19, 2012


Exercise 3

Objective
ƒ Familiarize the user with the Script Definition object

Exercise
ƒ Create your own Project Type for this exercise
ƒ Create a script definition that sets the description of a
Project to the value “Set from Script Definition” when
the user clicks save
ƒ Create a new instance of the object to test the script

© 2011 SAP AG. All rights reserved. 253

SAP Class Week of March 19, 2012


Exercise 3 - Solution

ƒ The script will look like:

ƒ doc.setDocumentDescription("Set from Script Definition");

ƒ The script definition should use the context: Document Lifecycle and the Validated target.

© 2011 SAP AG. All rights reserved. 254

SAP Class Week of March 19, 2012


Configuring a Script Definition – Toolbar

Toolbar scripts are menu items that trigger the script code

Important fields on the script definition for Toolbar scripts


ƒ Toolbar Key: A string identifier that is unique (not see by end users)
ƒ Toolbar Name ID: A localized resource for the menu option
ƒ Toolbar Description ID: A localized resource for the menu option tooltip
ƒ Toolbar Script Visibility: When the script is available (View mode / Edit mode / Both)

Toolbar scripts on objects that are available to suppliers ALSO SHOW in


the supplier portal. Be sure that the logic of the script is not an issue if
accidentally executed by the supplier.

© 2011 SAP AG. All rights reserved. 255

SAP Class Week of March 19, 2012


Exercise 4

Objective
ƒ Familiarize the user with toolbar scripts

Exercise
ƒ Create your own Project Type for this exercise
ƒ Create a toolbar script definition that sets the
description of an object to the value “Set from Script
Definition” when the user chooses the menu choice
ƒ Create a new instance of the object to test the script

© 2011 SAP AG. All rights reserved. 256

SAP Class Week of March 19, 2012


Exercise 4 - Solution

ƒ The script will look like:

ƒ doc.setDocumentDescription("Set from Script Definition");

ƒ The script definition should use the context: Toolbar

© 2011 SAP AG. All rights reserved. 257

SAP Class Week of March 19, 2012


Section 5: Coding best practices

SAP Class Week of March 19, 2012


Script Definition – Generating Errors / Messages

ƒ Error messages are used to provide feedback to the user


ƒ For example: a validation

ƒ Error messages are rendered to the user via exceptions


ƒ Exception class for errors: ApplicationException
ƒ Error messages shown to the user are localized resources
ƒ Example: custom$invalid_field_value
ƒ Bundle: custom
ƒ Resource Id: invalid_field_value
ƒ Error messages are associated with a field

ƒ ApplicationExceptions are created using:


ƒ doc.createApplicationException("field id", "bundle", "resource id");

ƒ Multiple error messages (exceptions) can be accumulated in a single ApplicationException


through the use of chaining exceptions:
ƒ ae.chainAtEnd(bean.createApplicationException("field id", "bundle", "resource id"));

© 2011 SAP AG. All rights reserved. 259

SAP Class Week of March 19, 2012


Script Definition – Generating Errors / Messages

Common pattern should be used in all scripts for accumulating and throwing
exceptions
ƒ Create ApplicationException at the top of the script
ƒ Accumulate exceptions using chainAtEnd and doc.createApplicationException
ƒ Throw the exception at the end of the script if any exceptions were accumulated

// Create Application Exception to hold exceptions


ApplicationException ae = new ApplicationException(session);
...
...
// Chain a new exception to the list
ae.chainAtEnd(doc.createApplicationException("field id", "bundle", "resource id"));
...
...
// If we get to the end and have some exceptions, throw them now
if (ae.getChain() != null)
{
throw ae.getChain();
}

© 2011 SAP AG. All rights reserved. 260

SAP Class Week of March 19, 2012


Script Definition –
Generating Errors / Messages – Collections

Common pattern should be used in all scripts for accumulating and throwing
exceptions related to collection iterations

y Create ApplicationException at the top of the script

y Accumulate exceptions using chainAtEnd and member.createApplicationException

y Add an exception for the collection using chainAtEnd and doc.createApplicationException

y Throw the exception at the end of the script if any exceptions were accumulated

© 2011 SAP AG. All rights reserved. 261

SAP Class Week of March 19, 2012


Script Definition –
Generating Errors / Messages – Collections

// Create Application Exception to hold exceptions


ApplicationException ae = new ApplicationException(session);
...
...
// Iterate over collection
extColl = doc.getExtensionCollection("ext collection internal id");
if (extColl.size() > 0)
{
extIter = extColl.iterator();
while (extIter.hasNext())
{
member = extIter.next();

// Associate exception with collection row and field. This
// will create the red box around the filed
ae.chainAtEnd(member.createApplicationException("field id", "bundle", "resource
id"));
}
}
...
...
// If we get to the end and have some exceptions, throw them now
if (ae.getChain() != null)
{
// Add another message that will show below the collection
ae.chainAtEnd(doc.createApplicationException("ext collection internal id", "bundle",
"resource id"));
throw ae.getChain();
}
© 2011 SAP AG. All rights reserved. 262

SAP Class Week of March 19, 2012


Script Definition –
Generating Errors / Messages – Collections – Example

// Create Application Exception to hold exceptions


ApplicationException ae = new ApplicationException(session);
// Iterate over collection
extColl = doc.getExtensionCollection("Savings");
if (extColl.size() > 0)
{
extIter = extColl.iterator();
while (extIter.hasNext())
{
member = extIter.next();
// Make sure the year has a value
if (!hasValue(member.get("SAVINGS_YEAR")))
{
// Associate exception with collection row and field. This
// will create the red box around the filed
ae.chainAtEnd(member.createApplicationException("SAVINGS_YEAR", "custom", "savings_missing_year"));
}
// Make sure the amount has a value
if (!hasValue(member.get("SAVINGS_AMT")))
{
ae.chainAtEnd(member.createApplicationException("SAVINGS_AMT", "custom", "savings_missing_amount"));
}
}
}
// If we get to the end and have some exceptions, throw them now
if (ae.getChain() != null)
{
// Add another message that will show below the collection
ae.chainAtEnd(doc.createApplicationException("Savings", "custom", "savings_errors"));
throw ae.getChain();
}

© 2011 SAP AG. All rights reserved. 263

SAP Class Week of March 19, 2012


Exercise 5

Objective
ƒ Work with error messages

Exercise
ƒ Create your own Project Type for this exercise
ƒ Create a script definition that generates an error when
the description of the object starts with “Set from Script
Definition”
ƒ Create a new instance of the object to test the script

© 2011 SAP AG. All rights reserved. 264

SAP Class Week of March 19, 2012


Exercise 5 - Solution

ƒ Script should be on the validated document life cycle event


ƒ Localized resource called “custom$invalid_description” should be created

// Create the application exception to collect errors


ae = new ApplicationException(session);

// Check if the description starts with the string


if (doc.getDocumentDescription() != null @and
doc.getDocumentDescription().startsWith("Set from Script Defintion"))
{
ae.chainAtEnd(
doc.createApplicationException("DOCUMENT_DESCRIPTION", "custom",
"invalid_description"));
}

// If there are errors, throw them


if (ae.getChain() != null)
{
throw ae.getChain();
}

© 2011 SAP AG. All rights reserved. 265

SAP Class Week of March 19, 2012


Script Definition – Preceding Comments

ƒ When there are errors in the script definition, the message presented to the user
can be confusing an not meaningful

ƒ It can be helpful to include a “preceding comment” in the first line of the script
code to provide a slightly better message
/* Error in setting the document description */

© 2011 SAP AG. All rights reserved. 266

SAP Class Week of March 19, 2012


Script Definition – Imports

ƒ The following packages are automatically available in all scripts:

import com.sap.odp.api.common.db.metadata.*;
import com.sap.odp.api.common.exception.*;
import com.sap.odp.api.common.log.*;
import com.sap.odp.api.common.platform.*;
import com.sap.odp.api.common.types.*;
import com.sap.odp.api.doc.*;
import com.sap.odp.api.ibean.*;
import com.sap.odp.api.ibean.metadata.*;
import com.sap.odp.api.util.*;
import com.sap.odp.api.common.importer.*;
import com.sap.odp.common.platform.*;
import java.math.*;

ƒ Any classes used in packages not imported will need to be explicitly imported in the script

© 2011 SAP AG. All rights reserved. 267

SAP Class Week of March 19, 2012


Scripting – hasValue

ƒ Convenience method available in all scripts


ƒ Returns FALSE for:
ƒ Null values
ƒ Empty strings
ƒ Sourcing/CLM data types that are not set
ƒ Object Reference (includes VLV which are Localized Object Reference)
ƒ Price
ƒ Attachment
ƒ Sys Date
ƒ Sys Date Time

Value list values with the None value will return FALSE (None is not a
valid value)
Example:
if (hasValue(doc.getDocumentDescription()))

© 2011 SAP AG. All rights reserved. 268

SAP Class Week of March 19, 2012


IAPIs: Home / Bean Class Structure

Home Class
ƒ Used to access Lifecycle methods of a business document
ƒ Create
ƒ Finders
ƒ Save
ƒ ChangePhase

Bean Class
ƒ Used to access data fields on a business document

All top-level business documents have a Home class and a Bean class

Example:
ƒ ProjectIBeanHomeIfc and ProjectIBeanIfc
ƒ ContractIBeanHomeIfc and ContractIBean
ƒ RfxDocIBeanHomeIfc and RfxDocIBeanIfc
ƒ VendorIBeanHomeIfc and VendorIBeanIfc
© 2011 SAP AG. All rights reserved. 269

SAP Class Week of March 19, 2012


IAPIs: Home / Bean Class Structure

Example: Using the home interface of suppliers to retrieve the supplier object for a
master agreement (perhaps to lookup some supplier data)

// Find the vendor object from the master agreement

// First get the vendor home based on the agreement


// object reference
vendorHome = IBeanHomeLocator.lookup(session, VendorIBeanHomeIfc.sHOME_NAME);

// Now use the home finder to get the vendor object


vendorBean = vendorHome.find(doc.getVendorRef());

© 2011 SAP AG. All rights reserved. 270

SAP Class Week of March 19, 2012


Common Packages and Classes

Contracts Module:
ƒ Package: import com.sap.eso.api.contracts.*;
ƒ Classes:
ƒ ContractIBeanHomeIfc – Master Agreement Home
ƒ ContractIBeanIfc – Master Agreement Bean
ƒ AgreementIBeanHomeIfc – Sub Agreement Home
ƒ AgreementIBeanIfc – Sub Agreement Bean
ƒ ContractDocumentIBeanHomeIfc – Contract Document Home
ƒ ContractDocumentIBeanIfc – Contract Document Bean

Projects Module:
ƒ Package: import com.sap.eso.api.projects.*;
ƒ Classes:
ƒ ProjectIBeanHomeIfc – Project Home
ƒ ProjectIBeanIfc – Project Bean
ƒ ProjectSchedItemIBeanIfc – Project Schedule Item

© 2011 SAP AG. All rights reserved. 271

SAP Class Week of March 19, 2012


Common Packages and Classes

Vendors Module:
ƒ Package: import com.sap.odp.api.doccommon.masterdata.*;
ƒ Classes:
ƒ VendorIBeanHomeIfc – Vendor Home
ƒ VendorIBeanIfc – Vendor Bean

© 2011 SAP AG. All rights reserved. 272

SAP Class Week of March 19, 2012


Useful Classes and Methods

Working with extensions

ƒ Important methods on business documents and master data (IBeanIfc)


ƒ ExtensionFieldIfc getExtensionField(String fieldId)
ƒ ExtensionCollectionIfc getExtensionCollection(String collectionId)

ƒ Important classes
ƒ ExtensionFieldIfc
ƒ ExtensionCollectionIfc
ƒ ExtensionCollectionMemberIfc

Show the JavaDocs for extension classes

© 2011 SAP AG. All rights reserved. 273

SAP Class Week of March 19, 2012


Useful Classes and Methods

ƒ Extension collection sample code

© 2011 SAP AG. All rights reserved. 274

SAP Class Week of March 19, 2012


Useful Classes and Methods

ƒ IapiDocumentLockManager
ƒ Provides methods to lock / unlock entire documents as well as individual fields on a
document
ƒ IapiDBHandleIfc
ƒ Accessed from the session variable
ƒ Provides methods for querying the database
ƒ IapiSessionContextIfc
ƒ Available via session variable
ƒ Access to dbHandle
ƒ Access to current logged in user information
ƒ IBeanHomeLocator
ƒ Provides methods to get Home instance for a given class
ƒ Logger / LogMessageIfc
ƒ Provides methods for logging to standard E-Sourcing log file

© 2011 SAP AG. All rights reserved. 275

SAP Class Week of March 19, 2012


Useful Classes and Methods

ƒ IapiQueryExecIfc
ƒ Ability to execute Sourcing / CLM query definitions
ƒ IapiQueryResultSetIfc
ƒ Query definition results
ƒ ImportRecordIfc
ƒ Class associated with a record in the import lifecycle script targets

© 2011 SAP AG. All rights reserved. 276

SAP Class Week of March 19, 2012


Useful Coding Constructs

Conditional logic based on value list value


ƒ Example using Master Agreement status VLV
// Ensure the contract value is specified on executed contracts
vlvHome = IBeanHomeLocator.lookup(session, doc.getStatusRef());
vlv = vlvHome.find(doc.getStatusRef());
if (vlv.getDisplayName().equals("Executed")) { … }

Finding an object using an object reference


ƒ Example using Master Agreement vendor object reference
// Use the vendor object reference to open the vendor record
vendorHome = IBeanHomeLocator.lookup(session, doc.getVendorRef());
vendorBean = vendorHome.find(doc.getVendorRef());

Conditional logic using hasValue


ƒ Example using an extension field
// Check if the extension has a value
if (!hasValue(doc.getExtensionField("attribute id").get())) {…}

© 2011 SAP AG. All rights reserved. 277

SAP Class Week of March 19, 2012


Useful Coding Constructs

Logging

logMsg = Logger.createLogMessage(session);
logMsg.setLogMessage("*****MSG GOES HERE*****");
Logger.info(logMsg);

© 2011 SAP AG. All rights reserved. 278

SAP Class Week of March 19, 2012


Useful Coding Constructs

„ IapiDbHandlIeIfc has very specific coding protocols to ensure proper transaction management
finally
// retrieve the handle from the session. {
dbHandle = session.getUserTransaction(); // this try...finally with optional catch blocks is not necessarily
// only way but is by the far the simplest way
// outer non-transaction try block // to meet the requirement to call handle.endTransaction
try // once and only once after a successful beginTransaction
{ // Note: the handle.beginTransaction/endTransaction pair must
// begin a transaction // be coded in the same method. We support the capability to
// if beginTransaction succeeds, that is, returns without // nest matched pairs of begin/endTransaction calls so passing
// throwing an exception we MUST call endTransaction on the // the session used to acquire the handle is sufficient to
// same handle once and only once. Note that there may already be // code multiple methods participating in the same transaction
// an active transaction from an enclosing method call. No matter // their is no need,nor is it desirable to pass around a handle.
// the DbHandle begin/endTransaction methods support nesting of begin/end dbHandle.endTransaction();
// calls provided all of the callers properly implement their begin/end }
// transaction methods. }
dbHandle.beginTransaction(); catch(Exception ex)
try {
{ // you might want to catch more specific exception types
// if you execute non-DbHandle methods such as object lifecycle // in almost all cases you need to re-throw the exception
// operations which can throw exceptions // to inform callers of the failure
// you must use an inner try...catch to indicate that an throw ex;
// application error occurred for proper transaction handling }
try
{
// dbHandle and other coding done here
}
catch(ChainedException ex)
{
// inform the handle that an error occurred and the
// transaction should be rolled back. The handle will
// detect this automatically for SQL and NoConnection
// exceptions
dbHandle.setErrorDetected();

// you cannot usually handle this error but must re-throw it to


// the outer catch block
throw ex;
© 2011 }SAP AG. All rights reserved. 279
}

SAP Class Week of March 19, 2012


Exercise 6

Objective
ƒ Develop a useful validation script

Exercise
ƒ Create your own RFx Type for this exercise
ƒ Develop a script that generates an error
when the name of an RFx starts with
“From template”
ƒ Create your own RFx Type for this exercise
so that each student can do their own
script

© 2011 SAP AG. All rights reserved. 280

SAP Class Week of March 19, 2012


Exercise 6 – Solution

Create localized resource in “custom” bundle to hold the error message (e.g.,
exception$rfx_must_specify_name)

Create script definition


ƒ Scripting Context: Document Lifecycle Event
ƒ Class: RFx (900)
ƒ Instance Type: Document Only
ƒ Document Type: The own created by your for the exercise
ƒ Target: Validated

Alternative
ƒ The script context could be Field Validation and the script could be associated specifically
with the DISPLAY_NAME field.

© 2011 SAP AG. All rights reserved. 281

SAP Class Week of March 19, 2012


Exercise 6 – Solution

// Create an exception to capture errors


ApplicationException ae = new ApplicationException(session);

// Do not allow the user to save an RFx when the name begins with From template
if (doc.getDisplayName().startsWith("From Template"))
{
ae.chainAtEnd(doc.createApplicationException("DISPLAY_NAME", "custom",
"rfx_must_specify_name"));
}

// If we have any exceptions here, then throw them


if (ae.getChain() != null)
{
throw ae.getChain();
}

© 2011 SAP AG. All rights reserved. 282

SAP Class Week of March 19, 2012


Exercise 7

Objective
ƒ Develop a useful validation script

Exercise
ƒ Add an extension to the Contracts module that
specifies the total value of the contract. Add a script
that makes this field required when the contract is in
the Executed status.
ƒ Create your own Master Agreement Type for this
exercise so each student can do their own script

© 2011 SAP AG. All rights reserved. 283

SAP Class Week of March 19, 2012


Exercise 7 – Solution

ƒ Create localized resource in “custom” bundle to hold the error message (e.g.,
exception$total_value_not_specified)

ƒ Create extension field using extension definition (best to use Price data type)

ƒ Create script definition


ƒ Scripting Context: Document Lifecycle Event
ƒ Class: Master Agreement (1004)
ƒ Instance Type: Document Only
ƒ Document Type: The MA Type created by you
ƒ Target: Validated

© 2011 SAP AG. All rights reserved. 284

SAP Class Week of March 19, 2012


Exercise 7 – Solution

// Create an exception to capture errors


ApplicationException ae = new ApplicationException(session);

// Ensure the contract value is specified on executed contracts


vlvHome = IBeanHomeLocator.lookup(session, doc.getStatusRef());
vlv = vlvHome.find(doc.getStatusRef());
if (vlv.getDisplayName().equals("Executed") @and
!hasValue(doc.getExtensionField("TotalContractValue").get()))
{
ae.chainAtEnd(doc.createApplicationException("TotalContractValue", "custom",
"total_value_not_specified"));
}

// If we have any exceptions here, then throw them


if (ae.getChain() != null)
{
throw ae.getChain();
}

© 2011 SAP AG. All rights reserved. 285

SAP Class Week of March 19, 2012


Exercise 8

Objective
y Develop a useful validation script on a collection

Exercise
y Add an extension collection to the projects module that
has two fields: a year VLV and a monetary amount.
Name the extension collection “Yearly Savings”. Add a
script validation to the projects module that ensures
that each row in the collection is fully specified.
y Create your own Project Type for this exercise so each
student can do their own script

© 2011 SAP AG. All rights reserved. 286

SAP Class Week of March 19, 2012


Exercise 8 – Solution

Create localized resources in “custom” bundle to hold the error message

Create extension fields using extension definition

Create script definition


ƒ Scripting Context: Document Lifecycle Event
ƒ Class: Project (1100)
ƒ Instance Type: Document Only
ƒ Document Type: The Project Type created by you for this exercise
ƒ Target: Validated

Alternative
ƒ The script context could be Collection Validation and the script could be associated
specifically with the YEARLYSAVINGS collection.

© 2011 SAP AG. All rights reserved. 287

SAP Class Week of March 19, 2012


Exercise 8 – Solution
// Create an exception to capture errors
ApplicationException ae = new ApplicationException(session);

// Make sure each row is specified in the YearlySavings collection


savingsColl = doc.getExtensionCollection("YearlySavings");
if (savingsColl.size() > 0)
{
savingsIter = savingsColl.iterator();
while (savingsIter.hasNext())
{
member = savingsIter.next();

// Check that the year is specified


if (!hasValue(member.get("SavingsYear")))
{
ae.chainAtEnd(member.createApplicationException("SavingsYear", "custom", "savings_year_not_specified"));
}
// Check that the value is specified
if (!hasValue(member.get("SavingsAmount")))
{
ae.chainAtEnd(member.createApplicationException("SavingsAmount", "custom",
"savings_amount_not_specified"));
}
}
}
// If we have any exceptions here, then throw them
if (ae.getChain() != null)
{
// First, add in an exception to display below the collection
ae.chainAtEnd(doc.createApplicationException("YearlySavings", "custom", "yearly_savings_errors"));
throw ae.getChain();
}
© 2011 SAP AG. All rights reserved. 288

SAP Class Week of March 19, 2012


Exercise 9

Objective
ƒ Develop a toolbar script and
use utility IAPIs

Exercise
ƒ Add a toolbar script to the
projects module that locks the
savings collection so that no
rows can be added or deleted.
Write the script such that only
the document owner can run
the script. Add a second
toolbar script to the projects
module that unlocks the
savings collection.

© 2011 SAP AG. All rights reserved. 289

SAP Class Week of March 19, 2012


Exercise 9 – Solution

ƒ Create localized resource in “custom” bundle to hold the error message

ƒ Create script definition


ƒ Scripting Context: Toolbar
ƒ Class: Project (1100)
ƒ Instance Type: Document Only
ƒ Document Type: Any
ƒ Toolbar Key: lock_yearly_savings

ƒ Create script definition


ƒ Scripting Context: Toolbar
ƒ Class: Project (1100)
ƒ Instance Type: Document Only
ƒ Document Type: Any
ƒ Toolbar Key: unlock_yearly_savings

© 2011 SAP AG. All rights reserved. 290

SAP Class Week of March 19, 2012


Exercise 9 – Solution

// Script 1
// First check that the user is the owner
if (!session.getAccount().getAccountObjectReference().getObjectId().equals(
doc.getDocumentOwnerUserReference().getObjectId()))
{
throw doc.createApplicationException(null, "custom",
"only_document_owner_can_execute");
}

// If we get here, we can lock the collection


IapiDocumentLockManager.lockField(session, doc, "YearlySavings");

// Script 2
// First check that the user is the owner
if (!session.getAccount().getAccountObjectReference().getObjectId().equals(
doc.getDocumentOwnerUserReference().getObjectId()))
{
throw doc.createApplicationException(null, "custom",
"only_document_owner_can_unlock");
}

// If we get here, we can lock the collection


IapiDocumentLockManager.unlockField(session, doc, "YearlySavings");
© 2011 SAP AG. All rights reserved. 291

SAP Class Week of March 19, 2012


Exercise 10

Objective
y Develop a useful validation script that also requires
using Home classes

Exercise
y Add a string extension to the contracts module named
“no diversity justification”. Add a script validation to the
contracts module that requires that this field be
populated if the vendor on the contract is not diverse.
y Use the MA Type created in exercise #7

© 2011 SAP AG. All rights reserved. 292

SAP Class Week of March 19, 2012


Exercise 10 – Solution

ƒ Create localized resource in “custom” bundle to hold the error message

ƒ Create extension field using extension definition

ƒ Update script definition from exercise #7


ƒ Scripting Context: Document Lifecycle Event
ƒ Class: Master Agreement (1004)
ƒ Instance Type: Document Only
ƒ Document Type: The MA Type created by you in exercise #7
ƒ Target: Validated

© 2011 SAP AG. All rights reserved. 293

SAP Class Week of March 19, 2012


Exercise 10 – Solution
// Create an exception to capture errors
ApplicationException ae = new ApplicationException(session);

// Ensure the contract value is specified on executed contracts


vlvHome = IBeanHomeLocator.lookup(session, doc.getStatusRef());
vlv = vlvHome.find(doc.getStatusRef());
if (vlv.getDisplayName().equals("Executed") @and
!hasValue(doc.getExtensionField("TotalContractValue").get()))
{
ae.chainAtEnd(doc.createApplicationException("TotalContractValue", "custom", "total_value_not_specified"));
}

// Use the vendor object reference to open the vendor record


vendorHome = IBeanHomeLocator.lookup(session, doc.getVendorRef());
vendorBean = vendorHome.find(doc.getVendorRef());
if (!vendorBean.getEightFirm().booleanValue() @and
!vendorBean.getHubZoneBiz().booleanValue() @and
!vendorBean.getMinorityBiz().booleanValue() @and
!vendorBean.getNonProfit().booleanValue() @and
!vendorBean.getSmallBiz().booleanValue() @and
!vendorBean.getVetOwned().booleanValue() @and
!vendorBean.getWomenBiz().booleanValue() @and
!hasValue(doc.getExtensionField("NoDiversityJustification").get()))
{
ae.chainAtEnd(doc.createApplicationException("NoDiversityJustification", "custom",
"missing_no_diversity_justification"));
}

// If we have any exceptions here, then throw them


if (ae.getChain() != null)
{
throw ae.getChain();
}
© 2011 SAP AG. All rights reserved. 294

SAP Class Week of March 19, 2012


SAP Sourcing / Contract Lifecycle Mgmt
Approval Workflow
Aug 2011

SAP Class Week of March 19, 2012


Agenda & Expectations

Agenda
ƒ Section 1: Introduction to Workflow
ƒ Section 2: Configuring Workflows
ƒ Section 3: Developing Workflows in XPDL

ƒ Exercises throughout

Expectations
ƒ SAP Sourcing Approval Workflow requires coding in a Java-like language called Beanshell;
as a result, students must be capable with a high-level programming language (Java
preferable) to complete the exercises successfully
ƒ It is expected that students participating in this training have completed the Sourcing
Business Rule Design and Scripting training

© 2011 SAP AG. All rights reserved. 298

SAP Class Week of March 19, 2012


Section 1: Introduction to Workflow

SAP Class Week of March 19, 2012


Overview

ƒ What is Approval Workflow?


ƒ A capability of Sourcing / CLM to have certain business documents routed for approvals
(or rejections)
ƒ What is provided with the Sourcing / CLM Approval Workflow?
ƒ Management and tracking of the tasks involved with the process
ƒ Ability to set either individual users or a group of users as the required approver(s)
ƒ Group approval is either all members of the group or any member of the group
ƒ Approvers are added as collaborators using the Approver collaborator role
ƒ What are the key components of the Sourcing / CLM Approval Workflow
ƒ Workflow Definitions
ƒ XML Process Definition Language (XPDL)
ƒ Configurable Phase Definitions
ƒ Where are the capabilities available?
ƒ Projects
ƒ Contract Documents
ƒ Suppliers
ƒ UDO 1-5
© 2011 SAP AG. All rights reserved. 300

SAP Class Week of March 19, 2012


Customer Approval Workflow Examples

ƒ Route a contract document for approval through levels of the procurement


management hierarchy using the value of the contract to determine if an approval
is required

ƒ Route a project for approval based on the category and the value

ƒ Route supplier registrations for approval to a centralized supplier management


group

ƒ Route a contract document for approval based on the contract manager knowing
to whom the document must go

Show a Workflow example in the system

© 2011 SAP AG. All rights reserved. 301

SAP Class Week of March 19, 2012


What is provided by Sourcing / CLM

ƒ A workflow “engine” that manages and tracks the approval process steps

ƒ The engine is responsible for


ƒ Locking document
ƒ Sending emails
ƒ Unlocking documents
ƒ Managing the approval process

ƒ The engine does not provide the rules by which approvers are selected

ƒ It is the responsibility of the customer / implementation team to


ƒ Define the rules by which approvers are selected
ƒ Model those rules in the system (commonly done with extensions)
ƒ Build / develop any logic that is required to utilize the rules (likely using Beanshell
scripting)

© 2011 SAP AG. All rights reserved. 302

SAP Class Week of March 19, 2012


Workflow and SAP Sourcing/CLM Deployment Modes

ƒ Licensed On-Premise: Workflow available

ƒ Licensed Hosted: Workflow available

ƒ Private OnDemand: Workflow available

ƒ Public OnDemand: Available as a SAP Value


Added service only

© 2011 SAP AG. All rights reserved. 303

SAP Class Week of March 19, 2012


Section 2: Configuring Workflow

SAP Class Week of March 19, 2012


Phase Configurations

ƒ Phase configurations are a required component when enabling workflow

ƒ Phase configurations are used to model the business process for a business
document

ƒ Multiple phase configurations can be configured and each “document type” can
have its own phase configuration

ƒ Each phase is a value from the phase value list type (Project Phase, Contract
Document Phase, Supplier Phase, User Defined Phase 1-5)

ƒ Accessed from Setup > Document Setup > [Projects, Contract Documents,
Suppliers,
pp UDO]

Show a Project Configurable Phase Definition

© 2011 SAP AG. All rights reserved. 305

SAP Class Week of March 19, 2012


Exercise 1

Objective
ƒ Familiarize yourself with configurable phase definitions

Exercise
ƒ Create a Project Configurable Phase Definition with
these phases: Under Review, Project Approval,
Strategy Planning, RFx, Awarding. Each phase should
be able to be transitioned backwards to the previous
phase and forwards to the next phase.
ƒ Make the Project Approval phase required

© 2011 SAP AG. All rights reserved. 306

SAP Class Week of March 19, 2012


Exercise 1 – Solution

Create the Project Configurable Phase Definition from Setup > Document setup >
Projects > Project Configurable Phase Definition

© 2011 SAP AG. All rights reserved. 307

SAP Class Week of March 19, 2012


Workflow and Phase Configurations

ƒ A workflow is associated with a single phase in a configurable phase definition


ƒ A workflow may include multiple process steps
ƒ Each step will have one or more approvers
ƒ If a step does not require an approver, it will be “skipped” and the next step will
be processed
ƒ Typically, the final step will transition the phase of the business document to the
next phase (approval) or previous phase (rejection)

Under Project Strategy


RFx Awarding
Review Approval Planning

WF Step 1
Reject
WF Step 2 Approve
WF Step 3
© 2011 SAP AG. All rights reserved. 308

SAP Class Week of March 19, 2012


Workflow Definition

ƒ Workflow definitions are used to define a specific approval workflow process (Setup >
System Setup > Workflow > Workflow Definitions)
ƒ Each Workflow definition includes a name, a description, and a collection of “process
templates”
ƒ The process template must always be an “approval workflow”
ƒ Process Owner Role: Collaborator role of background process user executing workflow
ƒ Active Approver Role: Collaborator role used for the active approver(s)
ƒ Inactive Approver Role: Collaborator role used after a user has completed
approval/rejection (typically “Collaborator” or “Reviewer”)
ƒ XPDL Source: .xpdl file

Define a process template


as shown: always define
as “approval workflow”;
select the roles as shown
(choose reviewer for
Inactive Approver Role if
read access is desired)

© 2011 SAP AG. All rights reserved. 309

SAP Class Week of March 19, 2012


Configuring Workflow – Object Dependency

Workflow
Definition
XPDL
Prescript
Value List Conf. Phase
Type Definition Postscript

Document
Type Extension
Definition

User
Groups

© 2011 SAP AG. All rights reserved. 310

SAP Class Week of March 19, 2012


Exercise 2

Objective
y Familiarize yourself with workflow definitions

Exercise
y Using the attached XPDL, create a new Workflow
Definition
y Update the configurable phase definition created in
exercise 1 so that the “Project Approval” phase uses
the workflow definition
y Create a new Project Type that uses the configurable
phase definition
y Create a new Project from the Project Type and
execute the workflow approvals

© 2011 SAP AG. All rights reserved. 311

SAP Class Week of March 19, 2012


Exercise 2 – Solution

ƒ Create Workflow Definition with XPDL


ƒ Update Project Configurable Phase to use Workflow Definition
ƒ Create Project Type using Project Configurable Phase
ƒ Create Project from Project Type
ƒ Add a collaborator with role Approver
ƒ Move through phases to Project Approval
ƒ Approve project as user added above

© 2011 SAP AG. All rights reserved. 312

SAP Class Week of March 19, 2012


Section 3: Developing Workflows

SAP Class Week of March 19, 2012


XML Process Definition Language (XPDL)

An XML schema for defining automatable processes

Open standard supported by the WfMC (http://www.wfmc.org)

XML format can be “extended” to support vendor/application (SAP Sourcing)


specific elements

SAP Sourcing / CLM uses the extensions to support, for example:


y Prescript: Beanshell script code typically executed to identify the approvers
y Postscript: Beanshell script code executed after a process step is complete

© 2011 SAP AG. All rights reserved. 314

SAP Class Week of March 19, 2012


Designing a process with the XPDL editor

ƒ Together Workflow Editor


ƒ Free XPDL editor
ƒ 7.0 and later supports Together Workflow Editor 2.1.1 and later
ƒ Earlier releases only support 2.1.1 (may need to request this version from the trainer)

ƒ Always start with a known working XPDL file from (use the empty.xpdl from the earlier
exercise, for example)

ƒ Key components of XPDL


ƒ Activities (Process Steps)
ƒ Transitions

ƒ Double click activities


and transitions to get
to the properties

© 2011 SAP AG. All rights reserved. 315

SAP Class Week of March 19, 2012


XPDL Components – Process Steps

ƒ Each workflow process step typically has a “Prescript” that includes the
Beanshell logic to “add approvers” to the business document

ƒ Approvers may be either a specific user account or a group

ƒ Workflow process steps also may have a “Postscript” that includes Beanshell
logic performed after an approval or rejection
ƒ This is typically used in the final workflow step to manage phase transition

© 2011 SAP AG. All rights reserved. 316

SAP Class Week of March 19, 2012


XPDL Components – Transitions

ƒ Each transition is of type “conditional” and will indicate


ƒ Whether to move to the next process step, or
ƒ Whether to proceed to the final step

© 2011 SAP AG. All rights reserved. 317

SAP Class Week of March 19, 2012


XPDL Components – Beanshell Scripting

ƒ Prescript and Postscript utilize Beanshell scripting to perform required logic

ƒ Variables available
ƒ doc: The doc variable is available to access the business document on which the
workflow is executing
ƒ session: The session variable is available to access the current session

© 2011 SAP AG. All rights reserved. 318

SAP Class Week of March 19, 2012


Typical prescript

// Logic here to establish user or group that will


// approve as part of this step


principal = …;

// If an approver was established based on the logic


// then add them as an approver now
if (hasValue(principal))
{
// Add the user account as the approver
addApprover(principal);
}

© 2011 SAP AG. All rights reserved. 319

SAP Class Week of March 19, 2012


addApprover function

Adding a specific user as an approver

addApprover(<user object reference>);

Adding a specific user group as an approver where any user can approve

addApprover(<user group object reference>,


new CollaboratorApprovalRuleType(0));

Adding a specific user group as an approver where all users must approver

addApprover(<user group object reference>,


new CollaboratorApprovalRuleType(1));

© 2011 SAP AG. All rights reserved. 320

SAP Class Week of March 19, 2012


Typical postscript
// The final step of the approval process moves the phase of the Project to Approved (if all approvals were made) or back to Draft (if
there was a denial).
// Create a logger for messaging
logMsg = Logger.createLogMessage(session);
// If we are not approved, then change the phase backward
if (getApprovalStatus() != APPROVED)
{
home = doc.getIBeanHomeIfc();
home.upgradeToEdit(doc);
try
{
home.changePhase(doc,"Draft");
}
catch(e)
{
logMsg.setLogMessage(e.toString());
logMsg.setException(e);
Logger.error(logMsg);
}
}
// If we are approved, change the phase forward
if (getApprovalStatus() == APPROVED)
{
home = doc.getIBeanHomeIfc();
home.upgradeToEdit(doc);
try
{
home.changePhase(doc,"Approved");
}
catch(e)
{
logMsg.setLogMessage(e.toString());
logMsg.setException(e);
Logger.error(logMsg);
}
}
© 2011 SAP AG. All rights reserved. 321

SAP Class Week of March 19, 2012


Step Transitions

ƒ Transitioning from Step 1 to Step 2


ƒ getApprovalStatus() == APPROVED

ƒ Transitioning from Step 1 to End


ƒ getApprovalStatus() == DENIED

ƒ Transitioning from Last Step to End


ƒ getApprovalStatus() != PENDING

© 2011 SAP AG. All rights reserved. 322

SAP Class Week of March 19, 2012


Other Extended Attributes

ƒ LocalizedDescription: Localized Resource used in approval email

ƒ LocalizedInstructions: Localized Resource used in approval email

ƒ Duration and DurationUnit not used

ƒ ApprovalActivity: Always set to TRUE

© 2011 SAP AG. All rights reserved. 323

SAP Class Week of March 19, 2012


Implementation Steps

ƒ Defines rules by which approvers will be established


ƒ Design extensions that are required to support the rules
ƒ Create User Groups (if necessary) that are used for approver logic
ƒ Develop XPDL, including pre and post scripts for workflow steps
ƒ Update appropriate Value List Type with phases
ƒ Create Workflow Definition in Sourcing
ƒ Create Configurable Phase Definition in Sourcing and associated Workflow
Definition with appropriate phase
ƒ Create Document Type that utilizes Configurable Phase Definition
ƒ Test
ƒ Approval conditions
ƒ Rejection conditions

© 2011 SAP AG. All rights reserved. 324

SAP Class Week of March 19, 2012


Implementation Tips

Workflows can be cancelled by an Administrator from a report on the


Workflow Definition - This is also useful if Workflows “lock-up” during
development (e.g., script error)

Phases that include a Workflow should typically be made required phases

Can not add a Workflow to the first phase (it can never be re-submitted
if it is cancelled)

It is always best to represent as much of the logic/rules as data

© 2011 SAP AG. All rights reserved. 325

SAP Class Week of March 19, 2012


Approval Workflow Limitations

ƒ Parallel threads of approval are not possible. Within a single process step, a
group may be used for parallel approvals, but separate threads of process steps
may not be executed in parallel.

ƒ Users may not “forward” their approval responsibility to another user

ƒ There is no capability to “delegate” approvals (e.g., while on vacation or out sick)

ƒ With the exception of Suppliers, the business document is locked while it is in


Workflow. As a result, no changes to the document are allowed.

ƒ There is no view that shows all of the approvers that will be required.

ƒ There is no way to combine multiple contract documents into a single approval


workflow

© 2011 SAP AG. All rights reserved. 326

SAP Class Week of March 19, 2012


Examples Scenarios (1)

ƒ Problem: Approver is based on the Product Category


ƒ Solution:
ƒ Add an user account (or user group) extension to the Product Category object (“Category
Approver”)
ƒ The extension value is read at run time in the workflow script by using the Product
Category object reference on the object being approved and loading the Product
Category object
ƒ The value is used in the “addApprover” call

ƒ Problem: Approver is document owner’s manager


ƒ Solution:
ƒ Add an user account extension to the User Account object (“Manager”)
ƒ The extension value is read at run time in the workflow script by using the User Account
(Owner) object reference on the object being approved and loading the User Account
object
ƒ The value is used in the “addApprover” call

© 2011 SAP AG. All rights reserved. 327

SAP Class Week of March 19, 2012


Example Scenarios (2)

ƒ Problem: Approver(s) are based on the “Type” of object


ƒ Solution:
ƒ Add user account (or user group) extensions to the document type related to the object
type being approved
ƒ The extension values are read at run time in the workflow script by using the document
type object reference on the object being approved and loading the document type object
ƒ The values are used in the “addApprover” call

ƒ Problem: Approver is assigned at run time by the user getting the document
approved
ƒ Solution:
ƒ Add user account (or user group) extensions to the object type being approved
ƒ At run time, the user would populate the values of these fields
ƒ The values are used in the “addApprover” call

© 2011 SAP AG. All rights reserved. 328

SAP Class Week of March 19, 2012


Exercise 3

Objective
ƒ Develop a complete workflow scenario

Exercise
ƒ Add 3 user account extensions to the project type
object: Level 1 Approver, Level 2 Approver, and Level 3
Approver. Develop a project workflow that involves a
serial approval of the 3 approvers listed on the project
type associated with the specific project.
ƒ Duplicate the phase configuration created in exercise 1
and use it as the basis for this exercise
ƒ Ensure the workflow moves forward upon all approvals
being received; the workflow should move the phase
backward if a rejection is received.

© 2011 SAP AG. All rights reserved. 329

SAP Class Week of March 19, 2012


Exercise 4 (Optional)

Objective
ƒ Develop a complex workflow scenario

Exercise
ƒ Add an extension collection to the Internal Category object that has 2 fields: an integer and
a user group. This extension collection is used to identify approvers required for projects
based on the category and the value of the project. If the value of the project is greater than
the value specified within a row in the collection, the group specified in that row will be a
required approver (any user from the group can approver). Each row in the table should be
considered a separate step in the workflow (i.e., that is, each row represents 1 step in a
series of serial approvals). For this exercise, the collection should be populated with 4
rows: 50,000, 250,000, 1,000,000, and 5,000,000 such that an approver can be specified
for the 4 possible tiers. However, to ensure the solution is flexible, allow up to 6 tiers.
Implement a workflow on the projects module that uses this collection extension and adds
the appropriate approvers based on the estimated value of the project.
ƒ EXTRA CREDIT: Identify and implement the necessary validations on the Internal Category
and Project objects to ensure that the workflow will always work in a valid way.

© 2011 SAP AG. All rights reserved. 330

SAP Class Week of March 19, 2012


Exercise 3/4 – Solutions
Workflow Exercise #1

Add 3 user account extensions to the project type object: Level 1 Approver, Level
2 Approver, and Level 3 Approver. Develop a project workflow that involves a
serial approval of the 3 approvers listed on the project type associated with the
specific project. Ensure the project phase consists of 3 phases: Draft, Approval,
Approved, and associate the workflow with the Approval phase. The workflow
should move the phase forward upon all approvals being entered; the workflow
should move the phase backward if a rejection is received.

SOLUTION:

1) Create extensions using Extension Definition

2) Ensure 3 phases are configured in Project Phase Value List

3) Create Workflow Definition that includes a 3-step process. The pre-scripts


for the steps are:

Step 1 pre-script:
import com.frictionless.api.common.exception.*;
import com.frictionless.api.common.log.Logger;
import com.frictionless.api.common.platform.*;
import com.frictionless.api.common.types.*;
import com.frictionless.api.doc.collaboration.*;
import com.frictionless.api.doccommon.masterdata.*;
import com.frictionless.api.ibean.*;
import com.frictionless.api.util.*;
import com.frictionless.api.workflow.*;
import com.frictionless.api.projects.*;
import com.frictionless.api.common.log.*;
import com.frictionless.api.ibean.*;
import com.frictionless.api.usermgmt.masterdata.*;
import com.frictionless.api.doc.collaboration.*;

// Step 1: Add level 1 approver from Project Type

// These hold the name of the extension fields we are concerned


// with.
level1ApproverExtName = "Level1App";

// Create a logger for messaging


logMsg = Logger.createLogMessage(session);

// doc is a ProjectIBeanIfc
typeHome = IBeanHomeLocator.lookup(session, doc.getDocTypeReference());
typeBean = typeHome.find(doc.getDocTypeReference());

// Level 1 Approver
principal = typeBean.getExtensionField(level1ApproverExtName).get();
if (hasValue(principal))
{
// Add the user account as the approver
addApprover(principal);

// log details
logMsg.setLogMessage("Added user: " + principal.getDisplayName() + " as
approver");
Logger.info(logMsg);
}

Step 2 pre-script:
import com.frictionless.api.common.exception.*;

© 2011 SAP AG. All rights reserved. 331

SAP Class Week of March 19, 2012


SAP Sourcing / Contract Lifecycle Mgmt
Change Management and Object Migration
Aug 2011

SAP Class Week of March 19, 2012


Agenda

ƒ Change management

ƒ Importing Data

ƒ Data Migration

ƒ Communication with External systems

© 2011 SAP AG. All rights reserved. 335

SAP Class Week of March 19, 2012


Change Management

ƒ Recommended: 3 Landscapes , Development , QA, Production

ƒ Adequate: 2 Landscapes, Staging & Production

ƒ All development should be done in a Development or Staging system then


migrated to Production.
ƒ Queries / Reports
ƒ Scripts
ƒ Workflows
ƒ Workbench configurations
ƒ LR’s, Extensions, Page Customizations

ƒ ** Challenge in a 2 Landscape scenario - No way to test migration packages


before moving to Production. **

© 2011 SAP AG. All rights reserved. 336

SAP Class Week of March 19, 2012


Change Management

Managing changes

ƒ A repository for Object Migration Packages and Spreadsheets should be created.

ƒ Each change should have a change request or control number assigned to it. All
work for that change should be kept in a directory for that customer and request.

ƒ Any import to the target system should reference that change request.

ƒ Unlike SAP ERP, E-Sourcing does not have extensive built-in versioning control
and there is no “undo” option.

© 2011 SAP AG. All rights reserved. 337

SAP Class Week of March 19, 2012


Importing Data

Data import supports several file formats:


ƒ OMA – the output from an export
ƒ CSV – Comma separated list
ƒ XLS – A excel spreadsheet or specialized version “Workbook”
ƒ XML – actually what’s inside an OMA and contained within specific jar files. An optional way
to install language packs.

Determining what is needed to import a specific data object.


ƒ Get a copy of the enterprise or company workbook
ƒ Use the Reference Guide, select the specific object in question and select CSV view
ƒ “Trick” the system into giving you the appropriate template.

© 2011 SAP AG. All rights reserved. 338

SAP Class Week of March 19, 2012


Workbooks

Getting a copy of the workbooks… Reference Guide (Index) > Select workbook and
save locally.

© 2011 SAP AG. All rights reserved. 339

SAP Class Week of March 19, 2012


Workbooks

ƒ Benefits
ƒ Has the correct import
order (dependency built in)
ƒ Can turn on or off pages
ƒ No need to select proper
data type at import time

© 2011 SAP AG. All rights reserved. 340

SAP Class Week of March 19, 2012


Using the Resource Guide to get help on a template

Getting a specific template.. Reference Guide > Class Reference > pick the class in
question Then select csv view

© 2011 SAP AG. All rights reserved. 341

SAP Class Week of March 19, 2012


You now have the description of this import

© 2011 SAP AG. All rights reserved. 342

SAP Class Week of March 19, 2012


Using the system to give you an individual template

ƒ Prerequisite: Need a “seed” .csv or .xls


ƒ Setup > Import and Export Tools > Import Data > New

© 2011 SAP AG. All rights reserved. 343

SAP Class Week of March 19, 2012


Using the system to give you an individual template

After selecting your seed file click next, pick the object you want the template for and
check the “Preview The Import” checkbox.

© 2011 SAP AG. All rights reserved. 344

SAP Class Week of March 19, 2012


Using the system to give you an individual template

You will now have the visual layout of the object and a link called template.csv. Click
on this link and save it to your desktop rename the file with the target object name.
After save, click cancel.

© 2011 SAP AG. All rights reserved. 345

SAP Class Week of March 19, 2012


The resultant spreadsheet

© 2011 SAP AG. All rights reserved. 346

SAP Class Week of March 19, 2012


Caveats when using CSV and XLS files

ƒ Beware of embedded “,” in text and numbers.


ƒ Beware of special characters and spaces.
ƒ Beware of data types
ƒ You can reference a non existent LR
ƒ You can modify and reimport the same data in most cases with no problem
ƒ Do not mix CLASS ID’s with extensions keep all like ID’s together.
ƒ Importing LR’s does NOT refresh the cache you will need to do this manually
ƒ Case sensitive references!!
ƒ Any out of the box template can be extended to include extensions using the “ID”
of the extension as a column name.

© 2011 SAP AG. All rights reserved. 347

SAP Class Week of March 19, 2012


Periodic/scheduled imports

ƒ Effectively you can implement periodic imports by configuring the source system
to send a correctly configured csv/xls file to a specified location on the
Application server.

ƒ Using specific scheduled tasks these processes can be automated.

ƒ Review available Scheduled task options

© 2011 SAP AG. All rights reserved. 348

SAP Class Week of March 19, 2012


Introduction to Object Migration

SAP Class Week of March 19, 2012


Introduction to Object Migration

There are several ways to Migrate data in the tool:


ƒ Import via worksheet / workbook
ƒ Via the Export Utility export from 1 system import into another
ƒ Manually

Each has “best fit” and limitations.

© 2011 SAP AG. All rights reserved. 350

SAP Class Week of March 19, 2012


Introduction to Object Migration

Export Types (Kind of Export):


ƒ Single Object – allows selection of a single object
ƒ Object List – Query based group of objects
ƒ Dataset – A very broad set of related data useful during rollout but typically not
for continued support

© 2011 SAP AG. All rights reserved. 351

SAP Class Week of March 19, 2012


Introduction to Object Migration

When OMA, When Spreadsheet When Manual?

ƒ Spreadsheet
ƒ Extensions
ƒ Page Customizations

ƒ OMA
ƒ Entire packages, lists of objects, single objects
ƒ Scripts, Templates, LR’s

ƒ Manual
ƒ Security settings, Mail configurations document security template changes etc.

© 2011 SAP AG. All rights reserved. 352

SAP Class Week of March 19, 2012


Introduction to Object Migration

Export Example

© 2011 SAP AG. All rights reserved. 353

SAP Class Week of March 19, 2012


Introduction to Object Migration

Export continued
ƒ Note multiple export packages. What this means is once the package is created
and the contents change you just need to add a new export and save it. The new
OMA file is then generated.

ƒ Have to decide on which objects and how to produce the proper list. All is easiest
but not always the best idea….

ƒ Is single object available for you target object?

ƒ If not, you may need to make a query.

ƒ All migration queries end in –OML. Suggest making copies that end in –OML
going forward.

© 2011 SAP AG. All rights reserved. 354

SAP Class Week of March 19, 2012


Introduction to Object Migration

ƒ Object Migration
ƒ Export Example
ƒ Need to migrate a Script called “GJB Project Script”

Step 1: check for single object export

© 2011 SAP AG. All rights reserved. 355

SAP Class Week of March 19, 2012


Configuring an Export

Setup > Export Package > New

© 2011 SAP AG. All rights reserved. 356

SAP Class Week of March 19, 2012


Configuring an Export

No Script entry in the Object Type Dropdown… Now what?


No worries…

© 2011 SAP AG. All rights reserved. 357

SAP Class Week of March 19, 2012


Configuring an Export

Backup and start again we will eventually make this a Object List item.

First we need to create a query that will select exactly what we want. By default, the Object
Migration List query would select all Scripts. That might be a bad idea from a development
environment where we may have done some experimenting….

© 2011 SAP AG. All rights reserved. 358

SAP Class Week of March 19, 2012


Configuring an Export

Let’s locate the Script export query… We know all Migration Queries end in –OML.

© 2011 SAP AG. All rights reserved. 359

SAP Class Week of March 19, 2012


Configuring an Export

OK here it is… Using the Document Menu Duplicate this query

© 2011 SAP AG. All rights reserved. 360

SAP Class Week of March 19, 2012


Configuring an Export

ƒ In the copied Query, modify the where clause to return only the ”GJB Project
Script” Script.
ƒ Usually can use AND UPPER(DISPLAY_NAME) LIKE ‘%some text%’ in the
existing WHERE clause.
ƒ Beware of inactive objects… may need to add “AND INACTIVE = 0” to the where
clause to not include inactive objects. Or you may have to make something
“active” to see it and migrate it.
ƒ Use Actions->preview to test the results of your new query
ƒ By convention you should make the internal name of this query XXX- ***-OML

© 2011 SAP AG. All rights reserved. 361

SAP Class Week of March 19, 2012


Configuring an Export

OK This is what we wanted. This


modified Query just might work…

© 2011 SAP AG. All rights reserved. 362

SAP Class Week of March 19, 2012


Configuring an Export

Now create the export as Object List. And include this query.

Click add OK, then Click add

© 2011 SAP AG. All rights reserved. 363

SAP Class Week of March 19, 2012


Configuring an Export

Now under export click add…

Click Save, Then Click Done

© 2011 SAP AG. All rights reserved. 364

SAP Class Week of March 19, 2012


Configuring an Export

Either close and reopen or use Refresh option to see export result

© 2011 SAP AG. All rights reserved. 365

SAP Class Week of March 19, 2012


Configuring an Export

Now click on the link for the export.oma

© 2011 SAP AG. All rights reserved. 366

SAP Class Week of March 19, 2012


Configuring an Export

Save the file as XXXXXX_export.oma with “all files” as type. If you leave it as a zip
file, import won’t read it. Place this file in your change control document. XXXXXX
should be a meaningful name either utilizing a change control number or other
useful naming convention.

© 2011 SAP AG. All rights reserved. 367

SAP Class Week of March 19, 2012


Configuring an Import

ƒSelect Import Data from Setup > System Administration > Import and Export Tools
ƒClick New then Select upload to the Server Click Next

© 2011 SAP AG. All rights reserved. 368

SAP Class Week of March 19, 2012


Configuring an Import

ƒ Fill in description including a Change Control # or other information convention


ƒ Browse to location of the .oma file and select.
ƒ Click Next

© 2011 SAP AG. All rights reserved. 369

SAP Class Week of March 19, 2012


Configuring an Import

Select wait for Import to finish and click next.

© 2011 SAP AG. All rights reserved. 370

SAP Class Week of March 19, 2012


Configuring an Import

Import result will display. Click Next. Then Click Finish

© 2011 SAP AG. All rights reserved. 371

SAP Class Week of March 19, 2012


Configuring an Import

Review result. Use trace.txt if there are problems….

© 2011 SAP AG. All rights reserved. 372

SAP Class Week of March 19, 2012


Configuring an Import

ƒ Verify Import by testing functionality in new


environment if possible.
ƒ Sometimes it is not possible if you have to create
and save a business object in a production DB.
ƒ In this case, just make sure the new object is
displayed in the list query.
ƒ Caveat: In the case of Localized Resources you
may need to refresh the cache

© 2011 SAP AG. All rights reserved. 373

SAP Class Week of March 19, 2012


Introduction to Object Migration

ƒ Using Spreadsheets
ƒ Reasons..
ƒ Modifications are large but coherent subsets of a much larger set of modifications.
ƒ Extensions and Page Customizations are really good examples of this. They will be used
to implement in DEV, QA and ultimately PROD.

© 2011 SAP AG. All rights reserved. 374

SAP Class Week of March 19, 2012


Introduction to Object Migration

Manual Migration
ƒ Reasons why..
ƒ Modification is a very small targeted change that would be difficult to do any other way.
ƒ Single page customizations, security changes are good examples. Minor changes to a
single template may also qualify. This is a judgment call and it is the responsibility of the
developer to choose wisely and document accordingly.
ƒ Reasons why not…
ƒ It might be easy to do, but not to document. Too many steps may be error prone. OMA is
easy to document. Attach OMA to the Change Control and say load this OMA….

© 2011 SAP AG. All rights reserved. 375

SAP Class Week of March 19, 2012


Implementation Tips

Caveats
ƒ Object Migration requires that each landscape is running the same version of software,
otherwise it fails.
ƒ Object Migration also relies on supporting objects to be present. Therefore there are
dependencies that need to be followed.
ƒ I.e. Workflows, Configurable Phases, Types, Templates,
ƒ There are rare circular dependencies, in these cases rerunning the import usually does the
trick.
System settings
ƒ Make sure System property doc.numbering_table.token.deployment is set uniquely on
each landscape so no object collisions occur. Also make sure if production refreshes occur
this property is reset.

© 2011 SAP AG. All rights reserved. 376

SAP Class Week of March 19, 2012


Troubleshooting

Potential problems:
ƒ Source and destination systems don’t match
ƒ Context cluster and directory id’s need to be the same
ƒ Object dependency not considered
ƒ Use the log to help debug the problem.

© 2011 SAP AG. All rights reserved. 377

SAP Class Week of March 19, 2012


Exercise

Objective
ƒ Familiarize yourself with the process of
creating a custom object list export.

Exercise
ƒ Export N scripts as assigned by the
instructor. This will require modifying a
query to return the specific result set. Keep
in mind, Dates, Display Names, and or
other status can be used to modify the
result set.
ƒ Verify the content of the export.

© 2011 SAP AG. All rights reserved. 378

SAP Class Week of March 19, 2012


SAP Sourcing / Contract Lifecycle Mgmt
Toolbar and Themes
Aug 2011

SAP Class Week of March 19, 2012


Toolbar Customizations

SAP Class Week of March 19, 2012


Toolbar Customization

General
ƒ Used to manipulate navigation menus and
document toolbars
ƒ Buttons and other actions can qualify as
“toolbars”
ƒ Some examples:
ƒ navigation
ƒ toolbar
ƒ button

© 2011 SAP AG. All rights reserved. 383

SAP Class Week of March 19, 2012


Toolbar Customization

ƒ By Default, The System Administrator


profile does not enable Toolbar
customizations.
ƒ Either add this capability or use the
Enterprise User.

© 2011 SAP AG. All rights reserved. 384

SAP Class Week of March 19, 2012


Toolbar Customization

Setup > System Setup > User Interface > Toolbar Customization

© 2011 SAP AG. All rights reserved. 385

SAP Class Week of March 19, 2012


Toolbar Customization

ƒ An example toolbar customization. The overrides are simple. Either Hidden


Yes/No or Display Name with a Localized Resource to override a menu value.
The Target Toolbar ID is where the majority of the work is.

© 2011 SAP AG. All rights reserved. 386

SAP Class Week of March 19, 2012


Toolbar Customization

The task at hand..


Our customer never wants their users to be able to Create an Agreement from
a project so this menu item needs to be hidden.

© 2011 SAP AG. All rights reserved. 387

SAP Class Week of March 19, 2012


Toolbar Customization

Using The system Toolbars list tool find the Project Document toolbar.

© 2011 SAP AG. All rights reserved. 388

SAP Class Week of March 19, 2012


Toolbar Customization

ƒ We need to gather all details of the toolbar specification as we navigate to the


actual attribute we want to hide

ƒ Each of the “IDs” must be kept. Eventually they will be combined to form the
toolbar Customization
Target Toolbar ID.

ƒ Take the external ID

© 2011 SAP AG. All rights reserved. 389

SAP Class Week of March 19, 2012


Toolbar Customization

Navigate to the Document Actions area and grab the Action ID

© 2011 SAP AG. All rights reserved. 390

SAP Class Week of March 19, 2012


Toolbar Customization

Navigate to the Tool Drop down area and grab the Action ID

© 2011 SAP AG. All rights reserved. 391

SAP Class Week of March 19, 2012


Toolbar Customization

Navigate to the Create Agreement area and grab the Action ID

© 2011 SAP AG. All rights reserved. 392

SAP Class Week of March 19, 2012


Toolbar Customization

These are all the ID’s saved along the way. They just need to be combined
and separated with “.” to create the complete Toolbar ID

© 2011 SAP AG. All rights reserved. 393

SAP Class Week of March 19, 2012


Toolbar Customization

© 2011 SAP AG. All rights reserved. 394

SAP Class Week of March 19, 2012


Toolbar Customization

Success !

© 2011 SAP AG. All rights reserved. 395

SAP Class Week of March 19, 2012


Branding

SAP Class Week of March 19, 2012


New Company Logo Considerations

ƒ Company Logo now in the upper left hand corner of the UI

ƒ New image size is 200 X 29 pixels

ƒ System Properties no longer needed to set, just attach logo file to Company
record

© 2011 SAP AG. All rights reserved. 397

SAP Class Week of March 19, 2012


Setting the Company Logo

ƒ Assumes .JPG or GIF of proper size and quality

ƒ Open the Enterprise Company for edit and attach the logo to the company only
the enterprise company will have the controls to add a logo or a theme override.

© 2011 SAP AG. All rights reserved. 398

SAP Class Week of March 19, 2012


Updated logo

© 2011 SAP AG. All rights reserved. 399

SAP Class Week of March 19, 2012


Theme Impact (Branding)

ƒ In past releases, login screen and other pages would incorporate the customer
logo

© 2011 SAP AG. All rights reserved. 400

SAP Class Week of March 19, 2012


Creating a Custom Theme

Step 1: As the Enterprise user, Duplicate the existing default Theme and rename it

© 2011 SAP AG. All rights reserved. 401

SAP Class Week of March 19, 2012


Creating a Custom Theme

Step 2: Assigning the new Theme to the enterprise:


ƒ Select the Companies link in the Master Data area.
ƒ Select the enterprise company and open it for edit.
ƒ Using the attachment control on the Theme field, select the new Theme that you wish to
assign to this company.

Step 3: Edit the Theme and add the Text, Logo or pictures you want

© 2011 SAP AG. All rights reserved. 402

SAP Class Week of March 19, 2012


Branding Options in the 7.0 Theme
ƒ Notice the separation of Buy / Sellside options….

© 2011 SAP AG. All rights reserved. 403

SAP Class Week of March 19, 2012


Theme Impact:
Mapping of Theme Attributes to Login Page

ƒ Image 1 –.In Theme terms this is the Buyer Login Banner


ƒ Image 2 –.In Theme terms this is the Buyer Login Picture
ƒ Image 3 – In Theme terms this is the Customer Login Logo

© 2011 SAP AG. All rights reserved. 404

SAP Class Week of March 19, 2012


Theme Impact –
About and login progress / Splash Screen

ƒ This screen is displayed while logging in. This is a single image in the branding
area
ƒ Image 1 – In Theme terms this is called Splash Screen

© 2011 SAP AG. All rights reserved. 405

SAP Class Week of March 19, 2012


Modifying the images… Some considerations
ƒ Modifying The Buyer Login Picture
ƒ Make sure the image is of the proper size…

© 2011 SAP AG. All rights reserved. 406

SAP Class Week of March 19, 2012


Buy Side Login Screen – Before and After

BEFORE

AFTER

© 2011 SAP AG. All rights reserved. 407

SAP Class Week of March 19, 2012


Login Progress/About Screen – Before and After

BEFORE

AFTER

© 2011 SAP AG. All rights reserved. 408

SAP Class Week of March 19, 2012


Troubleshooting

What happened here?

© 2011 SAP AG. All rights reserved. 409

SAP Class Week of March 19, 2012


One Possible Solution

Using your image editor of choice scale and or crop the image to fit the expected
image size. Each image has the expected size in pixels default size in pixels
specified.

© 2011 SAP AG. All rights reserved. 410

SAP Class Week of March 19, 2012


SAP Sourcing / Contract Lifecycle Mgmt
Enabling and Configuring User Defined Objects
Aug 2011

SAP Class Week of March 19, 2012


User Defined Objects - Background

ƒ Developed to facilitate the development of custom Business Docs


ƒ Allows a clean “palette” to design in rather than reconfiguring existing documents
ƒ Document Security Template, Types, Templates, Configurable Phases, Scripting
and Workflow supported.
ƒ Basic List Query infrastructure exists out of the box.
ƒ Configurable “tabs” 1-5
ƒ Built in Dividers to segregate extension fields.
ƒ 5 UDO’s are available for use.
ƒ By default, UDO’s are not enabled.

© 2011 SAP AG. All rights reserved. 414

SAP Class Week of March 19, 2012


User Defined Objects - Limitations

ƒ There are only 5 UDOs per system. As such they


are not supported in a Multi-tenant environment.

ƒ On-demand public edition – Not supported

ƒ On-demand Private edition – Supported

ƒ Hosted / Licensed – Supported

ƒ On-premise – Licensed – Supported

© 2011 SAP AG. All rights reserved. 415

SAP Class Week of March 19, 2012


Some Examples

ƒ Project Request - A simple form to request some work that may end up as a
project. (Wizard supports “Create From”)

ƒ NDAs - We have customers that really want to keep these segregated from their
Master Agreements

ƒ Self Service work – Some customers have certain business users do simple
contracts (it is kind of like a project request, but it is configured to provide a
template for the user and have them complete the contract negotiation outside of
Contract Management).

ƒ Internal / external surveys

© 2011 SAP AG. All rights reserved. 416

SAP Class Week of March 19, 2012


User Defined Objects – Enabling Step 1.

Login as the system user and enable the appropriate properties

© 2011 SAP AG. All rights reserved. 417

SAP Class Week of March 19, 2012


Result of enabling UDO 1

As seen by the Enterprise user

© 2011 SAP AG. All rights reserved. 418

SAP Class Week of March 19, 2012


User Defined Objects – Enabling Step 2

Login as the Enterprise user and enable access to the UDO by modifying the
appropriate Security

© 2011 SAP AG. All rights reserved. 419

SAP Class Week of March 19, 2012


User Defined Objects – Enabling Step 3
Also set Document Type and Configurable Phase definition as required

© 2011 SAP AG. All rights reserved. 420

SAP Class Week of March 19, 2012


Results of enabled UDO 1 – Normal user view

Login is normal buyer user

© 2011 SAP AG. All rights reserved. 421

SAP Class Week of March 19, 2012


Create a document Security Template for the new Object

Do NOT skip this step. If you do, anything created will not provide the document
creators access by default

© 2011 SAP AG. All rights reserved. 422

SAP Class Week of March 19, 2012


Create Configurable Phases (optional)
Step 1: Add VLV values to appropriate type

© 2011 SAP AG. All rights reserved. 423

SAP Class Week of March 19, 2012


Create Configurable Phases (optional)
Step 2: Configurable Phase Definition

© 2011 SAP AG. All rights reserved. 424

SAP Class Week of March 19, 2012


Create a Document Type

ƒ This is your chance to enable / disable all


the basic footprint and functionality of the
UDO

ƒ You can also assign Configurable Phase


definitions and numbering tables

© 2011 SAP AG. All rights reserved. 425

SAP Class Week of March 19, 2012


Default look of UDO 1

© 2011 SAP AG. All rights reserved. 426

SAP Class Week of March 19, 2012


Locate and modify Localized Resources

© 2011 SAP AG. All rights reserved. 427

SAP Class Week of March 19, 2012


Create LR import Spreadsheet

# Field Type Required Notes

# BUNDLE String true Name of the localized resource.

# RESOURCE_ID String true An identifier for the localized resource.


UNKNOWN | DISPLAY_TEXT | APP_TEXT | ENUM | ERROR | IMAGE |
# RESOURCE_KIND Enumeration true DISPLAY_IMAGE

# DEFAULT_VALUE String false The localized value.

# CUSTOM_VALUE String FALSE New Value

RESOURCE_
BUNDLE RESOURCE_ID KIND DEFAULT_VALUE CUSTOM_VALUE
userdefined.bizdoc1.e Application Enable Buy-Side User Defined BizDoc 1 Enable Buy-Side Request Form
doc nable.buy Text (TRUE or FALSE) (TRUE or FALSE)
userdefined.bizdoc1.e Application Enable Sell-Side User Defined BizDoc 1 Enable Sell-Side Request Form
doc nable.sell Text (TRUE or FALSE) (TRUE or FALSE)
userdefined.bizdoc1.cl Application
doccommon ass_name Text User Defined BizDoc 1 Request Form
userdefined.query.all_ Application
doccommon bizdoc1.label Text All User Defined BizDoc 1 All Request Forms
userdefined.query.biz Application
doccommon doc1.label Text User Defined BizDoc 1 Request Form

© 2011 SAP AG. All rights reserved. 428

SAP Class Week of March 19, 2012


After Modifying Localized Resources

© 2011 SAP AG. All rights reserved. 429

SAP Class Week of March 19, 2012


After Modifying Localized Resources

© 2011 SAP AG. All rights reserved. 430

SAP Class Week of March 19, 2012


Resultant Request Form

© 2011 SAP AG. All rights reserved. 431

SAP Class Week of March 19, 2012


OK so why is the ID Strange?

© 2011 SAP AG. All rights reserved. 432

SAP Class Week of March 19, 2012


Create a Numbering Table for your Request Form

ƒ Numbering tables are highly configurable in terms of ID format the expected


result of this one is UD_RF followed by 10 digits.
ƒ Adjust these as needed beware making the sequence too small will limit the
number of unique keys.
ƒ Most Numbering tables use Date tokens as a prefix to change the sequence
annually.
© 2011 SAP AG. All rights reserved. 433

SAP Class Week of March 19, 2012


Example of a Numbering Table using Tokens

© 2011 SAP AG. All rights reserved. 434

SAP Class Week of March 19, 2012


Now That’s better….

© 2011 SAP AG. All rights reserved. 435

SAP Class Week of March 19, 2012


UDO configuration & Setup

ƒ Create a Type to establish baseline functionality and footprint.


ƒ Create a Numbering Table and assign to your type.
ƒ Determine layout and content.
ƒ Create and locate extensions as required.
ƒ Create Template(s) as needed
ƒ Configure a UDO phase VLV list
ƒ Create a UDO Configurable Phase Definition

© 2011 SAP AG. All rights reserved. 436

SAP Class Week of March 19, 2012


SAP Sourcing / Contract Lifecycle Mgmt
User Management
Aug 2011

SAP Class Week of March 19, 2012


User Management

ƒ User Management is the process of creating, editing , activating, and


deactivating user accounts both for buy-side and sell-side
ƒ This involves…
ƒ Internal User accounts
ƒ Groups
ƒ Security profiles
ƒ Collaborator roles
ƒ Document Security Templates
ƒ Suppliers and Supplier Contacts

© 2011 SAP AG. All rights reserved. 440

SAP Class Week of March 19, 2012


User Management – Creating Directory Configuration

ƒ SAP Sourcing on Demand/ CLM users


are authenticated against a directory

ƒ The Directory object is a logical


directory mapped to a physical
directory, which is typically an LDAP
implementation

ƒ SAP NetWeaver UME is also supported

ƒ Mapping of attributes from LDAP


directory are synchronized with local
Sourcing on Demand User Object

© 2011 SAP AG. All rights reserved. 441

SAP Class Week of March 19, 2012


User Management – Internal User Accounts

ƒ Sourcing buy-side user accounts represent


Sourcing users

ƒ Information collected includes:


ƒ Access information
ƒ Personnel information (limited)
ƒ Contact information
ƒ Application settings
ƒ User groups
ƒ Security profiles

ƒ User accounts can be manually created,


imported through data import (CSV, enterprise
workbook), or activated from pre-existing LDAP
accounts

© 2011 SAP AG. All rights reserved. 442

SAP Class Week of March 19, 2012


User Management – Internal User Accounts

ƒ Account Management tab controls directory information for user


ƒ Choice to map to LDAP/UME account or to create LDAP/UME account
ƒ Password generation at any time
ƒ New Account email notifications sent out if user is manually created or activated

© 2011 SAP AG. All rights reserved. 443

SAP Class Week of March 19, 2012


User Management – Internal User Accounts

ƒ Security profile must be chosen to give user access rights to application resources
ƒ Collection of supervised companies and OUs replaces manager mapping in business
unit records
ƒ Add collection of user groups

© 2011 SAP AG. All rights reserved. 444

SAP Class Week of March 19, 2012


User Management – Security Profiles

ƒ A Security Profile is a collection of settings for Access Rights


ƒ Assigned to users and groups to determine what kinds of permissions (view,
create, edit) users have to various resources (business documents, master data)
ƒ Class level security profiles (Object Level field not selected) control access to
application modules in general
ƒ Object level security profiles control access to specific business documents
ƒ The Internal Type field determines if this security profile is assigned to only buy-
side users, only sell-side users, only primary contacts, or all users
ƒ Sourcing employs a set of default security profiles, but custom ones may be
created
© 2011 SAP AG. All rights reserved. 445

SAP Class Week of March 19, 2012


User Management – Security Profiles

ƒ Access rights determine all the


allowed or denied permissions of
resources in various access groups
ƒ Class level access rights include the
following access groups:
ƒ Business documents
ƒ Document management
ƒ Master data
ƒ Queries and reports
ƒ Accounting
ƒ Vendor management
ƒ Workbench
ƒ Analytics
ƒ Users and security
ƒ System
ƒ Contract Generation
ƒ Optimization

ƒ Access rights and access groups are


all loaded system data and cannot be
customized

© 2011 SAP AG. All rights reserved. 446

SAP Class Week of March 19, 2012


User Management – Security Profiles

ƒ Object level access rights do


not use access groups
ƒ Object level access rights
use additional permissions
ƒ Publish – for specific RFx,
Auctions
ƒ Change State – for specific
RFx, Auction
ƒ Change Owner – for all
specific business documents

© 2011 SAP AG. All rights reserved. 447

SAP Class Week of March 19, 2012


User Management – Groups

ƒ Groups are groups of users organized


for a like functional purpose
ƒ Different from organizational hierarchy Defined with:
ƒ Internal
Inte
Intern
te rnal
rnal & External
Ext
xter
erna
ernall Categories
na Ca
atte
e
ego
gori
ƒ Used in setting like security profiles forr a that they manage
set of users (group based security) and d
establishing business document ƒ Security Profiles (classs level)
leve
collaborators Hierarchical. Categories and
nd
ƒ A User can belong to multiple Groups security rolls up
ƒ A User or a Group can be a collaborator or Custom required data
ƒ Defined with:
ƒ Internal & External Categories that they
manage
ƒ Security Profiles (class level)
ƒ Hierarchical. Categories and security
rolls up
ƒ Custom required data

© 2011 SAP AG. All rights reserved. 448

SAP Class Week of March 19, 2012


User Management – Collaborator Roles

ƒ Collaborator roles are role based rights assigned to collaborators of business


documents
ƒ E.g. document owner, collaborator, approver, sponsor
ƒ Used when users are added as collaborators to business documents
ƒ Collaborators can be users or groups
ƒ Correspond to object level security profiles
ƒ Can assign role in a business document to one user or multiple users
ƒ Loaded into system by default, but can be custom created too

© 2011 SAP AG. All rights reserved. 449

SAP Class Week of March 19, 2012


User Management – Document Security Templates

ƒ Document security templates are rules that govern how business documents handle
collaborators in the case of new collaborators and in the case of new business documents
ƒ When a new collaborator is added, the default collaborator role determines what role that
collaborator gets. The new collaborator also gets the default department representation
declared in the security template
ƒ When a new business document is created, the collaborator role and principal user type
defined in the security template are added to the collaborator list
ƒ These are all customizable
© 2011 SAP AG. All rights reserved. 450

SAP Class Week of March 19, 2012


User Management – Suppliers

The Supplier object is the


central point of information
management in E-Sourcing
regarding suppliers. This
includes:
ƒ Basic Identification
ƒ Defaults
ƒ Addresses
ƒ Contacts
ƒ Categories supplier
ƒ Relationships
ƒ Scorecards
ƒ SRM Activities
ƒ Attachments

© 2011 SAP AG. All rights reserved. 451

SAP Class Week of March 19, 2012


User Management – Supplier Contacts

ƒ Contacts are the sell-


side users
ƒ One primary contact is
required per Supplier
ƒ Only the primary contact
can perform Supplier
self maintenance
activities
ƒ Like buy-side user
accounts, these sell-side
user accounts are
mapped to LDAP / UME
accounts for
authentication

© 2011 SAP AG. All rights reserved. 452

SAP Class Week of March 19, 2012


User Management – Supplier Self-Maintenance

ƒ Supplier Setup appears as a channel on


the supplier desktop
ƒ Admin Contact can update Supplier
Information
ƒ Typical use is changing address
ƒ Non admin contacts can only view the
registered info
ƒ Admin Contact can manage users for this
Supplier
ƒ This link does not appear for non admin
contacts

© 2011 SAP AG. All rights reserved. 453

SAP Class Week of March 19, 2012


User Management – Supplier Self-Maintenance

ƒ Supplier Primary Contact can:


ƒ Make change request to existing information
ƒ Manage their user accounts
ƒ Add new users
ƒ Deactivate users
ƒ Change primary contact
ƒ Generate a new ppassword

© 2011 SAP AG. All rights reserved. 454

SAP Class Week of March 19, 2012


User Management – Supplier Self-Maintenance

ƒ Buyer must approve Supplier Contact


changes
ƒ UI will show current Supplier object
values and Supplier self-maintained
values
ƒ Approved changes are updated to
Supplier object

© 2011 SAP AG. All rights reserved. 455

SAP Class Week of March 19, 2012

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