Sie sind auf Seite 1von 324

R11i Flexfield Diagnostics

and Troubleshooting Case


Study
Instructor Guide

Course Code 14529GC10


Edition 1.0
Month July 2000
Part Number M0-11873
Copyright © Oracle Corporation, 2000. All rights reserved.

This documentation contains proprietary information of Oracle Corporation. It is provided under a license
agreement containing restrictions on use and disclosure and is also protected by copyright law. Reverse
engineering of the software is prohibited. If this documentation is delivered to a U.S. Government Agency of the
Department of Defense, then it is delivered with Restricted Rights and the following legend is applicable:

Restricted Rights Legend

Use, duplication or disclosure by the Government is subject to restrictions for commercial computer software
and shall be deemed to be Restricted Rights software under Federal law, as set forth in subparagraph (c)(1)(ii)
of DFARS 252.227-7013, Rights in Technical Data and Computer Software (October 1988).

This material or any portion of it may not be copied in any form or by any means without the express prior
written permission of the Education Products group of Oracle Corporation. Any other copying is a violation of
copyright law and may result in civil and/or criminal penalties.

If this documentation is delivered to a U.S. Government Agency not within the Department of Defense, then it is
delivered with “Restricted Rights,” as defined in FAR 52.227-14, Rights in Data-General, including Alternate III
(June 1987).

The information in this document is subject to change without notice. If you find any problems in the
documentation, please report them in writing to Worldwide Education Services, Oracle Corporation, 500 Oracle
Parkway, Box SB-6, Redwood Shores, CA 94065. Oracle Corporation does not warrant that this document is
error-free.

Oracle and all references to Oracle Products are trademarks or registered trademarks of Oracle Corporation.

All other products or company names are used for identification purposes only, and may be trademarks of their
respective owners.

Author

Bill Sawyer

Technical Contributors and Reviewers

Gursat Olgun, Terry Barnes, Hani Georgi, Millie Wang, Mike Konopik, Phil
Cannon, Dee Galbreath

This book was published using:

Oracle Tutor
Table of Contents

Introduction ...........................................................................................................................1-1
Introduction .........................................................................................................................1-2
Objectives ............................................................................................................................1-3
Benefits of Flexfields...........................................................................................................1-4
Key and Descriptive Flexfields............................................................................................1-5
Key Flexfields......................................................................................................................1-6
Descriptive Flexfields ..........................................................................................................1-7
Additional Terminology ......................................................................................................1-8
Identifying Key Flexfields ...................................................................................................1-18
Identifying Descriptive Flexfields .......................................................................................1-23
Summary..............................................................................................................................1-27
Lesson Appendix .................................................................................................................1-28
Practice ................................................................................................................................1-33
Diagnostic Tools and Methods..............................................................................................2-1
Diagnostic Tools and Methods ............................................................................................2-2
Objectives ............................................................................................................................2-3
General Overview................................................................................................................2-5
Basic Applications Tools.....................................................................................................2-7
Entity Relationship Diagrams (ERDs).................................................................................2-11
What is an Entity?................................................................................................................2-12
Entities and Instances ..........................................................................................................2-13
Attributes .............................................................................................................................2-14
Relationships .......................................................................................................................2-15
Drawing Entities in ERDs....................................................................................................2-17
Drawing Attributes in ERDs................................................................................................2-18
Drawing Relationships in ERDs ..........................................................................................2-19
Perspectives of Relationships in ERDs................................................................................2-20
Reading Relationships in ERDs...........................................................................................2-21
Elements of an Oracle Applications ERD............................................................................2-22
Key Flexfields ERD.............................................................................................................2-23
Developer's Key Flexfields ERD.........................................................................................2-25
Descriptive Flexfields ERD .................................................................................................2-26
Developer's Descriptive Flexfields ERD .............................................................................2-28
Flexfield Values ERD..........................................................................................................2-29
Developer's Flexfield Values ERD ......................................................................................2-31
Diagnostic Database Scripts ................................................................................................2-32
Diagnostic Applications Scripts...........................................................................................2-38
Applications Configuration Files.........................................................................................2-53
Flexfield Diagnostic Scripts.................................................................................................2-55
Additional Flexfield Scripts.................................................................................................2-68
Flexfield Test Form .............................................................................................................2-72
Java Code Tracing ...............................................................................................................2-83
Diagnostic Style...................................................................................................................2-93
Summary..............................................................................................................................2-95
Practice Overview................................................................................................................2-97
High-Level Design..................................................................................................................3-1
High-Level Design...............................................................................................................3-2
Objectives ............................................................................................................................3-3
Flexfield Components..........................................................................................................3-4
Summary..............................................................................................................................3-30

Copyright © Oracle Corporation, 2000. All rights reserved.

R11i Flexfield Diagnostics and Troubleshooting Case Study Table of Contents


i
Practice Overview................................................................................................................3-31
Flexfield Programs.................................................................................................................4-1
Flexfield Programs...............................................................................................................4-2
Objectives ............................................................................................................................4-3
Flexfield Memory Model.....................................................................................................4-4
Flexfield Programming Concept..........................................................................................4-6
Flexfield's Programmatic Flow............................................................................................4-10
Flexfield Programs...............................................................................................................4-21
Summary..............................................................................................................................4-37
Practice Overview................................................................................................................4-38
Additional Topics...................................................................................................................5-1
Additional Topics ................................................................................................................5-2
Objectives ............................................................................................................................5-3
Additional Topics ................................................................................................................5-4
Summary..............................................................................................................................5-25
Practice Overview................................................................................................................5-26
Custom Flexfields...................................................................................................................6-1
Custom Flexfields................................................................................................................6-2
Objectives ............................................................................................................................6-3
Overview .............................................................................................................................6-4
Customizing a Descriptive Flexfield ...................................................................................6-6
Customizing a Key Flexfield ...............................................................................................6-12
Customizing a Flexfield on a Report ...................................................................................6-19
Summary..............................................................................................................................6-22
Practice Overview................................................................................................................6-23
Appendix A.............................................................................................................................7-1
Appendix A..........................................................................................................................7-2
Links ....................................................................................................................................7-3
Appendix B .............................................................................................................................8-1
Appendix B..........................................................................................................................8-2
Scripts Library .....................................................................................................................8-3
Appendix C.............................................................................................................................9-1
Appendix C..........................................................................................................................9-2
WebIV .................................................................................................................................9-3
Appendix D.............................................................................................................................10-1
Appendix D..........................................................................................................................10-2
Email List ............................................................................................................................10-3

Copyright © Oracle Corporation, 2000. All rights reserved.

R11i Flexfield Diagnostics and Troubleshooting Case Study Table of Contents


ii
Preface

Profile

Before You Begin This Course

Before you begin this course, you should have the following qualifications:

• Thorough knowledge of Flexfields.

• Working experience with SQL, Oracle Applications, Oracle Forms 6i,


and Oracle Reports 6i.

Prerequisites

• Defining Flexfields

How This Course Is Organized

R11i Flexfield Diagnostics and Troubleshooting Case Study is an instructor-led


course featuring lecture and hands-on exercises. Online demonstrations and
written practice sessions reinforce the concepts and skills introduced.

Copyright © Oracle Corporation, 2000. All rights reserved.

R11i Flexfield Diagnostics and Troubleshooting Case Study Table of Contents


iii
Related Publications

Oracle Publications

Title Part Number

Oracle Applications Flexfields Guide A75393

Oracle Applications Developer’s Guide A75545

Oracle Applications User Interface A75395

Standard for Forms-based Products

Oracle Workflow Guide A75397

Oracle Applications Object Library/ A80844

Workflow Technical Reference Manual

Additional Publications

• System release bulletins

• Installation and user’s guides

• read.me files

• Oracle Applications User’s Group (OAUG) articles

• Oracle Magazine

Copyright © Oracle Corporation, 2000. All rights reserved.

R11i Flexfield Diagnostics and Troubleshooting Case Study Table of Contents


iv
Typographic Conventions

Typographic Conventions in Text

Convention Element Example


Bold italic Glossary term (if The algorithm inserts the new key.
there is a glossary)

Caps and Buttons, Click the Executable button.


lowercase check boxes, Select the Can’t Delete Card check box.
triggers, Assign a When-Validate-Item trigger to the
windows ORD block.
Open the Master Schedule window.

Courier new, Code output, Code output: debug.set (‘I”, 300);


case sensitive directory names, Directory: bin (DOS), $FMHOME (UNIX)
(default is filenames, Filename: Locate the init.ora file.
lowercase) passwords, Password: User tiger as your password.
pathnames, Pathname: Open c:\my_docs\projects
URLs, URL: Go to http://www.oracle.com
user input,
User input: Enter 300
usernames
Username: Log on as scott

Initial cap Graphics labels Customer address (but Oracle Payables)


(unless the term is a
proper noun)

Italic Emphasized words Do not save changes to the database.


and phrases, For further information, see Oracle7 Server
titles of books and SQL Language Reference Manual.
courses, Enter user_id@us.oracle.com,
variables where user_id is the name of the user.
Quotation Interface elements Select “Include a reusable module component”
marks with long names and click Finish.
that have only
initial caps; This subject is covered in Unit II, Lesson 3,
lesson and chapter “Working with Objects.”
titles in cross-
references

Uppercase SQL column Use the SELECT command to view


names, commands, information stored in the LAST_NAME
functions, schemas, column of the EMP table.
table names

Copyright © Oracle Corporation, 2000. All rights reserved.

R11i Flexfield Diagnostics and Troubleshooting Case Study Table of Contents


v
Convention Element Example
Arrow Menu paths Select File—> Save.
Brackets Key names Press [Enter].

Commas Key sequences Press and release keys one at a time:


[Alternate], [F], [D]
Plus signs Key combinations Press and hold these keys simultaneously:
[Ctrl]+[Alt]+[Del]

Typographic Conventions in Code

Convention Element Example


Caps and Oracle Forms When-Validate-Item
lowercase triggers
Lowercase Column names, SELECT last_name
table names FROM s_emp;

Passwords DROP USER scott


IDENTIFIED BY tiger;
PL/SQL objects OG_ACTIVATE_LAYER
(OG_GET_LAYER
(‘prod_pie_layer’))

Lowercase Syntax variables CREATE ROLE role


italic
Uppercase SQL commands and SELECT userid
functions FROM emp;

Typographic Conventions in Navigation Paths

This course uses simplified navigation paths, such as the following example, to
direct you through Oracle Applications.

(N) Invoice > Entry > Invoice Batches Summary (M) Query > Find (B) Approve

This simplified path translates to the following:

1. (N) From the Navigator window, select Invoice > Entry > Invoice Batches
Summary.

2. (M) From the menu, select Query > Find.

3. (B) Click the Approve button.

Copyright © Oracle Corporation, 2000. All rights reserved.

R11i Flexfield Diagnostics and Troubleshooting Case Study Table of Contents


vi
Notations :

(N) = Navigator

(M) = Menu

(T) = Tab

(I) = Icon

(H) = Hyperlink

(B) = Button

Typographical Conventions in Help System Paths

This course uses a “navigation path” convention to represent actions you perform
to find pertinent information in the Oracle Applications Help System.

The following help navigation path, for example—

(Help) General Ledger > Journals > Enter Journals

—represents the following sequence of actions:

1. In the navigation frame of the help system window, expand the General
Ledger entry.

2. Under the General Ledger entry, expand Journals.

3. Under Journals, select Enter Journals.

4. Review the Enter Journals topic that appears in the document frame of the
help system window.

Copyright © Oracle Corporation, 2000. All rights reserved.

R11i Flexfield Diagnostics and Troubleshooting Case Study Table of Contents


vii
Copyright © Oracle Corporation, 2000. All rights reserved.

R11i Flexfield Diagnostics and Troubleshooting Case Study Table of Contents


viii
Introduction
Chapter 1

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 1
Introduction

Introduction
Introduction

Copyright  Oracle Corporation, 2000. All rights reserved.

ILT Schedule: Timing Topic


60 minutes Lecture
60 minutes Total

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson,
lesson, you
you should
should be
be able
able to:
to:
•• Describe
Describe thethe philosophy
philosophy behind
behind flexfields
flexfields within
within
Oracle Applications.
Oracle Applications.
•• Define
Define and
and use
use standard
standard terminology
terminology thatthat applies
applies
to
to flexfields.
flexfields.
•• Define
Define and
and use
use standard
standard terminology
terminology thatthat applies
applies
to
to flexfield
flexfield related
related features.
features.
•• Recognize
Recognize Key Key and
and Descriptive
Descriptive flexfields
flexfields inin Oracle
Oracle
Applications.
Applications.
•• Identify
Identify Key
Key and
and Descriptive
Descriptive flexfields
flexfields assigned
assigned to
to
aa given
given form.
form.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 3
Benefits of Flexfields

Benefits
Benefits of
of Flexfields
Flexfields

•• Customize
Customize applications
applications toto support
support your
your own
own
accounting,
accounting, product,
product, and
and other
other codes
codes
•• Enable
Enable construction
construction of
of intelligent
intelligent keys
keys
•• Customize
Customize applications
applications to to capture
capture additional
additional data
data
•• Use
Use the
the application
application toto validate
validate values
values and
and value
value
combinations
combinations entered
entered by by the
the user
user
•• Support
Support multiple
multiple field
field structures
structures depending
depending on
on
data context
data context

Copyright  Oracle Corporation, 2000. All rights reserved.

No two customers are going to have identical business needs or reporting


structures, even if they operate within the same industry. Because of this,
Oracle needed to find a solution. But, what kind of solution?

I could discuss all of the technical requirements that flexfields satisfied,


and I will throughout this course. But, flexfields were invented for a much
more practical reason … to sell product. Without the ability to customize
certain key fields throughout the application, Oracle would have found it
nearly impossible to sell Oracle Applications to customers.

Flexfields were the initial invention of one man, Jeff Walker. Jeff Walker
established the internal Applications Division in 1987 with two initial
products, General Ledger and Purchasing. Jeff brought the concept of
flexfields from his own company that he had left to join Oracle. From that
humble beginning flexfields have, by Release 11i, come into their own.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 4
Key and Descriptive Flexfields

Key
Key and
and Descriptive
Descriptive Flexfields
Flexfields

Key flexfields
build unique __ Item Information _________
entity identifiers Category COM Computer
Item 876 Monitor
Color LTN Light tan

Descriptive flexfields
Payment Type CC gather additional
information
Store 54321
Dept 987
Number 4958-2938-4747
Exp. Dt 12 - 99

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 5
Key Flexfields

Key
Key Flexfields
Flexfields

__ Sales Information ______________________ Standard


window
Transaction 3987 Payment Type
Customer Jane Doe
Item COM-876-LTN
Description Computer - Monitor - Light Tan []

Key
flexfield __ Item Information _______________
window Category COM Computer
Item 876 Monitor
Color LTN Light tan
®

Copyright  Oracle Corporation, 2000. All rights reserved.

You can think of Key Flexfields as Intelligent Keys. Anytime you see a
field that can be 1) treated as a combined entity, and 2) be composed of
individual, configurable segments that the customer can define to meet
their business model, it will be a Key Flexfield.

As a example, consider the diagram above showing a Key Flexfield called


Item Information. While this structure would work for someone building,
assembling or selling computer equipment, would it work for someone
building a boat? selling books? selling consulting services? Maybe or
maybe not. Even if the structure works, does the ordering work?

For recognition purposes, note that the Key Flexfield looks no different
than any other field on the form. Visually, there are no clues at first glance
to indicate Key Flexfields. However, when a user navigates to the field on
the form, the List of Values (LOV) indicator will clue the user to more
information. If they click the LOV Indicator or type the LOV quick key, the
Key Flexfield window will open to allow them to enter the data in a field-by-
field manner.

Also, because of their importance to the application, there are far fewer
Key Flexfields than Descriptive Flexfields. Currently, in Release 11i, there
are 29 Key Flexfields.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 6
Descriptive Flexfields

Descriptive
Descriptive Flexfields
Flexfields

__ Sale Information ____________________


Transaction 3987 Payment Type CC
Customer Jane Doe
Item COM-876-LTN
Description Computer - Monitor - Light Tan [ ]

Payment Type CK Payment Type CC


Store 54321 Store 54321
Dept 987 Dept 987
Number 1028 Number 4958-2938-4747
Second ID MC 4565-3939 Exp. Dt 12 - 99

Copyright  Oracle Corporation, 2000. All rights reserved.

You can think of Descriptive Flexfields as the way that the customer can
add additional fields to any given form without customizing the form. As
such, the data in Descriptive Flexfields is generally transaction-oriented.

Descriptive Flexfields also give us a strong visual clue to their existence.


Notice the field indicated above. The [ ] (square brackets) around the
field are the clue to the existence of a Descriptive Flexfield. In multi-row
forms, the [ ] (square brackets) will be at the top of the fields.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 7
Additional Terminology

Additional
Additional Terminology
Terminology

•• Flexfield
Flexfield Window
Window
•• Segment
Segment
•• Structure
Structure
•• Segment
Segment Prompts
Prompts
•• Segment
Segment Attributes
Attributes
•• Registering
Registering aa Flexfield
Flexfield
•• Generating
Generating aa Flexfield
Flexfield View
View
•• Freezing
Freezing aa Flexfield
Flexfield
•• Compiling
Compiling aa Flexfield
Flexfield

Copyright  Oracle Corporation, 2000. All rights reserved.

All of the above terminology is provided simply to refresh your memory. In


addition to basics, let’s add the following terms to our vocabulary.

• Flexfield Window a pop-up window for Key or Descriptive


flexfields.
• Segment a single sub-field within a flexfield.
• Structure a specific configuration of segments.
• Segment Prompts the text to the left of a segment that
describes context of that field.
• Segment Attributes the characteristics that can be assigned
to segments, including length,
formatting, type, and others.
• Registering a Flexfield the process of identifying a flexfield,
either Key or Descriptive, to Oracle
Applications. In order to be used, a
flexfield must be registered.
• Generating a Flexfield View the process of creating a static view that
will be used to simplify ad hoc reporting.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 8
• Freezing a Flexfield the process of marking a flexfield with a
warning against changes to it after the
freezing process.
• Compiling a Flexfield an internal process that improves
flexfield performance.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 9
Additional Terminology

Additional
Additional Terminology
Terminology

•• SRS
SRS
•• Value
Value Sets
Sets
•• Segment
Segment Value
Value Descriptions
Descriptions
•• Validation
Validation Type
Type -- None
None
•• Independent
Independent Value
Value Sets
Sets
•• Dependent
Dependent Value
Value Sets
Sets
•• Table-driven
Table-driven Value
Value Sets
Sets
•• ID
ID Value
Value Sets
Sets
•• Special
Special Value
Value Sets
Sets
•• Pair
Pair Value
Value Sets
Sets
®

Copyright  Oracle Corporation, 2000. All rights reserved.

• SRS Standard Request Submission. SRS


uses Descriptive flexfields for storing
parameters passed to Reports and
Programs.
• Value Sets a set of valid values.
• Segment Value Description descriptions of the values in a value set.
These values appear in the Flexfield
Window when that value is selected.
• Validation Type - None a validation type that allows a user to
enter any value as long as it meets
formatting rules.
• Independent Value Sets a validation type that provides a
predefined list of values for a segment.
• Dependent Value Sets a validation type that is similar to an
Independent Value Set, but whose list of
available values is limited by the value
of an associated Independent Value
Set.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 10
• Table-driven Value Sets a validation type that provides a list of
values for a segment with the list
coming from an Applications table.
• ID Value Sets a value set that uses a hidden column
as the stored value.
• Special Value Sets a validation type, used primarily for
SRS, that allows a flexfield within a
flexfield.
• Pair Value Sets a validation type, used primarily for
SRS, that allows a pair of flexfield
fields within a flexfield, with the pair
being used to specify a range
(e.g., Low and High) of values.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 11
Additional Terminology

Additional
Additional Terminology
Terminology

•• Key
Key Flexfields
Flexfields
•• SEGMENTs
SEGMENTs
•• Combinations
Combinations
•• Combinations
Combinations Table
Table
•• Code
Code Combination
Combination IDs
IDs
•• Multiple
Multiple Structures
Structures
•• Security
Security Rules
Rules
•• Cross-validation
Cross-validation Rules
Rules
•• Shorthand
Shorthand Aliases
Aliases

Copyright  Oracle Corporation, 2000. All rights reserved.

• Key Flexfields Provides a flexible way for Oracle


Applications to represent objects such
as accounting codes, part numbers, job
descriptions and more. Key flexfields
represent “codes” made up of
meaningful segments (intelligent keys)
to identify business entities. For
example, a company might represent
the part number of a yellow, narrow-
ruled, notepad as PD-NR-YEL-8.5x14.
Another company could represent that
same part as PD-8x14-Y-NR.
• SEGMENTs in this context, SEGMENTs are the
column names used by Key flexfields to
store data (e.g., SEGMENT1,
SEGMENT2, … SEGMENTx).
• Combinations a complete combination of segments
that make up a Key flexfield.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 12
• Combinations Table a unique table for each Key flexfield that
stores the unique combinations.
• Code Combination IDs a foreign key into the combinations
table.
• Multiple Structures the ability of a key flexfield to display
one of multiple segment structures
based on a data condition on the form or
in the Application data. (see Contexts)
• Security Rules a restriction of values from a value set
that a given user can access during data
entry.
• Cross-validation Rules cross-validation of Key flexfield segment
values that allows a customer to control
creation of new code combinations, and
maintenance of the existing code
combinations.
• Shorthand Aliases speeds data entry by allowing shorthand
aliases to represent certain code
combinations.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 13
Additional Terminology

Additional
Additional Terminology
Terminology

•• Flexfield
Flexfield Qualifiers
Qualifiers
•• Segment
Segment Qualifiers
Qualifiers
•• Combinations
Combinations Form
Form
•• Foreign
Foreign Key
Key Reference
Reference Form
Form
•• Range
Range Flexfield
Flexfield Form
Form
•• Dynamic
Dynamic Insert
Insert
•• Range
Range Flexfields
Flexfields

Copyright  Oracle Corporation, 2000. All rights reserved.

• Flexfield Qualifiers identifying a certain segment of a Key


flexfield for some applications purpose
such as security or computations.
• Segment Qualifiers identifies a particular type of value in a
single segment of the Accounting
Flexfield. Note: the Accounting Flexfield
is the only Key flexfield that uses
segment qualifiers.
• Combinations Form a form whose only purpose is to
maintain Key flexfield combinations.
• Foreign Key Reference Form a form whose underlying base
table has only 1 or 2 columns that
contain Key flexfield information. The
purpose of these forms has little to do
with the Key flexfield itself.
• Range Flexfield Form a form that displays a range flexfield, a
special pop-up window that contains two
complete sets of Key flexfield segments.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 14
• Dynamic Insert the insertion of a new valid combination
into the combinations table from a form
other than the combinations
(maintenance) form.
• Range Flexfields a flexfield that supports high and low
values for each Key segment rather
than just single values.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 15
Additional Terminology

Additional
Additional Terminology
Terminology

•• Descriptive
Descriptive Flexfields
Flexfields
•• ATTRIBUTEs
ATTRIBUTEs
•• GLOBAL
GLOBAL ATTRIBUTEs
ATTRIBUTEs
•• Contexts
Contexts
•• Structure
Structure Column
Column
•• Reference
Reference Fields
Fields
•• Global
Global Data
Data Elements
Elements

Copyright  Oracle Corporation, 2000. All rights reserved.

• Descriptive Flexfields flexfields that provide configurable


“expansion space” on the forms within
Oracle Applications.
• ATTRIBUTEs in this context, ATTRIBUTEs are the
column names used by Descriptive
flexfields to store data (e.g.,
ATTRIBUTE1, ATTRIBUTE2, …,
ATTRIBUTEx).
• GLOBAL ATTRIBUTEs GLOBAL ATTRIBUTEs are columns
used by Descriptive flexfields. These
columns have been added for and are
used by the Localizations.
• Contexts the mechanism used by Descriptive
flexfields to allow multiple segment
structures (see Multiple Structures).
• Structure Column the column, usually
ATTRIBUTE_CATEGORY, used by a
Descriptive flexfields to store context
information.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 16
• Reference Fields a means to tie context sensitivity to a
field on the form.
• Global Data Elements segment(s) that always appear in the
pop-up window, regardless of context.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 17
Identifying Key Flexfields

Identifying
Identifying Key
Key Flexfields
Flexfields

•• Visually
Visually identifying
identifying aa Key
Key flexfield
flexfield on
on the
the form
form
•• Identifying
Identifying which
which Key
Key flexfields
flexfields are
are available
available inin
your Application
your Application
•• Identifying
Identifying the
the core
core attributes
attributes of
of any
any given
given Key
Key
flexfield
flexfield
•• Identifying
Identifying which
which Key
Key flexfield
flexfield is
is used
used by
by the
the field
field
on
on the
the form
form
•• Additional
Additional methods
methods

Copyright  Oracle Corporation, 2000. All rights reserved.

There are several types of identification of key flexfields. The types are as
follows:

1. Visually identifying a Key flexfield on the form


2. Identifying which Key flexfields are available in your Application
3. Identifying the core attributes of any given Key flexfield
4. Identifying which Key flexfield is used by the field on the form
5. Additional methods

Note: the types are listed in increasing order of difficulty.

Visual Identification

Visual Identification of key flexfields on a form comes with experience in


the product. With a little practice, you can make an educated guess as to
which fields are most likely key flexfields. Furthermore, those educated
guesses can be confirmed by attempting to open the pop-up window for
that field. If a pop-up window is not available, it is not a key flexfield.
Other than the list of values indicators, there are no other visual clues to
key flexfields.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 18
Available Key Flexfields

Identifying the available key flexfields in your Application is quite simple.


The following steps will work:

1. Change into the Application Developer responsibility


2. Navigate to FLEXFIELD … KEY … REGISTER
3. Query all the records

With that, you can see all of the key flexfields that have been defined to
your Application. In Release 11i there are approximately 30 key flexfields.
This is subject to change, especially with the growth in CRM products.
Whatever the number, it is still relatively small in comparison to the total
number of Application products.

Key Flexfield Attributes

Identifying the attributes of a key flexfield is as simple as identifying the


available key flexfields. Initially, the steps are the same.

1. Change into the Application Developer responsibility


2. Navigate to FLEXFIELD … KEY … REGISTER
3. Query the individual key flexfield you want to examine

The initial form shows 10 fields that can be defined for any given key
flexfield.

Application forms and flexfield routines use the


combination of Application and Flexfield Name
to uniquely identify your Key flexfield.
Code a unique code used by the forms trigger.
Title the user-friendly name of your flexfield.
Description
Table Application the application to which the combinations
table is registered
Unique ID Column name of the column in the combinations
table which uniquely identifies a given
combination. Other tables which reference
this Key flexfield should use this as the

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 19
foreign key.
Structure Column name of the column in the combinations
table which, if defined, differentiates between
flexfield structures.
Dynamic Insert Feasible (checkbox) dynamic inserts are
feasible only if your combinations table
contains no mandatory, non-flexfield columns
AND your flexfield does not require any
special validation of new flexfield
combinations.
Allow ID Value Sets (checkbox) defines if your Key flexfield
allows value sets that use a Hidden ID in
your flexfield.

Note: For more detailed information on these and the additional forms
used for Registering a Key Flexfield, see pg 14-71 of the Oracle
Applications Developer’s Guide, Release 11i, P/N: A75545.
(http://pkm.us.oracle.com/%7Egseiden/11idoc/acrobat/115devg.pdf)

Identifying a Key Flexfield on the Form

Key Flexfields take a little work to determine which key flexfield and which
structure within that key flexfield is being used.

The process is as follows:

1. Go to the form and field that you wish to identify.


2. Open up the pop-up window (CTRL+L)
3. At the top of the pop-up window is the Title of the Flexfield
Structure. Record this.
4. Here is a script that you can run from the APPS user. Simply
modify the last line of the script to put your Structure Name in place.

col id_flex_code heading "Flex Code" format a9


col id_flex_name heading "Flexfield Name" format a30
col id_flex_structure_name heading "Structure Name" format a30

select a.id_flex_code,
trim(translate(a.id_flex_name,'*{}''',' ')) id_flex_name,
b.id_flex_structure_name

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 20
from fnd_id_flexs a, fnd_id_flex_structures_tl b
where a.id_flex_code = b.id_flex_code AND
b.id_flex_structure_name like '<PUT YOUR STRUCTURE HERE>'

Additional Methods

There are a few other flexfield diagnostic methods we will discuss at this
point.

1. Determining the # and widths of columns available as segments


for a key flexfield.
A. Change into the Application Developer responsibility
B. Navigate to FLEXFIELD … KEY … REGISTER
C. Query the individual key flexfield you want to examine
D. Record the Table Name of the combinations table
E. Navigate to APPLICATION … DATABASE … TABLE
F. Query the table you wish to examine
G Note the # and widths of the SEGMENT columns.

2. Determining the Segment Qualifier LOOKUPs.

The Accounting Flexfield supports a feature called Segment Qualifiers.


Those Segment Qualifiers have LOOKUP codes associated with them. If
you wish to see the LOOKUP codes, you can repeat the following
process.

A. Change into the Application Developer responsibility


B. Navigate to FLEXFIELD … KEY … REGISTER
C. Query the Accounting Flexfield
D. Click the QUALIFIER button
E. Using the cursor keys, cycle through the various Flexfield
Qualifiers.
F. When a Segment Qualifier is defined, it will show on the bottom
half of the window. When it does, move you cursor down to that
window.
G. Using the cursor keys, step through the Segment Qualifiers.
Record the names of the Quickcode Types.
H. Navigate to APPLICATION … LOOKUPS … APPLICATION
OBJECT LIBRARY

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 21
I. Query on the TYPE field, putting in the name of the Quickcode
Type you had previously recorded (step G)
J. Examine the LOOKUPS available to you for that Segment
Qualifier

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 22
Identifying Descriptive Flexfields

Identifying
Identifying Descriptive
Descriptive Flexfields
Flexfields

•• Visually
Visually identifying
identifying aa Descriptive
Descriptive flexfield
flexfield on
on the
the
form
form
•• Identifying
Identifying which
which Descriptive
Descriptive flexfields
flexfields are
are
available in your Application
available in your Application
•• Identifying
Identifying the
the core
core attributes
attributes of
of any
any given
given
Descriptive
Descriptive flexfield
flexfield
•• Identifying
Identifying which
which Descriptive
Descriptive flexfield
flexfield is
is used
used by
by
the
the field
field on
on the
the form
form

Copyright  Oracle Corporation, 2000. All rights reserved.

The are several types of identification of descriptive flexfields. The types


are as follows:

1. Visually identifying a Descriptive flexfield on the form


2. Identifying which Descriptive flexfields are available in your
Application
3. Identifying the core attributes of any given Descriptive flexfield
4. Identifying which Descriptive flexfield is used by the field

Note: the types are listed in increasing order of difficulty.

Visual Identification

Visual identification of descriptive flexfields on a form is quite easy. The


distinguishing characteristic is [ ] that mark the field. Because forms can
come in either single-record or multi-record forms, there are slight
differences in where the [ ] are placed in reference to the field itself. To
see examples of these, follow these examples.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 23
Single-record Descriptive Flexfield
1. Change into the Receivables Manager responsibility
2. Navigate to TRANSACTIONS … TRANSACTIONS
3. Note the descriptive flexfield at the top right of the form

Multi-record Descriptive Flexfield


1. Change into the Application Developer responsibility
2. Navigate to APPLICATION … VALIDATION … VALUES
3. Click the FIND button to query all records.
4. Note the descriptive flexfield on the right of the form

Available Descriptive Flexfields

Identifying the available descriptive flexfields in your Application is quite


simple. The following steps will work:

1. Change into the Application Developer responsibility


2. Navigate to FLEXFIELD … DESCRIPTIVE … REGISTER
3. Query all the records

With that, you can see all of the descriptive flexfields that have been
defined to your Application. In Release 11i there are over 1,500
descriptive flexfields. This is subject to change, especially with the growth
in CRM products.

Descriptive Flexfield Attributes

Identifying the attributes of a descriptive flexfield is as simple as identifying


the available descriptive flexfields. Initially, the steps are the same.

1. Change into the Application Developer responsibility


2. Navigate to FLEXFIELD … DESCRIPTIVE … REGISTER
3. Query the individual descriptive flexfield you want to examine

The initial form shows 8 fields that can be defined for any given key
flexfield.

Application forms and flexfield routines use the


combination of Application and Flexfield Name
to uniquely identify your Descriptive flexfield.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 24
Name a unique name used by the forms trigger
Title the user-friendly name of your flexfield
Description
Table Application the application to which the table is registered
Table Name the name of the table where your ATTRIBUTE
columns exist.
Structure Column name of the column, usually
ATTRIBUTE_CATEGORY, that differentiates
between flexfield contexts (structures)
Context Prompt the default value of the context prompt

Note: For more detailed information on the forms used for Registering a
Descriptive Flexfield, see pg 14-78 of the Oracle Applications Developer’s
Guide, Release 11i, P/N: A75545.
(http://pkm.us.oracle.com/%7Egseiden/11idoc/acrobat/115devg.pdf)

Identifying a Specific Descriptive Flexfield

Many times it is necessary to be able to specifically identify the descriptive


flexfield that is associated with a specific field on the form. To do this, use
the following steps:

1. Navigate to the window and block for which you want to identify the
Descriptive flexfield.
2. From the Menu choose, Help … Tools … Examine.
3. The Examine Field and Variable Values window initially displays the
hidden block and field names of the field your cursor was in when
you opened Examine. Record the block name displayed to help you
select the correct flexfield in a later step.
4. Use the list on the Block field to choose
$DESCRIPTIVE_FLEXFIELD$.
5. If there is more than one descriptive flexfield for your form, use the
list on the Field field to select the one you want (the list displays the
hidden block names and field names for all descriptive flexfields on
the form).
6. If you do not see the descriptive flexfield you want, it may be
because your form has special logic that prevents the flexfield from
being read by Examine, such as logic that makes the flexfield
appear only under certain conditions. Make sure the Descriptive

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 25
flexfield is visible, that those conditions are met, and that your
cursor is in the same block as the flexfield. Try using Examine
again.
7. The flexfield title that appears in the Value field is the title of your
Descriptive flexfield.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 26
Summary

Summary
Summary

You
You should
should feel
feel comfortable
comfortable with
with the
the following
following
statements
statements about
about your
your knowledge
knowledge ofof flexfields:
flexfields:
•• II know
know that
that flexfields
flexfields bring
bring necessary
necessary capabilities
capabilities
to Oracle Applications.
to Oracle Applications.
•• II know
know that
that flexfields
flexfields are
are configurable
configurable toto the
the
customer's
customer's business
business needs.
needs.
•• II know
know the
the basic
basic terminology
terminology surrounding
surrounding
flexfields.
flexfields.
•• II know
know several
several diagnostic
diagnostic techniques
techniques for
for probing
probing
flexfields.
flexfields.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 27
Lesson Appendix

Lesson
Lesson Appendix
Appendix

•• Key
Key Flexfield
Flexfield Warnings
Warnings and
and Attentions
Attentions
•• Descriptive
Descriptive Flexfield
Flexfield Warnings
Warnings and
and Attentions
Attentions
•• Value
Value Set
Set Warnings
Warnings and
and Attentions
Attentions

Copyright  Oracle Corporation, 2000. All rights reserved.

Lesson Appendix

Throughout the Oracle Applications Flexfields Guide, there are numerous


WARNINGS and ATTENTIONS. These are important messages that
discuss limitations and potential pitfalls. Those messages are collected
here, for your benefit. You should familiarize yourself with them. There
are not that many, and it is well worth your time.

KEY FLEXFIELDS:

WARNING: Plan your key flexfield structures carefully, including all your
segment information such as segment order and field lengths, before you
define your segments using this form. You can define your key flexfields
any way you want, but changing your structures once you acquire any
flexfield data may create data inconsistencies that could have a significant
impact on the behavior of your application or require a complex
conversion program. Changing your existing structures may also
adversely affect the behavior of any cross–validation rules or shorthand
aliases you have set for your structures, so you should be sure to
manually disable or redefine any cross–validation rules (using the Cross–

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 28
Validation Rules window) and shorthand aliases (using the Shorthand
Aliases window) to reflect your changed structures.

WARNING: Some Oracle Applications tables store the segment


separator as part of your flexfield values. Changing your separator once
you have data in such tables may invalidate that data and cause
application errors.

WARNING: Do not modify a frozen flexfield definition if existing data


could be invalidated. An alteration of the flexfield structure once you have
any flexfield data can create serious data inconsistencies. Changing your
existing structures may also adversely affect the behavior of any cross–
validation rules or shorthand aliases you have for your structures, so you
should be sure to manually disable or redefine any cross–validation rules
and shorthand aliases to reflect your changed structures.

WARNING: Changing the order of your segments invalidates all existing


cross–validation rules and shorthand aliases for this flexfield structure.

WARNING: If you are defining the Accounting Flexfield, you must


display all segments. Hiding segments will adversely affect your
application features such as Mass Allocations.

WARNING: All segments in your Accounting Flexfield must be required.

WARNING: You should not use any WHERE clause and/or ORDER BY
clause at all for a value set you intend to use with the Accounting Flexfield.

ATTENTION: The Accounting Flexfield only supports Independent,


Dependent, and Table validation (table validation cannot have any
additional WHERE clauses).

ATTENTION: The Accounting Flexfield uses value sets that have a


format type of Character, so you should specify your child ranges carefully
for those value sets. For example, 100 is less than 99 (even though they
appear to be numbers).

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 29
DESCRIPTIVE FLEXFIELDS:

WARNING: Do not modify a frozen flexfield definition if existing data


could be invalidated. An alteration of the flexfield structure can create data
inconsistencies.

WARNING: Some Oracle Applications tables store the segment


separator as part of your flexfield values. Changing your separator once
you have data in such tables may invalidate that data and cause
application errors.

ATTENTION: If you are upgrading from Release 10, the value for your
context name is copied to the context code and context name in Release
11. The name and description are translatable, and will appear in the
customer’s chosen language. The context code is not translatable.

ATTENTION: The width of your descriptive flexfield window depends


on the length of the longest description you enter in this field, if this
description is longer than the longest description size you choose for any
of your segments in a given structure.

VALUE SETS:

WARNING: You should take special care to avoid a situation where you
have a value set that contains a flexfield which in turn contains a flexfield
(as a value set of one of its segments). There are two situations where
this could cause a problem. The first situation (recursion) is where a
flexfield calls itself as one of its segments, leading to an infinite chain of
pop–up windows. Such a loop may also be indirect. The second potential
problem may lead to data truncation and data corruption problems: since a
flexfield is often passed as its concatenated flexfield values, the length of
these concatenated flexfields can quickly exceed the maximum size of the
value set and the underlying segment column in the flexfield table. This is
less likely to cause a problem for key flexfields than for descriptive
flexfields or range flexfields, because key flexfields are usually passed as
a single code combination ID number instead of as concatenated segment
values and therefore take less space. Though the Define Value Set form
and the Define Segments forms do not prevent you from defining flexfield
loops or multiple flexfields within flexfields, you can cause serious
truncation problems and possible data corruption problems in your
application by allowing this to occur. Plan and define your value sets
carefully to avoid these value sets within value sets.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 30
WARNING: Date and DateTime will be obsolete in Release 12 and are
provided for backward compatibility only. For new value sets, use the
format types Standard Date and Standard DateTime.

WARNING: The :block.field mechanism is present for backward


compatibility only. Value sets that use this mechanism will not be
compatible with a future release of Oracle Applications. If you are using
flexfields server–side validation, you cannot use form field references
(:block.field). You must either remove your field references or turn off
flexfields server–side validation using the profile option Flexfields:Validate
on Server.

WARNING: You should never change or delete a predefined value set


that Oracle Applications supply. Such changes may unpredictably affect
the behavior of your application features such as reporting.

WARNING: Changing your flexfield definition once you have used it to


acquire data can cause serious inconsistencies with existing data.

ATTENTION: If you are using flexfields server–side validation, you


cannot use form field references (:block.field). You must either remove
your field references or turn off flexfields server–side validation using the
profile option Flexfields:Validate on Server.

ATTENTION: If you want to restrict users from entering a negative sign


for a value set where you do not allow alphabetic characters, you should
enter zero (0) as this value set’s minimum value. However, you cannot
prevent users from entering a value that contains the radix character (D).

ATTENTION: If you need a complex SQL clause to select your values


from a table, you should instead first define a view over the table which
selects the rows you need, and then define the value set over the view.

ATTENTION: You should not specify a hidden ID column for value sets
you use with your Accounting Flexfield or most other key flexfields.

ATTENTION: You may not use a DISTINCT clause in any of the


column fields or in your WHERE/ORDER BY clause (you should use a
view with a GROUP BY clause instead of your actual table).

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 31
ATTENTION: If you are using flexfields server–side validation, you
cannot use the INTO clause for your value set. You must either remove
your INTO clauses or turn off flexfields server–side validation using the
profile option Flexfields:Validate on Server.

ATTENTION: The Accounting Flexfield does not support Translatable


Independent or Translatable Dependent Value Sets.

ATTENTION: Because the Accounting Flexfield is the only Oracle


Applications key flexfield that uses the parent, rollup group, hierarchy level
and segment qualifier information, you need only enter this information for
values that are associated with your Accounting Flexfield.

ATTENTION: You cannot modify values for a value set if that value set
is currently being modified by another user, either using the Segment
Values Window or the Account Hierarchy Editor with Oracle General
Ledger. If you get a message saying that the value set is already being
modified, you can try again at a later time.

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 32
Practice

Practice
Practice

This
This practice
practice covers
covers the
the following:
following:
1.
1. Important
Important terminology
terminology
2.
2. Diagnostic
Diagnostic techniques
techniques
3.
3. Skills
Skills practice
practice

Copyright  Oracle Corporation, 2000. All rights reserved.

Exercises

The following exercises are intended to reinforce the objectives of the


previous lesson by allowing you to apply your knowledge by challenging
your recall and your hands-on abilities.

1. Discuss “Combinations Tables”.

___________________________________________________

___________________________________________________

___________________________________________________

___________________________________________________

INSTRUCTOR NOTE: This is a deeper question than first glance.


Knowing that a Combinations Table is where valid key flexfield
combinations are kept is one thing. There is one combinations table per
key flexfield. Code Combination IDs are foreign keys into the

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 33
combinations table. The column name for Code Combination IDs is
generally followed except where more than 1 instance of the key flexfield
must be stored in the table.

2. What are the typical column names for Key and Descriptive
Flexfields to store their data?

___________________________________________________

___________________________________________________

___________________________________________________

___________________________________________________

INSTRUCTOR NOTE: This is a trick question to get them thinking.


Descriptive Flexfields store data in ATTRIBUTEx AND
ATTRIBUTE_CATEGORY fields. Key Flexfields store data in CODE
COMBINATION IDs which are foreign keys into Combinations Tables.

3. Switch to the Receivables Manager responsibility.


What is the name of the Descriptive flexfield on the first form at
this navigation path … TRANSACTIONS … TRANSACTIONS

___________________________________________________

How many Descriptive Flexfields are defined on that form?

___________________________________________________

List the Descriptive Flexfields.

___________________________________________________

___________________________________________________

___________________________________________________

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 34
4. From the same form as Step 3, query the transactions with the
Reference # of 10001. Click on the DISTRIBUTIONS button,
once you have queried the record. What is the name of the Key
flexfield whose form label is “GL Account”?

___________________________________________________

How many segments can you define for that Key flexfield?

___________________________________________________

What is the maximum length of each segment of that Key


flexfield?

___________________________________________________

What is the name of its combinations table?

___________________________________________________

5. How many segments does the Customer Information Descriptive


flexfield, which is owned by the Oracle Receivables application,
allow?

___________________________________________________

INSTRUCTOR NOTE: This is a trick question. There are 2 entries with


the name, Customer Information … one says … RA_CUSTOMERS -
Customer Information OLD … the other reads … RA_CUSTOMERS_HZ -
Customer Information. The student should find both.

6. Practice the following skills:

A. Visually identifying a Key flexfield on a form --

Which form did you pick? ___________________ (shortname)

Which field? ____________________________________

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 35
B. Identifying which Key flexfields are available in your Application

How many Key flexfields are available? ___________

Describe the process where you answered the question:

___________________________________________________

___________________________________________________

___________________________________________________

___________________________________________________

___________________________________________________

C. Using the Key flexfield you identified in Step A, identify its core
attributes.

How many segments are available? __________

How long are those segments? __________

What is the name of its combinations table? ______________

___________________________________________________

D. Visually identifying a Descriptive flexfield on a form --

Which form did you pick? ___________________ (shortname)

Which field? ____________________________________

E. Identifying which Descriptive flexfields are available in your


Application

How many Descriptive flexfields are available? ___________

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 36
F. Using the Descriptive flexfield you identified in Step A, identify
its core attributes.

How many segments are available? __________

How long are those segments? __________

What is the name of its context column? __________________

___________________________________________________

Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 37
Copyright © Oracle Corporation, 2000. All rights reserved.

Introduction
Chapter 1 - Page 38
Diagnostic Tools and
Methods
Chapter 2

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 1
Diagnostic Tools and Methods

Diagnostic
Diagnostic Tools
Tools and
and Methods
Methods

Copyright  Oracle Corporation, 2000. All rights reserved.

ILT Schedule: Timing Topic


180 minutes Lecture
120 minutes Practice
300 minutes Total

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson,
lesson, you
you should
should be
be able
able to:
to:
•• Read
Read andand understand
understand Entity
Entity Relationship
Relationship
Diagrams (ERDs).
Diagrams (ERDs).
•• Read
Read andand understand
understand the
the Oracle
Oracle Applications
Applications
Flexfield
Flexfield ERDs.
ERDs.
•• Run
Run and
and understand
understand Oracle
Oracle SQL
SQL scripts
scripts that
that probe
probe
Oracle
Oracle database
database objects.
objects.
•• Identify
Identify and
and understand
understand the
the major
major configuration
configuration
files used with Oracle Applications.
files used with Oracle Applications.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 3
Objectives

Objectives
Objectives

•• Run
Run and
and understand
understand flexfield
flexfield diagnostic
diagnostic scripts
scripts
and
and forms.
forms.
•• Begin
Begin developing
developing your
your own
own diagnostic
diagnostic style.
style.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 4
General Overview

General
General Overview
Overview

What
What is
is the
the "RIGHT"
"RIGHT" diagnostic
diagnostic style?
style?

Copyright  Oracle Corporation, 2000. All rights reserved.

In this lesson, and the rest of the course, it would be my fondest desire to,
“give you the right answer.” Unfortunately for both of us, there is seldom a
“right” answer. Fortunately for both of us, there are almost always several
“right” answers. So what is a “right” answer?

A “RIGHT” answer is one that can fix the problem.

Note, I did not say anything about how long it took you to get the “right”
answer. There is nothing about how elegant the solution is. There is no
need to fully understand the solution. There is nothing about customer
satisfaction. A “right” answer simply fixes the problem. Are these factors,
and many others, important? Maybe.

Why maybe? All of these factors swirl around any given problem. At any
given time with any given customer facing any given problem, some of
these issues will be important, and others will be insignificant. It is your
job to figure out those factors, and to recognize them during your
resolution process.

Another reason we can’t discuss these factors is that most times they are
outside of your control. How long should it take to solve a problem? Is it

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 5
more important to have an answer or a fully-tested answer? Do you need
to know why the solution worked? What if you can’t answer why it
worked? What then?

I don’t want to bog you down in the details. I simply want to provide you
with a toolkit you can use to solve many problems you might face in
Oracle Applications. You will, over time, develop your own style of using
those tools.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 6
Basic Applications Tools

Basic
Basic Applications
Applications Tools
Tools

•• Help è
Help è About
About Oracle
Oracle Applications
Applications
•• Help è
Help è Record
Record History
History
•• Help è
Help Diagnostics è
è Diagnostics è Examine
Examine
•• Help è
Help Diagnostics è
è Diagnostics è Examine
Examine …
… choose
choose
$DESCRIPTIVE_FLEXFIELD$
$DESCRIPTIVE_FLEXFIELD$ block
block
•• Help è
Help Diagnostics è
è Diagnostics è Examine
Examine …
… choose
choose
$ENVIRONMENT$ block
$ENVIRONMENT$ block
•• Help è
Help Diagnostics è
è Diagnostics è Examine
Examine …
… choose
choose
$PROFILES$ block
$PROFILES$ block

Copyright  Oracle Corporation, 2000. All rights reserved.

Basic Applications Tools

As a refresher, you may have forgotten some of the simple diagnostic and
probing tools built directly into Oracle Applications.

1. Navigate to … Help -> About Oracle Applications


Prime Use Shows Applications version, Form shortname, Form
version

2. Navigate to … Help -> Record History


Prime Use: Shows primary table/view form is using

3. Navigate to … Help -> Diagnostics -> Examine


Prime Use: Shows values of fields not visible on form

4. Navigate to … Help -> Diagnostics -> Examine … choose


$DESCRIPTIVE_FLEXFIELD$ block
Prime Use: Shows user-friendly names of Descriptive Flexfields

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 7
5. Navigate to … Help -> Diagnostics -> Examine … choose
$ENVIRONMENT$ block
Prime Use: Shows values of primary environment variables

6. Navigate to … Help -> Diagnostics -> Examine … choose


$PROFILES$ block
Prime Use: Shows value in effect for any given profile option for
that user.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 8
Basic Applications Tools

Basic
Basic Applications
Applications Tools
Tools

•• Help è
Help Diagnostics è
è Diagnostics è Display
Display Database
Database Error
Error
•• Help è
Help Diagnostics è
è Diagnostics Properties è
è Properties èItem
Item
•• Help è
Help Diagnostics è
è Diagnostics èTrace
Trace (checkbox)
(checkbox)
•• Utilities:
Utilities: SQL
SQL Trace
Trace profile
profile option
option
•• Application
Application Developer
Developer responsibility
responsibility

Copyright  Oracle Corporation, 2000. All rights reserved.

7. Navigate to … Help -> Diagnostics -> Display Database Error


Prime Use: Shows any database error message

8. Navigate to … Help -> Diagnostics -> Properties -> Item


Prime Use: Shows forms canvas to which a field belongs

9. Navigate to … Help -> Diagnostics -> Trace (checkbox)


Prime Use: Turning on/off forms tracing. Trace file (*.trc) is put
into user_dump_dest. If user does not know value of
user_dump_dest, they can look at the init.ora file
($ORACLE_HOME/dbs) or run this statement.

select name, value from v$parameter


where name = ‘user_dump_dest’;

10. Set the “Utilities: SQL Trace” profile option. This profile option
can only be set by the System Administrator.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 9
11. Log on as Applications Developer responsibility,
A. Navigate to … Concurrent -> Programs
to see all concurrent programs
B. Navigate to … Application -> Form
to see all forms
C. Navigate to … Application -> Messages
to see Apps. Error messages
D. Navigate to … Application -> Database -> Tables
to see all tables
E. Navigate to … Application -> Database -> Sequence
to see all sequences
F. Navigate to … Application -> Database -> View
to see all views

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 10
Entity Relationship Diagrams (ERDs)

Entity
Entity Relationship
Relationship Diagrams
Diagrams (ERDs)
(ERDs)

•• ItIt describes
describes exactly
exactly the
the information
information needs
needs of
of the
the
business.
business.
•• ItIt facilitates
facilitates discussion.
discussion.
•• ItIt helps
helps to
to prevent
prevent mistakes,
mistakes, misunderstanding.
misunderstanding.
•• ItIt forms
forms important
important “Technical
“Technical Reference”
Reference”
documentation.
documentation.
•• ItIt is
is the
the basis
basis for
for the
the physical
physical creation
creation of
of database
database
objects within the Oracle Applications database.
objects within the Oracle Applications database.

Copyright  Oracle Corporation, 2000. All rights reserved.

Entity Relationship Diagrams, or ERDs, emerged from the work of Dr.


Peter Chen and others during the 1970s. They were looking for a means
to simplify the representation of large and complex data storage concepts.

ERDs are conceptual models that show entities and relationships. While it
really is that simple, we should answer the question, why?

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 11
What is an Entity?

What
What is
is an
an Entity?
Entity?

•• An
An Entity
Entity is:
is:
–– “Something”
“Something” of of significance
significance to
to the
the business
business
about which data must be
about which data must be known.known.
–– A
A name
name forfor the
the things
things that
that you
you can
can list.
list.
–– Usually
Usually aa noun.
noun.
•• Examples:
Examples: objects,
objects, events
events
•• Entities
Entities have
have instances.
instances.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 12
Entities and Instances

Entities
Entities and
and Instances
Instances

PERSON
PERSON Mahatma
Mahatma Gandhi
Gandhi
PRODUCT
PRODUCT 2.5
2.5 x 35 mm copper
x 35 mm copper nail
nail
PRODUCT
PRODUCT TYPE
TYPE nail
nail
EMPLOYMENT
EMPLOYMENT CONTRACT
CONTRACT my
my previous
previous contract
contract
JOB
JOB violinist
violinist
SKILL
SKILL LEVEL
LEVEL fluent
fluent
TICKET
TICKET RESERVATION
RESERVATION tonight:
tonight: Hamlet
Hamlet in
in the
the Royal
Royal
PURCHASE
PURCHASE the
the CD
CD II bought
bought yesterday
yesterday
ELECTION
ELECTION for
for parliament
parliament next
next fall
fall
PRINTER
PRINTER PREFERENCE
PREFERENCE …

DOCUMENT
DOCUMENT VERSION
VERSION ...
...
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 13
Attributes

Attributes
Attributes

•• Also
Also represents
represents something
something ofof significance
significance to
to the
the
business
business
•• Is
Is aa single
single valued
valued property
property detail
detail of
of an
an entity
entity
•• Is
Is aa specific
specific piece
piece of
of information
information that:
that:
–– Describes
Describes
–– Quantifies
Quantifies
–– Qualifies
Qualifies
–– Classifies
Classifies
–– Specifies
Specifies
an
an entity.
entity.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 14
Relationships

Relationships
Relationships

•• Also
Also represent
represent something
something ofof significance
significance to
to the
the
business
business
•• Express
Express how
how entities
entities are
are mutually
mutually related
related
•• Always
Always exist
exist between
between two
two entities
entities (or
(or one
one entity
entity
twice)
twice)
•• Always
Always have
have two
two perspectives
perspectives
•• Are
Are named
named at
at both
both ends
ends

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 15
Relationships

Relationships
Relationships
JOB manager
EMPLOYEE cook
Shintaro waitress
dish washer
Jill financial controller
Adam
Ahmed porter
waiter
Maria
piano player

Numerical
Numerical observation:
observation:
•• All
All EMPLOYEES
EMPLOYEES have
have aa JOB
JOB
•• No
No EMPLOYEE
EMPLOYEE hashas more
more than
than one
one JOB
JOB
•• Not
Not all
all JOBS
JOBS are
are held
held by
by an
an EMPLOYEE
EMPLOYEE
•• Some
Some JOBS
JOBS are
are held
held by
by more
more than
than one
one EMPLOYEE
EMPLOYEE
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 16
Drawing Entities in ERDs

Drawing
Drawing Entities
Entities in
in ERDs
ERDs

•• Drawn
Drawn as
as aa “softbox”
“softbox”
•• Name
Name singular
singular
EMPLOYEE JOB
•• Name
Name inside
inside

ELECTION
•• Neither
Neither size,
size,
nor
nor position
position
has
has aa special
special TICKET
meaning
meaning ORDER
RESERVATION

JOB ASSIGNMENT

During design, entities usually lead to tables.


®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 17
Drawing Attributes in ERDs

Drawing
Drawing Attributes
Attributes in
in ERDs
ERDs

EMPLOYEE JOB
* Family Name * Title
* Address o Description
o Birth Date
o Shoe Size
o Email

Mandatory attribute, that is, known and


* available for every instance
o Optional attribute, that is, unknown or
unimportant to know for some instances

During design, attributes lead to columns.


®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 18
Drawing Relationships in ERDs

Drawing
Drawing Relationships
Relationships in
in ERDs
ERDs

An employee has exactly one job

EMPLOYEE JOB
has
held by

Jobs are held by one or more employees

During design, relationships lead to foreign keys.


®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 19
Perspectives of Relationships in ERDs

Perspectives
Perspectives of
of Relationships
Relationships in
in ERDs
ERDs

mandatory:
mandatory: optional:
optional:

EMPLOYEE has JOB

held by

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 20
Reading Relationships in ERDs

Reading
Reading Relationships
Relationships in
in ERDs
ERDs

P split into Q
part of

“Each P may be split into one or more Qs”

“Each Q must be part of exactly one P”


®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 21
Elements of an Oracle Applications ERD

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 22
Key Flexfields ERD

Key Flexfields

Oracle Proprietary, Confidential Information––Use Restricted by Contract

The Development Team ERDs differ from the AOL TRM ERDs in two (2)
slight ways. One, the key relationships are labeled to allow for easier
reading. Two, some additional tables and views are listed. The
Development Team ERDs are included after the AOL TRM ERDs for
comparison.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 23
The additional tables are the _TL’s and the additional views are the _VL’s.
The _TL tables are provided for multi-language support. Data in the
database can be broken down into language-dependent and non-
language-dependent data. This ranges from simple things like YES/NO
values to complex translations. The _TL tables break out the data that
needs translations into its own tables. The _VL views are the counterparts
to the _TL tables. These additional tables and views would be
diagrammed in the same place as the master table.

Additional _TL table or _VL views:

Key Flexfields:

FND_ID_FLEX_STRUCTURES
add … FND_ID_FLEX_STRUCTURES_TL
add … FND_ID_FLEX_STRUCTURES_VL

FND_FLEX_VALIDATION_RULES
add … FND_FLEX_VALIDATION_RULES_TL
add … FND_FLEX_VALIDATION_RULES_VL

FND_ID_FLEX_SEGMENTS
add … FND_ID_FLEX_SEGMENTS_TL
add … FND_ID_FLEX_SEGMENTS_VL

FND_VALUE_ATTRIBUTE_TYPES
add … FND_VALUE_ATTRIBUTE_TYPES_TL
add … FND_VALUE_ATTRIBUTE_TYPES_VL

Account Generator:

WF_RUNNABLE_PROCESSES_V
add … WF_ITEM_TYPES
add … WF_ITEM_TYPES_TL
add … WF_ITEM_TYPES_VL

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 24
Developer's Key Flexfields ERD

qualifies
for
FLEXFIELD QUALIFIER VALUE FLEXFIELD SEGMENT (TL)

qualified
by
for validated a
by portion
of

used made
by up of

VALIDATION QUALIFIER for


VALUE SET
KEY FLEXFIELD
having STRUCTURE (TL)

defined
for defined
for
defined
for
SHORTHAND
ALIAS
using
CROSS VALIDATION
EXCLUDE RULE LINE

for for
CROSS VALIDATION
RULE STATISTIC
has

has
for
CROSS VALIDATION for CROSS
RULE LINE VALIDATION
RULE (TL) context
made for
up of
has

COMPILED KEY for


FLEXFIELD
for
STRUCTURE compiled
into
CROSS VALIDATION
INCLUDE RULE LINE part
of

represented made
as up of

SEGMENT COMPILED KEY COMBINATIONS


QUALIFIER TL) FLEXFIELD TABLE

applicable for for


to identified
by

assigned qualified compiled represented


to by into by
has for

FLEXFIELD QUALIFIER TYPE for KEY FLEXFIELD

has

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 25
Descriptive Flexfields ERD

Descriptive Flexfields

Oracle Proprietary, Confidential Information––Use Restricted by Contract

The Development Team ERDs differ from the AOL TRM ERDs in two (2)
slight ways. One, the key relationships are labeled to allow for easier
reading. Two, some additional tables and views are listed. The
Development Team ERDs are included after the AOL TRM ERDs for
comparison.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 26
The additional tables are the _TL’s and the additional views are the _VL’s.
The _TL tables are provided for multi-language support. Data in the
database can be broken down into language-dependent and non-
language-dependent data. This ranges from simple things like YES/NO
values to complex translations. The _TL tables break out the data that
needs translations into its own tables. The _VL views are the counterparts
to the _TL tables. These additional tables and views would be
diagrammed in the same place as the master table.

Additional _TL table or _VL views:

Descriptive Flexfields:

FND_DESCRIPTIVE_FLEXS
add … FND_DESCRIPTIVE_FLEXS_TL
add … FND_DESCRIPTIVE_FLEXS_VL

FND_DESCR_FLEX_COLUMN_USAGES
add … FND_DESCR_FLEX_COL_USAGE_TL
add … FND_DESCR_FLEX_COL_USAGE_VL
FND_DESCR_FLEX_CONTEXTS
add … FND_DESCR_FLEX_CONTEXTS_TL
add … FND_DESCR_FLEX_CONTEXTS_VL

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 27
Developer's Descriptive Flexfields ERD

FLEXFIELD FLEXFIELD STRUCTURE


WORKFLOW for WORKFLOW for (TL)
PROCESS PROCESS
uses generated
by

DESCR. FLEXFIELD COLUMN USAGE (TL)

a used
validated portion by
against of

made
used up of
by

VALUE SET DESCR. FLEXFIELD CONTEXT (TL)

a
portion
of
DEFAULT CONTEXT FIELD
COMPILED DESCRIPTIVE FLEXFIELD

a reference
for
for

APPLICATION TABLE

qualified by

compiled into deriving


made context
up of from for using

DESCRIPTIVE FLEXFIELD (TL)

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 28
Flexfield Values ERD

Flexfield Values

Oracle Proprietary, Confidential Information––Use Restricted by Contract

The Development Team ERDs differ from the AOL TRM ERDs in two (2)
slight ways. One, the key relationships are labeled to allow for easier
reading. Two, some additional tables and views are listed. The
Development Team ERDs are included after the AOL TRM ERDs for
comparison.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 29
The additional tables are the _TL’s and the additional views are the _VL’s.
The _TL tables are provided for multi-language support. Data in the
database can be broken down into language-dependent and non-
language-dependent data. This ranges from simple things like YES/NO
values to complex translations. The _TL tables break out the data that
needs translations into its own tables. The _VL views are the counterparts
to the _TL tables. These additional tables and views would be
diagrammed in the same place as the master table.

Additional _TL table or _VL views:

Value Sets:

FND_ID_FLEX_SEGMENTS
add … FND_DESCR_FLEX_COLUMN_USAGES

FND_FLEX_HIERARCHIES
add … FND_FLEX_HIERARCHIES_TL
add … FND_FLEX_HIERARCHIES_VL

FND_FLEX_VALUES
add … FND_FLEX_VALUES_TL
add … FND_FLEX_VALUES_VL

FND_FLEX_VALUE_RULES
add … FND_FLEX_VALUE_RULES_TL
add … FND_FLEX_VALUE_RULES_VL

FND_RESPONSIBILITY
add … FND_RESPONSIBILITY_TL
add … FND_RESPONSIBILITY_VL

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 30
Developer's Flexfield Values ERD

VALUE SET
FLEXFIELD VALUE HIERARCHY
validated
against

used
containing used in
by validated
FLEXFIELD SEGMENT by
(TL)

used by
made
up of

containing
NORM HIERARCHY
part of

containing

HIERARCHY NAME used by

using
part of part of

FLEXFIELD VALUE (TL)


in

made
up of

validated by
FLEXFIELD
VALIDATION EVENT
used
for dependent
on

defined
for
parent of
SECURITY RULE for FLEXFIELD
ELEMENT VALUE
restricted
made SECURITY
by
up of RULE (TL) validated
by

assigned
to

used for

FLEXFIELD
VALIDATION TABLE

registered
as

defined
for
used
secured as
RESPONSIBILITY (TL) by
FLEXFIELD VALUE
SECURITY RULE
APPLICATION TABLE
defined USAGE
for

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 31
Diagnostic Database Scripts

Diagnostic
Diagnostic Database
Database Scripts
Scripts

•• Describe
Describe Database
Database Space
Space
•• Describe
Describe Data
Data Files
Files
•• Describe
Describe aa Database
Database Object
Object
•• Count
Count Database
Database Objects
Objects by
by Type
Type
•• Table
Table Definitions
Definitions
•• Describe
Describe Tablespace
Tablespace
•• Describe
Describe Database
Database Users
Users

Copyright  Oracle Corporation, 2000. All rights reserved.

There are numerous scripts that one could run to explore and probe the
database objects contained within an Oracle Applications database. This
section covers a few of the more important scripts. Appendix A provides
you with a more detailed listing, and a link to where those scripts can be
downloaded.

In addition to these custom scripts, there are many scripts that Oracle has
provided to the customers that are shipped with Oracle Applications.
These scripts are kept in the $AD_TOP/sql directory, and are discussed in
this section as well.

SCRIPT = Describe Database Space filename = ddbspace.sql

rem ddbspace.sql
rem
ttitle 'Database Size and Free Space'
rem
col tablespace_name format a15 heading 'TABLESPACE'
col file_id format 999 heading 'ID'
col file_bytes format 999,999,999 heading 'FILE SIZE|(K)'
col free_extents format 9,999 heading 'FREE|EXTENT'
col free_bytes format 999,999,999 heading 'FREE SIZE|(K)'

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 32
col free_pct format 999 heading 'FREE|PCT'
col free_blocks format 9,999,999 heading 'FREE|BLOCKS'
col max_free_blocks format 9,999,999 heading 'MAX FREE|BLOCKS'
rem
break on report on tablespace_name skip 1
compute sum of file_bytes free_extents free_bytes free_blocks -
on report tablespace_name
compute count of file_id on report
rem
select df.tablespace_name, df.file_id,
df.bytes/1024 file_bytes,
count(fs.file_id) free_extents,
sum(fs.bytes)/1024 free_bytes,
sum(fs.bytes) * 100 / df.bytes free_pct,
sum(fs.blocks) free_blocks,
max(fs.blocks) max_free_blocks
from sys.dba_free_space fs, sys.dba_data_files df
where df.file_id = fs.file_id(+)
and df.tablespace_name like upper('&tablespace')
group by df.tablespace_name, df.file_id, df.bytes
order by df.tablespace_name, df.file_id;

SCRIPT = Describe Data Files filename = dfile.sql

rem dfile.sql
rem
set linesize 132
rem
ttitle 'Data Files by Tablespace'
rem
col tablespace_name format a15 heading 'TABLESPACE'
col file_id format 9999 heading 'ID'
col bytes format 9,999,999,999,999 heading 'BYTES'
col blocks format 9,999,999 heading 'BLOCKS'
col status format a9 heading 'STATUS'
col file_name format a65 heading 'FILE NAME'
rem
break on report on tablespace_name skip 1
compute sum of bytes blocks on report tablespace_name
rem
select tablespace_name, file_id, bytes, blocks, status,
file_name
from sys.dba_data_files
order by tablespace_name, file_id;
rem

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 33
set linesize 80

SCRIPT = Describe a Database Objectfilename = dobject.sql

rem dobject.sql
rem
ttitle 'Database Objects'
rem
col owner format a12 heading 'OWNER'
col object_name format a30 heading 'OBJECT NAME'
rem col object_id format 99999 heading 'ID'
col object_type format a13 heading 'OBJECT TYPE'
col created format a9 heading 'CREATED'
col modified format a9 heading 'MODIFIED'
col status format a1 heading 'S'
rem
break on owner skip 1
rem
select owner, object_name, object_type, created,
decode( last_ddl_time, created, null, last_ddl_time ) modified,
decode( status, 'VALID', null, 'INVALID', 'I', '?' ) status
from sys.dba_objects
where owner like upper('&owner')
and object_type like upper('&type')
and object_name like upper('&object')
order by owner, object_name;

SCRIPT = Count Db Objs by Type filename = dobjcnts.sql

rem dobjcnts.sql
rem
set linesize 132
rem
ttitle 'Data Dictionary Object Summary by Owner/Type'
rem
col owner format a12 heading 'OWNER'
col total_count format 999999 heading 'TOTAL'
col cluster_count format 99 heading 'CLU'
col table_count format 99999 heading 'TABLE'
col index_count format 99999 heading 'INDEX'
col view_count format 99999 heading 'VIEW'
col synonym_count format 999999 heading 'SYNONYM'
col sequence_count format 9999 heading 'SEQ'
col dblink_count format 999 heading 'DB|LINK'

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 34
col trigger_count format 9999 heading 'TRIG'
col procedure_count format 9999 heading 'PROC'
col function_count format 9999 heading 'FUNC'
col package_count format 99999 heading 'PACK'
col package_body_count format 99999 heading 'PACK|BODY'
col type_count format 999 heading 'TYPE'
col type_body_count format 999 heading 'TYPE|BODY'
col library_count format 99 heading 'LIB'
col undefined_count format 99 heading 'UND'
rem
break on report
compute count sum -
of total_count undefined_count cluster_count table_count
index_count -
view_count synonym_count sequence_count dblink_count
trigger_count -
procedure_count function_count package_body_count
package_count -
type_count type_body_count library_count -
on report
rem
select owner, count(*) total_count,
sum(decode( object_type, 'UNDEFINED', 1 )) undefined_count,
sum(decode( object_type, 'CLUSTER', 1 )) cluster_count,
sum(decode( object_type, 'TABLE', 1 )) table_count,
sum(decode( object_type, 'INDEX', 1 )) index_count,
sum(decode( object_type, 'VIEW', 1 )) view_count,
sum(decode( object_type, 'SYNONYM', 1 )) synonym_count,
sum(decode( object_type, 'SEQUENCE', 1 )) sequence_count,
sum(decode( object_type, 'DATABASE LINK', 1 )) dblink_count,
sum(decode( object_type, 'TRIGGER', 1 )) trigger_count,
sum(decode( object_type, 'PROCEDURE', 1 )) procedure_count,
sum(decode( object_type, 'FUNCTION', 1 )) function_count,
sum(decode( object_type, 'PACKAGE', 1 )) package_count,
sum(decode( object_type, 'PACKAGE BODY', 1 ))
package_body_count,
sum(decode( object_type, 'TYPE', 1 )) type_count,
sum(decode( object_type, 'TYPE BODY', 1 )) type_body_count,
sum(decode( object_type, 'LIBRARY', 1 )) library_count
from sys.dba_objects
where owner like upper('&owner')
group by owner;
rem
set linesize 80

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 35
SCRIPT = Table Definitions filename = dtcol80.sql

rem dtcol80.sql
rem
ttitle 'Table Definitions'
col owner format a8 heading 'OWNER'
col table_name format a24 heading 'TABLE NAME'
col column_id format 999 heading 'ID'
col nullable format a1 heading 'N'
col column_name format a24 heading 'COLUMN NAME'
col data_type format a14 heading 'DATA TYPE'
rem
break on owner on table_name skip 1
rem
select owner, table_name, column_id,
decode( nullable, 'N', 'N', null ) nullable,
column_name, data_type ||
decode( data_type,
'VARCHAR2', '(' || to_char(data_length) || ')',
'DATE', null,
'NUMBER', decode( data_precision, null, null,
'(' || to_char(data_precision) ||
decode( data_scale, null, null, 0, null,
',' || to_char(data_scale) ) || ')' ),
'CHAR', '(' || to_char(data_length) || ')',
'VARCHAR', '(' || to_char(data_length) || ')',
'RAW', '(' || to_char(data_length) || ')'
) data_type
from sys.dba_tab_columns
where owner like upper('&owner')
and table_name like upper('&table')
and column_name like upper('&column')
order by owner, table_name, column_id;

SCRIPT = Describe Tablespace filename = dtspace.sql

rem dtspace.sql
rem
ttitle 'Tablespace Definitions'
col contents format a9 heading 'CONTENTS'
col status format a9 heading 'STATUS'
col tablespace_name format a25 heading 'TABLESPACE'
col initial_extent format 999,999 heading 'INITIAL|EXTENT|(K)'
col next_extent format 999,999 heading 'NEXT|EXTENT|(K)'

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 36
col min_extents format 99 heading 'MIN|EXT'
col max_extents format 999999 heading 'MAX|EXT'
col pct_increase format 999 heading 'PCT|INC'
rem
select decode( contents, 'PERMANENT', null, contents ) contents,
decode( status, 'ONLINE', null, status ) status,
tablespace_name,
initial_extent/1024 initial_extent,
next_extent/1024 next_extent,
min_extents,
max_extents,
pct_increase
from sys.dba_tablespaces
where tablespace_name like upper('&tablespace')
order by tablespace_name;

SCRIPT = Descibe Database Users filename = duser.sql

rem duser.sql
rem
ttitle 'Database Users'
rem
col user_id format 9990 heading 'ID'
col username format a12 heading 'USERNAME'
col dt format a1 heading ''
col default_tablespace format a15 heading 'DEFAULT'
col tt format a1 heading ''
col temporary_tablespace format a12 heading 'TEMPORARY'
col profile format a18 heading 'PROFILE'
col created format a9 heading 'CREATED'
rem
select user_id, username,
decode( default_tablespace, 'SYSTEM', '*', null ) dt,
default_tablespace,
decode( temporary_tablespace, 'SYSTEM', '*', null ) tt,
temporary_tablespace,
profile, created
from sys.dba_users
where username like upper('&user')
order by username;

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 37
Diagnostic Applications Scripts

Diagnostic
Diagnostic Applications
Applications Scripts
Scripts

•• Check
Check and
and List
List Compilation
Compilation Errors
Errors
•• List
List Job
Job Timing
Timing Information
Information
•• Count
Count Objects
Objects by
by Type
Type
•• Applications
Applications Configuration
Configuration Script
Script
•• List
List Product
Product Dependencies
Dependencies
•• List
List Pinned
Pinned Objects
Objects
•• Report
Report Database
Database Configuration
Configuration
•• Report
Report Table
Table Sizes
Sizes
•• Show
Show Imminent
Imminent Extent
Extent Failure
Failure
•• Show
Show User
User Space
Space
®

Copyright  Oracle Corporation, 2000. All rights reserved.

In addition to the SQL Scripts shown in the previous section, there are
numerous scripts that are shipped with the Application. These scripts are
stored in the $AD_TOP/sql directory.

SCRIPT = Check and List Compilation Errors filename = aderrch2.sql

REM $Header: aderrch2.sql 115.0 1998/04/24 16:42:06 appldev ship $


REM +======================================================================+
REM | Copyright (c) 1995 Oracle Corporation Redwood Shores, California, USA|
REM | All rights reserved. |
REM +======================================================================+
REM NAME
REM aderrch2.sql
REM
REM DESCRIPTION
REM Just report all compilation errors for a given schema.
REM See also aderrchk.sql which reports and then fails if errors.
REM
REM ARGUMENTS
REM 1 - Schema to run in
REM 2 - Password for schema
REM 3 - Check errors for objects starting with #3
REM +======================================================================+

WHENEVER SQLERROR EXIT FAILURE;

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 38
column object format a33 word_wrap
column line format 9999
column error format a38
set arraysize 1
set pagesize 60
set linesize 79
set verify off
break on object
connect &1/&2

REM ================================================================
REM The select below is equivalent to
REM "show errors <object type> <object name>"
REM
REM Note that we only show errors for enabled triggers. If there
REM are disabled triggers with errors, we ignore them.
REM ================================================================

select e.type||' '||e.name object, e.line, e.text error


from user_errors e
where e.name like upper('&&3%')
and e.type != 'TRIGGER'
UNION ALL
select e.type||' '||e.name object, e.line, e.text error
from user_errors e, user_triggers t
where e.name like upper('&&3%')
and e.type = 'TRIGGER'
and e.name = t.trigger_name
and t.status = 'ENABLED'
order by 1, 2
/
exit;

SCRIPT = List Job Timing Information filename = adtimdet.sql

--
-- Copyright (c) 2000 Oracle Corporation Redwood Shores, California, USA
-- All rights reserved.
--
-- FILENAME
-- adtimdet.sql
--
-- RCS HEADER
-- $Header: adtimdet.sql 115.0 2000/04/27 20:35:45 rlotero ship $
--
-- DESCRIPTION
-- Script to list timing information for all jobs in a given phase.
--
-- NOTES
--
-- sqlplus <APPS username>/<APPS password> @adtimdet.sql \
-- <SESSION_ID> <PHASE_NUMBER> <OUTPUT FILE>
--
-- where SESSION_ID : Identifier for the session

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 39
-- PHASE_NUMBER : Number identifying the phase
-- OUTPUT_FILE : Output file name
--
-- See output of adtimrpt.sql for list of phase numbers and for the session
-- identifier for the session you are interesed in.
--
-- If you specify PHASE_NUMBER = -1, the report will list all phases.
--
-- HISTORY
--
--

WHENEVER SQLERROR EXIT FAILURE ROLLBACK;


WHENEVER OSERROR EXIT FAILURE ROLLBACK;

set pages 10000


set lines 78
set verify off

column elapsed_time_str format a10 heading " Time|HH24:MM:SS"


column redo format a5 heading "ReDo|Count"

spool &&3

select lpad(to_char(phase),3)||' '||phase_name "Phase Number and Name",


substr(product,1,5) "Prod",
substr(job_name,1,20) "Filename",
lpad(floor(elapsed_time*24), 4)||':'||
lpad(floor((elapsed_time*24-floor(elapsed_time*24))*60), 2, '0')||':'||
lpad(mod(round(elapsed_time*86400), 60), 2, '0') elapsed_time_str,
substr(restart_count,1,4) redo
from ad_task_timing
where session_id = &&1
and phase = decode(&&2,-1,phase,&&2)
order by 1, 4 desc, 2, 3;

spool off

commit;
exit;

SCRIPT = Count Objects by Type filename = adutcobj.sql

REM $Header: adutcobj.sql 115.1 1999/03/17 19:46:52 wdgreene ship $


REM +======================================================================+
REM | Copyright (c) 1996 Oracle Corporation Redwood Shores, California, USA|
REM | All rights reserved. |
REM +======================================================================+
REM NAME
REM adutcobj.sql
REM DESCRIPTION
REM Count objects by object type in schema
REM +======================================================================+

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 40
select to_char(sysdate,'DD-MM-YYYY HH24:MI:SS') from sys.dual;

break on report
compute sum of objcnt on report

select object_type, status, count(*) objcnt


from user_objects
group by object_type, status;

SCRIPT = Applications Configuration Script filename = adutconf.sql

REM $Header: adutconf.sql 115.11 2000/03/07 22:22:08 rlotero ship $


REM +======================================================================+
REM | Copyright (c) 1996 Oracle Corporation Redwood Shores, California, USA|
REM | All rights reserved. |
REM +======================================================================+
REM NAME
REM adutconf.sql
REM DESCRIPTION
REM Utility script to display configuration of Applications
REM +======================================================================+

spool adutconf.lst

set verify off


set pages 9999
set lines 79

col application_id format 99990 heading "ID"


col application_name format a40 heading "Name"
col application_prefix format a6 heading "Prefix"
col application_short_name format a10 heading "Short name"
col apps format a8 heading "Product"
col basepath format a8 heading "Basepath"
col crby format 99990 heading "By"
col creation format a11 heading "Created"
col current_size format 999999990 heading "Size (K)"
col data_group_id format 99990 heading "ID"
col data_group_name format a29 heading "Data Group Name"
col default_group_flag format a4 heading "Dflt"
col in_dba_users format a13 heading "In DBA_USERS?"
col initial_extent format 9999990 heading "Initial (K)"
col index_tablespace format a12 heading "Index TS"
col install_group_num format 90 heading "IGN"
col installed_flag format a9 heading "Type"
col language_code format a4 heading "Code"
col luby format 99990 heading "By"
col next_extent format 9999990 heading "Next (K)"
col nls_language format a30 heading "NLS Language"
col number_of_extents format 9999990 heading "Num Extents"
col max_extents format 9999990 heading "Max X"
col min_extents format 9999990 heading "Min X"
col module_db_status format a9 heading "DB Status"

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 41
col module_short_name format a8 heading "Module"
col module_version format a8 heading "Version"
col oracle_id format 99990 heading "ID"
col oracle_username format a12 heading "Schema"
col owner format a10 heading "Owner"
col product_group_id format 990 heading "ID"
col product_group_name format a28 heading "Product Group Name"
col product_group_type format a10 heading "Type"
col product_version format a8 heading "Version"
col argument1 format a20 heading "Arguments"
col release_name format a12 heading "Release"
col read_only_flag format a4 heading "Type"
col sizing_factor format 99990 heading "Size%"
col segment_name format a10 heading "Name"
col status format a9 heading "Status"
col tablespace format a12 heading "Main TS"
col tablespace_name format a10 heading "Tablespace"
col temporary_tablespace format a12 heading "Temp TS"
col default_tablespace format a12 heading "Default TS"
col updated format a11 heading "Updated"

prompt
prompt Oracle Applications Database Configuration Report
prompt
prompt
prompt All dates are shown in DD-MM-YYYY format
prompt

set head off


select 'Report Date : '||to_char(sysdate,'DD-MM-YYYY HH24:MI:SS')
, 'Database name: '||value database
from v$parameter where name='db_name';
set head on

prompt --> Sql*Plus PAUSE setting


prompt

show pause

prompt
prompt --> Sql*Plus NEWPAGE setting
prompt

show newpage

prompt
prompt --> Rollback Segment Information

select dr.segment_name, dr.owner, dr.tablespace_name,


dr.initial_extent/1024 initial_extent,
dr.next_extent/1024 next_extent,
dr.min_extents, dr.max_extents,
dr.status
from dba_rollback_segs dr

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 42
order by 1;

prompt --> Rollback Segment Sizes

select ext.segment_name, ext.owner, ext.tablespace_name,


sum(ext.bytes)/1024 current_size,
count(*) number_of_extents
from dba_extents ext
where ext.segment_type = 'ROLLBACK'
group by ext.segment_name, ext.owner, ext.tablespace_name
order by 1;

prompt
prompt --> Start of Application Information Gathering
prompt

prompt --> Product Group Information

select product_group_id, product_group_name, release_name,


product_group_type, argument1
from fnd_product_groups;

prompt --> Multi-Org enabled?

set head off


select decode(multi_org_flag,'N','No','Y','Yes','No')
from fnd_product_groups;
set head on

prompt --> Existing Operating Units

select ORGANIZATION_ID, NAME


from hr_operating_units
order by ORGANIZATION_ID;

prompt --> Multi-Currency enabled?

set head off


select decode(multi_currency_flag,'N','No','Y','Yes','No')
from fnd_product_groups;
set head on

prompt --> Registered Applications

select application_id, application_short_name, basepath


from fnd_application
order by application_id
/

prompt --> Registered ORACLE Schemas

select fou.oracle_id, fou.oracle_username


, fou.install_group_num, fou.read_only_flag
, decode(nvl(du.username,' X '),' X ','No','Yes') in_dba_users

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 43
, nvl(du.default_tablespace,'Unknown') default_tablespace
, nvl(du.temporary_tablespace,'Unknown') temporary_tablespace
from dba_users du, fnd_oracle_userid fou
where du.username(+) = fou.oracle_username
order by 1
/

prompt --> Product Installation Status and other product information

select decode(nvl(a.APPLICATION_short_name,'Not Found'),


'SQLAP','AP','SQLGL','GL','OFA','FA',
'Not Found','id '||to_char(fpi.application_id),
a.APPLICATION_short_name) apps,
decode(nvl(o.ORACLE_username,'Not Found'),
'Not Found','id '||to_char(fpi.oracle_id),
o.ORACLE_username) ORACLE_username,
decode(fpi.status,'I','Installed','S','Shared',
'N','Inactive',fpi.status) status,
fpi.db_status, fpi.install_group_num,
fpi.product_version, fpi.sizing_factor,
fpi.tablespace, fpi.index_tablespace
from fnd_oracle_userid o, fnd_application a, fnd_product_installations fpi
where fpi.application_id = a.application_id(+)
and fpi.oracle_id = o.oracle_id(+)
order by 1,2
/

prompt --> Localization Module Information

select decode(a.APPLICATION_short_name,
'SQLAP','AP','SQLGL','GL','OFA','FA',
a.APPLICATION_short_name) apps
, o.ORACLE_username
, fmi.module_short_name
, fmi.module_version
, decode(fmi.status,'I','Installed','S','Shared',
'N','Inactive',fmi.status) status
, decode(fmi.db_status,'I','Installed',
'N','Inactive',db_status) module_db_status
from fnd_oracle_userid o, fnd_application a, fnd_module_installations fmi
where fmi.application_id = a.application_id(+)
and fmi.oracle_id = o.oracle_id(+)
order by 1,2,3
/

prompt --> Registered Data Groups

select data_group_id,
data_group_name
, decode(default_group_flag,'N','No','Y','Yes',
default_group_flag) default_group_flag
, to_char(creation_date,'DD-MM-YYYY') creation, created_by crby
, to_char(last_update_date,'DD-MM-YYYY') updated, last_updated_by luby
from fnd_data_groups

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 44
order by data_group_id
/

prompt --> Base language and other Installed languages

select decode(installed_flag,'I','Installed','B','Base','Unknown')
installed_flag, language_code, nls_language from fnd_languages
where installed_flag in ('I','B')
order by installed_flag;

prompt --> Setting of NLS_NCHAR_CHARACTERSET'

set head off


select VALUE NLS_NCHAR_CHARACTERSET from V$NLS_PARAMETERS
WHERE PARAMETER = 'NLS_NCHAR_CHARACTERSET';
set head on

prompt --> Setting of NLS_CHARACTERSET

set head off


select VALUE NLS_CHARACTERSET from V$NLS_PARAMETERS
where PARAMETER = 'NLS_CHARACTERSET';
set head on

prompt --> Setting of NLS_DATE_FORMAT

set head off


select VALUE NLS_DATE_FORMAT from V$NLS_PARAMETERS
where PARAMETER = 'NLS_DATE_FORMAT';
set head on

prompt --> Setting of NLS_NUMERIC_CHARACTERS

set head off


select VALUE NLS_NUMERIC_CHARACTERS from V$NLS_PARAMETERS
where PARAMETER = 'NLS_NUMERIC_CHARACTERS';
set head on

prompt --> Setting of NLS_LANGUAGE

set head off


select VALUE NLS_LANGUAGE from V$NLS_PARAMETERS
where PARAMETER = 'NLS_LANGUAGE';
set head on

prompt --> Setting of NLS_SORT

set head off


select VALUE NLS_SORT from V$NLS_PARAMETERS
where PARAMETER = 'NLS_SORT';
set head on

prompt --> Replication Package Installed?

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 45
set head off
select decode(count(*), 0, ' Not Installed ', ' Yes, Installed ')
from all_objects
where object_name in ( 'REPCOLUMN');
set head on

prompt
prompt --> End of Application Information Gathering

spool off
exit;

SCRIPT = List Product Dependencies filename = adutfpd.sq

REM $Header: adutfpd.sql 115.0 1998/04/24 16:41:20 appldev ship $


REM +======================================================================+
REM | Copyright (c) 1996 Oracle Corporation Redwood Shores, California, USA|
REM | All rights reserved. |
REM +======================================================================+
REM NAME
REM adutfpd.sql
REM DESCRIPTION
REM Utility script to display product dependency information
REM SEE ALSO
REM adutconf.sql
REM +======================================================================+

col Application format a38


col Requires format a38

spool adutfpd.lst

select o1.oracle_username||'.'||a1.application_short_name Application


, o2.oracle_username||'.'||a2.application_short_name Requires
from fnd_application a2, fnd_application a1
, fnd_oracle_userid o2, fnd_oracle_userid o1
, fnd_product_dependencies fpd
where a2.application_id=fpd.required_application_id
and a1.application_id=fpd.application_id
and o2.oracle_id=fpd.required_oracle_id
and o1.oracle_id=fpd.oracle_id
order by 1,2
/

spool off

SCRIPT = List Pinned Objects filename = ADXCKPIN.sql

REM $Header: ADXCKPIN.sql 115.0 1998/04/24 16:39:06 appldev ship $


REM +======================================================================+
REM | Copyright (c) 1994 Oracle Corporation Redwood Shores, California, USA|
REM | All rights reserved. |
REM +======================================================================+

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 46
REM
REM NAME
REM ADXCKPIN.sql - Query the SGA to determine pinned PL/SQL objects
REM
REM DESCRIPTION
REM Query the shared_pool area to determine space used by PL/SQL objects
REM and whether they have been pinned.
REM
REM NOTES
REM This script can be run at any time to determine what PL/SQL objects
REM are in the SGA, and the total space consumed. It should be run
REM from the system user.
REM PROCEDURES cannot be pinned.
REM +======================================================================+

set lines 79
column type format a12
column OBJECT format a36
column loads format 99990
column execs format 9999990
column kept format a4
column "TOTAL SPACE (K)" format a20

spool ADXCKPIN.lst

select owner || '.' || name OBJECT , type


, to_char(sharable_mem/1024,'9,999.9') "SPACE(K)"
, loads
, executions execs
, kept
from v$db_object_cache
where type in ('FUNCTION','PACKAGE','PACKAGE BODY','PROCEDURE')
and owner not in ('SYS')
order by owner, name
/

select to_char(sum(sharable_mem)/1024,'9,999,999.9') "TOTAL SPACE (K)"


from v$db_object_cache
where type in ('FUNCTION','PACKAGE','PACKAGE BODY','PROCEDURE')
and owner not in ('SYS')
/

spool off

exit;

SCRIPT = Report Database Configuration filename = ADXRCSDC.sql

REM +=======================================================================+
REM | Copyright (c) 1990 Oracle Corporation, Redwood Shores, CA, USA |
REM | All rights reserved. |
REM +=======================================================================+
REM | $Header: ADXRCSDC.sql 115.0 1998/04/24 16:40:34 appldev ship $
REM

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 47
REM FILENAME
REM ADXRCSDC.sql - Report Configuration, Show Database Configuration
REM formerly, config.sql
REM
REM DESCRIPTION
REM Report configuration of:
REM rollback segments
REM tablespaces
REM data files
REM
REM NOTES
REM Usage: sqlplus SYSTEM/<SYSTEM_password> @ADXRCSDC.sql
REM
REM HISTORY
REM 05/24/90 L Doo Created
REM
REM +=======================================================================+

set heading on
set pages 1000
set linesize 78

column segment_name format a12


column TSPACE format a10
column INITIAL format 99999999
column NEXT format 99999999
column MIN format 999999
column MAX format 999999
column PCT format 990
column status format a10
column bytes format 999999999
column file_name format a37
column ID format 99

break on TSPACE
ttitle 'Overall Database Configuration'
set heading off
select ' Rollback Segments' from sys.dual;
set heading on
ttitle off

select segment_name, tablespace_name TSPACE,


initial_extent "INITIAL", next_extent "NEXT",
min_extents MIN, max_extents MAX, pct_increase PCT,
status
from dba_rollback_segs
order by tablespace_name, segment_name;

set heading off


select ' Tablespaces' from sys.dual;
set heading on

select tablespace_name TSPACE,


initial_extent "INITIAL", next_extent "NEXT",

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 48
min_extents MIN, max_extents MAX, pct_increase PCT,
status
from dba_tablespaces
order by tablespace_name;

set heading off


select ' Datafiles' from sys.dual;
set heading on

select tablespace_name TSPACE, file_name, file_id "ID", bytes, status


from dba_data_files
order by tablespace_name;

EXIT;

SCRIPT = Report Table Sizes filename = ADXRSFTS.sql

REM +=======================================================================+
REM | Copyright (c) 1990 Oracle Corporation, Redwood Shores, CA, USA |
REM | All rights reserved. |
REM +=======================================================================+
REM | $Header: ADXRSFTS.sql 115.0 1998/04/24 16:41:10 appldev ship $
REM
REM FILENAME
REM ADXRSFTS.sql - Report State, Find Table Size
REM formerly, tabsize.sql
REM
REM DESCRIPTION
REM Find the size (blocks, extents, extpct) of the given table.
REM
REM NOTES
REM Usage:
REM sqlplus SYSTEM/<SYSTEM_password> @ADXRSFTS.sql <username> <tablename>
REM
REM HISTORY
REM 05/14/90 L Doo Created.
REM
REM +=======================================================================+
set heading on
set verify off
ttitle 'Size for Table &&1..&&2'

select blocks, extents, extpct


from sys.seg$
where (file#, block#) = (
select file#, block#
from sys.tab$
where obj# = (
select obj#
from sys.obj$
where name = upper('&&2')
and owner# = (
select user#
from sys.user$

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 49
where name = upper('&&1')
)
)
);

EXIT

SCRIPT = Show Imminent Extent Failure filename = ADXRSSIE.sql

REM +=======================================================================+
REM | Copyright (c) 1989 Oracle Corporation, Redwood Shores, CA, USA |
REM | All rights reserved. |
REM +=======================================================================+
REM | $Header: ADXRSSIE.sql 115.1 1998/05/11 10:14:07 schadala ship $
REM
REM FILENAME
REM ADXRSSIE.sql - Report State, Show Imminent next-Extent failure
REM formerly, blowup.sql
REM
REM DESCRIPTION
REM Generate a list of tables and indexes whose next extent to be grabbed
REM would be too large to be allocated in their corresponding tablespaces.
REM
REM NOTES
REM Usage: sqlplus SYSTEM/<SYSTEM_password> @ADXRSSIE.sql
REM
REM HISTORY
REM 12/12/89 L. Doo Created.
REM 12/18/89 L. Doo Added the absolute path for blowup_table.sql
REM and blowup_ind.sql.
REM 07/21/92 A. Chang Converted to use straight SQL, not PL/SQL
REM
REM +=======================================================================+

set heading on
ttitle "NEXT EXTENT BLOWUP REPORT"
set pagesize 67
column tablespace heading "Tablespace" format a10
column type heading "Object Type" format a11
column name heading "Object Name" format a30
column partition_name heading "Partition" format a10
column next_extent heading "Next Extent (b)" format 9,999,999,999
break on tablespace

select dbas.tablespace_name tablespace,


decode(
dbas.segment_type,
'TABLE PARTITION', 'TABLE',
'INDEX PARTITION', 'INDEX',
dbas.segment_type) type,
dbas.segment_name name,
nvl(dbas.partition_name, 'N/A') partition_name,
dbas.next_extent next_extent
from

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 50
dba_segments dbas,
dba_free_space dbafs
where dbas.segment_type in ('TABLE', 'INDEX',
'TABLE PARTITION',
'INDEX PARTITION')
and dbafs.tablespace_name = dbas.tablespace_name
group by dbas.tablespace_name, dbas.segment_type, dbas.segment_name,
dbas.partition_name, dbas.next_extent
having max(dbafs.bytes) < dbas.next_extent
order by 1,2,3,4;

EXIT

SCRIPT = Show User Space filename = ADXRSSUS.sql

REM +=======================================================================+
REM | Copyright (c) 1990 Oracle Corporation, Redwood Shores, CA, USA |
REM | All rights reserved. |
REM +=======================================================================+
REM | $Header: ADXRSSUS.sql 115.0 1998/04/24 16:41:48 appldev ship $
REM
REM FILENAME
REM ADXRSSUS.sql - Report State, Show User Space
REM formerly, byuser.sql
REM
REM DESCRIPTION
REM Report how much space each user has.
REM
REM NOTES
REM Usage: sqlplus SYSTEM/<SYSTEM_password> @ADXRSSUS.sql
REM
REM HISTORY
REM 01/16/90 D Touw Created
REM
REM +=======================================================================+

set heading on
set pages 122
set linesize 79
set newpage 0

ttitle 'Use Vs. Allocation of Database Space by Tablespace and User'

break on tablespace skip 1

column tablespace format a15


column username format a15
column usage format 999,999,999
column quota format 999,999,999
column percent format 9,999.9

compute sum of usage on tablespace


compute sum of quota on tablespace

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 51
select dbatq.tablespace_name TABLESPACE, dbatq.username,
dbatq.bytes USAGE, dbatq.max_bytes QUOTA
from dba_ts_quotas dbatq, dba_users dbau, dba_tablespaces dbat
where dbau.username = dbatq.username
and dbat.tablespace_name = dbatq.tablespace_name
and dbat.status = 'ONLINE'
and (dbatq.bytes > 0 or dbatq.max_bytes > 0)
order by dbatq.tablespace_name, dbatq.username;

EXIT

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 52
Applications Configuration Files

Applications
Applications Configuration
Configuration Files
Files

•• adconfig.txt
adconfig.txt
•• def.txt
def.txt
•• applprod.txt
applprod.txt
•• applterr.txt
applterr.txt
•• applora.txt
applora.txt
•• APPLSYS.env
APPLSYS.env
•• adovars.env
adovars.env

Copyright  Oracle Corporation, 2000. All rights reserved.

Oracle Applications uses multiple configuration files to setup and maintain


the Application. Those files are listed and discussed here.

adconfig.txt The main configuration file, created by


AutoUpgrade and located in $APPL_TOP/admin or
in %APPL_TOP%\admin on NT. This file contains
environment information for all of Applications and is
used by all AD Utilities. Do not update this file
manually. If you need to modify this file, delete the
existing one and rerun AutoUpgrade to create a new
adconfig.txt.
def.txt The file that contains defaults used by AutoPatch and
AD Administration when operating in non-interactive
mode. The actual name of the file is determined
when you create it. Must be created in
$APPL_TOP/admin/<dbname>. In NT, it must be in
%APPL_TOP%\admin\<dbname>. Refer to AD
Administration in Chapter 2 and AutoPatch in
Chapter 4 for more information.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 53
applprod.txt The AutoUpgrade product description file,
which is used to identify all products and product
dependencies. It is located in the admin directory
under APPL_TOP.

applterr.txt The AutoUpgrade territory description file, located in


the admin directory under APPL_TOP. It contains
information on all territories and localizations that are
supported.

applora.txt Contains information for parameter defaults stored in


V$PARAMETER. Located in the admin directory
under APPL_TOP.

APPLSYS.env The main environment file used to configure the


environment to run Applications. It is created by
Rapid Install, but can be recreated by AutoUpgrade
or AD Administration. Located directly under
APPL_TOP. APPLSYS.env is the default name,
however, other names may be substituted.

adovars.env Called by the main environment file and is used to


set environment variables for Java and HTML. It is
located in the admin directory under APPL_TOP.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 54
Flexfield Diagnostic Scripts

Flexfield
Flexfield Diagnostic
Diagnostic Scripts

•• Check
Check Key
Key Flexfields
Flexfields
•• Check
Check Descriptive
Descriptive Flexfields
Flexfields
•• Check
Check Flexbuilder
Flexbuilder Rules
Rules
•• Check
Check Value
Value Sets
Sets

Copyright  Oracle Corporation, 2000. All rights reserved.

There are a few scripts that have been provided for us by the Flexfield
Development Team that could possibly highlight problems with Flexfields.
Additionally, there are some scripts that have been independently
developed that are listed in this section for your use.

The Flexfield Development Teams scripts are shipped with the Application
for 11i. They are kept in the $FND_TOP/sql directory.

SCRIPT = Check Key Flexfields filename = afffckff.sql


SCRIPT = Check Descriptive Flexfields filename = afffcdff.sql
SCRIPT = Check Flexbuilder Rules filename = afffcfb.sql
SCRIPT = Check Value Sets filename = afffcvst.sql

Each of the above scripts is too long to reproduce. The scripts are
available from several sources. One, you can get them from any Oracle
Applications Release 11i file system. Two, you can get them from the
following URL:

http://atgorl.us.oracle.com/wsawyer/diagnostic_scripts/flexfields/

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 55
I have included the Header from each of the scripts; so that, you can look
at what each one of them is supposed to do.

SCRIPT = Check Key Flexfields filename = afffckff.sql

prompt /=====================================================================\
prompt | KEY FLEXFIELDS CONSISTENCY CHECKS
prompt |======================================================================
prompt |
prompt | DESCRIPTION
prompt | Key Flexfields data integrity check script.
prompt |
prompt | Forms :
prompt | FNDFFIIF : Key Flexfield Registration Form
prompt | Maintains KFF registration.
prompt | Responsibility : Application Developer
prompt | Navigation Path : Flexfield->Key->Register
prompt |
prompt | FNDFFMIS : Key Flexfield Segment Definition Form
prompt | Maintains KFF structure and segment definitions
prompt | Responsibility : Application Developer
prompt | Navigation Path : Flexfield->Key->Segments
prompt |
prompt | FNDFFMSA : Key Flexfield Shorthand Alias Definition Form
prompt | Maintains KFF SHAs.
prompt | Responsibility : Application Developer
prompt | Navigation Path : Flexfield->Key->Aliases
prompt |
prompt | FNDFFMCV : Key Flexfield Cross Validation Definition Form
prompt | Maintains KFF CVRs.
prompt | Responsibility : Application Developer
prompt | Navigation Path : Flexfield->Key->CrossValidation
prompt |
prompt | FNDFFMWP : Account Generator Process Assignment Form
prompt | Maintains KFF/AG process assignments.
prompt | Responsibility : Application Developer
prompt | Navigation Path : Flexfield->Key->Accounts
prompt |
prompt | Abbreviations in this script:
prompt | KFF : Key Flexfield.
prompt | SHA : Shorthand Alias.
prompt | CVR : Cross Validation Rule.
prompt | AG : Account Generator.
prompt |
prompt | To help find the history of the corruption, all the select stmts
prompt | also dump the WHO columns from relevant tables.
prompt | (Dates will be in RRRR/MM/DD format.)
prompt |
prompt | 'WHO <table name without fnd_ prefix>'
prompt | =========================
prompt | 'CD :<creation_date>
prompt | CB :<created_by>

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 56
prompt | LUD:<last_update_date>
prompt | LUB:<last_updated_by>
prompt | LUL:<last_update_login>'
prompt |
prompt | HOW TO FIX DATA:
prompt | Before you begin to fix the data, first read the rule description.
prompt | Individual rules may have specific "how to fix" instructions.
prompt | Some of the rules has fix scripts. Please either COMMIT or ROLLBACK
prompt | depending on the results of the fix script.
prompt | After running fix script, do not run the check script again in the
prompt | same session, since it has a COMMIT/EXIT at the end of it. (This is
prompt | a requirement for all sql scripts, you can comment out COMMIT/EXIT
prompt | command.)
prompt |
prompt | ER DIAGRAM:
prompt | This script basically enforces the entity relation diagram for
prompt | KFFs. Here is a simple representation of the KFF ER diagram.
prompt |
prompt | (A)FND_ID_FLEXS -----------------<- (D)FND_COMPILED_ID_FLEXS
prompt | | | |
prompt | | /|\ /|\
prompt | |(B)FND_ID_FLEX_STRUCTURES --<- (E)FND_COMPILED_ID_FLEX_STRUCTS
prompt | | FND_ID_FLEX_STRUCTURES_TL (_VL)
prompt | | | | | | |
prompt | | | | | | /|\
prompt | | | | | | (R)FND_FLEX_WORKFLOW_PROCESSES
prompt | | | | | |
prompt | | | | | +-------<- (C)FND_ID_FLEX_SEGMENTS
prompt | | | | | FND_ID_FLEX_SEGMENTS_TL (_VL)
prompt | | | | | \|/ |
prompt | | | | /|\ | |
prompt | | | |(F)FND_SHORTHAND_FLEX_ALIASES | |
prompt | | | | | |
prompt | | |(K)FND_FLEX_VALIDATION_RULE_STATS | |
prompt | | | | |
prompt | | /|\ | |
prompt | |(G)FND_FLEX_VALIDATION_RULES | |
prompt | | FND_FLEX_VDATION_RULES_TL (_VL) | |
prompt | | | | |
prompt | | | (I)FND_FLEX_INCLUDE_RULE_LINES | |
prompt | | | | | |
prompt | | +----<- (H)FND_FLEX_VALIDATION_RULE_LINES | |
prompt | | | | |
prompt | | (J)FND_FLEX_EXCLUDE_RULE_LINES | |
prompt | | | |
prompt | /|\ | |
prompt | (L)FND_SEGMENT_ATTRIBUTE_TYPES | |
prompt | | | | | |
prompt | | | /|\ | |
prompt | | |(N)FND_VALUE_ATTRIBUTE_TYPES | |
prompt | | | FND_VAL_ATTRIBUTE_TYPES_TL (_VL) | |
prompt | | | | |
prompt | | /|\ | |
prompt | |(O)FND_FLEX_VALIDATION_QUALIFIERS ->--- FND_FLEX_VALUE_SETS |

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 57
prompt | | |
prompt | | |
prompt | (M)FND_SEGMENT_ATTRIBUTE_VALUES ->-------------------------------+
prompt |
prompt |
prompt | SELECT RESULT SET NOTES:
prompt | Following Column Titles (aliases) will be used to identify entities.
prompt |
prompt | APPLICATION :
prompt | KFF owner application details from FND_APPLICATION_VL.
prompt | See FND_FLEX_DIAGNOSE.GET_APP() for syntax and example.
prompt |
prompt | KFF :
prompt | KFF details from FND_ID_FLEXS.
prompt | See FND_FLEX_DIAGNOSE.GET_KFF_FLX() for syntax and example.
prompt |
prompt | TABLE_APPLICATION :
prompt | KFF base table application details from FND_APPLICATION_VL.
prompt | See FND_FLEX_DIAGNOSE.GET_APP() for syntax and example.
prompt |
prompt | KFF_TABLE :
prompt | KFF base table details from FND_TABLES.
prompt | See FND_FLEX_DIAGNOSE.GET_TBL() for syntax and example.
prompt |
prompt | CCID_COLUMN :
prompt | Unique id (CCID) column details from FND_COLUMNS.
prompt | See FND_FLEX_DIAGNOSE.GET_COL() for syntax and example.
prompt |
prompt | STRUCTURE_COLUMN :
prompt | Structure (Set Defining) column details from FND_COLUMNS.
prompt | See FND_FLEX_DIAGNOSE.GET_COL() for syntax and example.
prompt |
prompt | LANGUAGE :
prompt | Language details from FND_LANGUAGES.
prompt | See FND_FLEX_DIAGNOSE.GET_LNG() for syntax and example.
prompt |
prompt | STRUCTURE :
prompt | Structure details from FND_ID_FLEX_STRUCTURES_VL.
prompt | See FND_FLEX_DIAGNOSE.GET_KFF_STR() for syntax and example.
prompt |
prompt | SEGMENT :
prompt | Segment details from FND_ID_FLEX_SEGMENTS_VL.
prompt | See FND_FLEX_DIAGNOSE.GET_KFF_SEG() for syntax and example.
prompt |
prompt | SEGMENT_COLUMN :
prompt | Segment column details from FND_COLUMNS.
prompt | See FND_FLEX_DIAGNOSE.GET_COL() for syntax and example.
prompt |
prompt | VALUE_SET :
prompt | Value set details from FND_FLEX_VALUE_SETS.
prompt | See FND_FLEX_DIAGNOSE.GET_VST_SET() for syntax and example.
prompt |
prompt | SHORTHAND_ALIAS :
prompt | SHA details from FND_SHORTHAND_FLEX_ALIASES.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 58
prompt | See FND_FLEX_DIAGNOSE.GET_KFF_SHA() for syntax and example.
prompt |
prompt | CVR_RULE :
prompt | CVR Rule details from FND_FLEX_VDATION_RULES_VL.
prompt | See FND_FLEX_DIAGNOSE.GET_KFF_CVR() for syntax and example.
prompt |
prompt | CVR_ERR_SEGMENT :
prompt | Segment details for Err Segment of a CVR.
prompt | See FND_FLEX_DIAGNOSE.GET_KFF_SEG() for syntax and example.
prompt |
prompt | CVR_LINE :
prompt | CVR Line details from FND_FLEX_VALIDATION_RULE_LINES.
prompt | See FND_FLEX_DIAGNOSE.GET_KFF_CVL() for syntax and example.
prompt |
prompt | FLEX_QUALIFIER :
prompt | Flexfield Qualifier details from FND_SEGMENT_ATTRIBUTE_TYPES.
prompt | See FND_FLEX_DIAGNOSE.GET_KFF_FLQ() for syntax and example.
prompt |
prompt | SEGMENT_QUALIFIER :
prompt | Segment Qualifier details from FND_VAL_ATTRIBUTE_TYPES_VL.
prompt | See FND_FLEX_DIAGNOSE.GET_KFF_SGQ() for syntax and example.
prompt |
prompt | QUALIFIER_COLUMN :
prompt | Segment qualifier column details from FND_COLUMNS.
prompt | See FND_FLEX_DIAGNOSE.GET_COL() for syntax and example.
prompt |
prompt | AG_WF_PROCESS :
prompt | Account Generator/Workflow Process details from
prompt | FND_FLEX_WORKFLOW_PROCESSES.
prompt | See FND_FLEX_DIAGNOSE.GET_KFF_WFP() for syntax and example.
prompt |
prompt | CODE_TO_FIX :
prompt | PL/SQL code to fix the problem.
prompt |
prompt \=====================================================================/

SCRIPT = Check Descriptive Flexfields filename = afffcdff.sql

prompt /=====================================================================\
prompt | DESCRIPTIVE FLEXFIELDS CONSISTENCY CHECKS
prompt |======================================================================
prompt |
prompt | DESCRIPTION
prompt | Descriptive Flexfields data integrity check script.
prompt |
prompt | Forms :
prompt | FNDFFIDF : Descriptive Flexfield Registration Form
prompt | Maintains DFF registration.
prompt | Responsibility : Application Developer
prompt | Navigation Path : Flexfield->Descriptive->Register
prompt |
prompt | FNDFFMDC : Descriptive Flexfield Segment Definition Form
prompt | Maintains DFF context and segment definitions

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 59
prompt | Responsibility : Application Developer
prompt | Navigation Path : Flexfield->Descriptive->Segments
prompt |
prompt | Abbreviations in this script:
prompt | DFF : Descriptive Flexfield.
prompt |
prompt | To help find the history of the corruption, all the select stmts
prompt | also dump the WHO columns from relevant tables.
prompt | (Dates will be in RRRR/MM/DD format.)
prompt |
prompt | 'WHO <table name without fnd_ prefix>'
prompt | =========================
prompt | 'CD :<creation_date>
prompt | CB :<created_by>
prompt | LUD:<last_update_date>
prompt | LUB:<last_updated_by>
prompt | LUL:<last_update_login>'
prompt |
prompt | HOW TO FIX DATA:
prompt | Before you begin to fix the data, first read the rule description.
prompt | Individual rules may have specific "how to fix" instructions.
prompt | Some of the rules has fix scripts. Please either COMMIT or ROLLBACK
prompt | depending on the results of the fix script.
prompt | After running fix script, do not run the check script again in the
prompt | same session, since it has a COMMIT/EXIT at the end of it. (This is
prompt | a requirement for all sql scripts, you can comment out COMMIT/EXIT
prompt | command.)
prompt |
prompt | ER DIAGRAM:
prompt | This script basically enforces the entity relation diagram for
prompt | DFFs. Here is a simple representation of the DFF ER diagram.
prompt |
prompt | (A)FND_DESCRIPTIVE_FLEXS
prompt | FND_DESCRIPTIVE_FLEXS_TL (_VL)
prompt | | | | |
prompt | | | | /|\
prompt | | | |(B)FND_DEFAULT_CONTEXT_FIELDS
prompt | | | /|\
prompt | | |(D)FND_COMPILED_DESCRIPTIVE_FLEXS
prompt | | /|\
prompt | |(C)FND_DESCR_FLEX_CONTEXTS
prompt | | FND_DESCR_FLEX_CONTEXTS_TL (_VL)
prompt | | |
prompt | | /|\
prompt | |(E)FND_DESCR_FLEX_COLUMN_USAGES
prompt | | FND_DESCR_FLEX_COL_USAGE_TL (_VL)
prompt | | |
prompt | FND_APPLICATION, FND_TABLES, (F)FND_COLUMNS
prompt |
prompt |
prompt | SELECT RESULT SET NOTES:
prompt | Following Column Titles (aliases) will be used to identify entities.
prompt |
prompt | APPLICATION :

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 60
prompt | DFF owner application details from FND_APPLICATION_VL.
prompt | See FND_FLEX_DIAGNOSE.GET_APP() for syntax and example.
prompt |
prompt | DFF :
prompt | DFF details from FND_DESCRIPTIVE_FLEXS_VL.
prompt | See FND_FLEX_DIAGNOSE.GET_DFF_FLX() for syntax and example.
prompt |
prompt | TABLE_APPLICATION :
prompt | DFF base table application details from FND_APPLICATION_VL.
prompt | See FND_FLEX_DIAGNOSE.GET_APP() for syntax and example.
prompt |
prompt | DFF_TABLE :
prompt | DFF base table details from FND_TABLES.
prompt | See FND_FLEX_DIAGNOSE.GET_TBL() for syntax and example.
prompt |
prompt | CONTEXT_COLUMN :
prompt | Context (Structure) defining column details from FND_COLUMNS.
prompt | See FND_FLEX_DIAGNOSE.GET_COL() for syntax and example.
prompt |
prompt | LANGUAGE :
prompt | Language details from FND_LANGUAGES.
prompt | See FND_FLEX_DIAGNOSE.GET_LNG() for syntax and example.
prompt |
prompt | CONTEXT :
prompt | Context (Structure) details from FND_DESCR_FLEX_CONTEXTS_VL
prompt | See FND_FLEX_DIAGNOSE.GET_DFF_CTX() for syntax and example.
prompt |
prompt | SEGMENT :
prompt | Segment details from FND_DESCR_FLEX_COL_USAGE_VL
prompt | See FND_FLEX_DIAGNOSE.GET_DFF_SEG() for syntax and example.
prompt |
prompt | SEGMENT_COLUMN :
prompt | Segment (Attribute) column details from FND_COLUMNS.
prompt | See FND_FLEX_DIAGNOSE.GET_COL() for syntax and example.
prompt |
prompt | VALUE_SET :
prompt | Value set details from FND_FLEX_VALUE_SETS.
prompt | See FND_FLEX_DIAGNOSE.GET_VST_SET() for syntax and example.
prompt |
prompt | CODE_TO_FIX :
prompt | PL/SQL code to fix the problem.
prompt |
prompt \=====================================================================/

SCRIPT = Check Flexbuilder Rules filename = afffcfb.sql

prompt +======================================================================
prompt | FlexBuilder data integrity check script.
prompt |
prompt | If these select statements return rows, there are data integrity
prompt | problems.
prompt | The rules and explanations below contain information about solving
prompt | problems using either FlexBuilder Setup forms or SQL*Plus DML

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 61
prompt | commands.
prompt |
prompt | This script assumes that your Customer or Support Representative is
prompt | familiar with Flexfields and FlexBuilder. For complete information
prompt | about Flexfields and FlexBuilder, refer to "Oracle Applications
prompt | Release 10G Flexfields Guide."
prompt |
prompt | Forms :
prompt | FNDFBRFP : FlexBuilder Functions
prompt | Maintains function details, and raw parameters.
prompt | Responsibility : Application Developer
prompt | Navigation Path : Flexfield -> FlexBuilder -> Function
prompt |
prompt | FNDFBMPA : FlexBuilder Parameters
prompt | Maintains parameters. (raw and derived)
prompt | Responsibility : Application Developer
prompt | Navigation Path : Flexfield -> FlexBuilder -> Parameter
prompt | or
prompt | Responsibility : System Administrator
prompt | Navigation Path : Application->Flexfield->FlexBuilder->Define
prompt |
prompt | FNDFBMAS : FlexBuilder Assignments
prompt | Maintains FB Function assignments to Key Flexfield Structures
prompt | Responsibility : System Administrator
prompt | Navigation Path : Application->Flexfield->FlexBuilder->Assign
prompt |
prompt | FNDFFMIS : Key Flexfield Segments
prompt | Maintains KFF structure and segment definitions.
prompt | Responsibility : System Administrator
prompt | Navigation Path : Application -> Flexfield -> Key -> Segments
prompt |
prompt | In this script
prompt | FB : Stands for FlexBuilder.
prompt | KFF : Stands for Key Flexfield.
prompt | Form-F : Stands for FNDFBRFP form (function form).
prompt | Form-P : Stands for FNDFBMPA form (parameter form).
prompt | Form-A : Stands for FNDFBMAS form (assign form).
prompt | Form-K : Stands for FNDFFMIS form (keyflexfield segments form)
prompt |
prompt | NOTES:
prompt | Each FB function is defined only for one KFF.
prompt | In general FB functions are used to generate Accounting Flexfield
prompt | combinations. (Internally accounting flexfield is represented as
prompt | 101/GL# or SQLGL/GL#. 101 is the application ID and SQLGL is the
prompt | application short name of Oracle General Ledger. GL# is the internal
prompt | code for the accounting flexfield.)
prompt | Each FB function may have assignment rules for the
prompt | structures of the KFF. Make sure this structure is enabled and
prompt | compiles successfully. Some of the Assignment attributes depend on
prompt | whether KFF structure is frozen or not. If you are not able
prompt | to update structure-dependent properties of assignments, unfreeze
prompt | the KFF structure and fix the FB assignments. Then,
prompt | re-freeze the KFF structure.
prompt | Use Flexfield->Key->Segments form to unfreeze or refreeze

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 62
prompt | KFF structures.
prompt |
prompt | To help find the history of the corruption, all the select stmts
prompt | also dump the WHO columns from relevant tables.
prompt | (Dates will be in YYYY/MM/DD format.)
prompt |
prompt | 'WHO <table_name>'
prompt | ---------------------
prompt | 'CD :<creation_date>
prompt | CB :<created_by>
prompt | LUD:<last_update_date>
prompt | LUB:<last_updated_by>
prompt | LUL:<last_update_login>'
prompt |
prompt |
prompt | HOW TO FIX DATA:
prompt | Before you begin to fix the data, first read the rule description.
prompt | Individual rules may have specific "how to fix" instructions.
prompt |
prompt | A.% Rules: Each SELECT statement identifies these parameters.
prompt | FB_APPLICATION (FB application_[id/short_name/name]),
prompt | FB_FUNCTION (FB function_[code/name]),
prompt | KFF_APPLICATION (KFF application_[id/short_name/name]),
prompt | KFF (KFF id_flex_[code/name]),
prompt | 'WHO <table_name>'.
prompt | Use Form-F to query these functions and
prompt | make sure the rule is satisfied.
prompt |
prompt | B.% Rules: Each SELECT statement identifies these parameters.
prompt | FB_APPLICATION (FB application_[id/short_name/name]),
prompt | FB_FUNCTION (FB function_[code/name]),
prompt | PRM_NAME (parameter_name),
prompt | PRM_SEQ (sequence),
prompt | PRM_TYPE (parameter_type),
prompt | PRM_ASSIGN_TYPE (assignment_type),
prompt | <RULE SPECIFIC ADDITIONAL INFO>,
prompt | 'WHO <table_name>'
prompt | Use Form-P to query these parameters and
prompt | make sure the rule is satisfied.
prompt |
prompt | B.1 and B.2: Run the $FND_TOP/sql/FNDNLINS.sql script.
prompt |
prompt | C.% Rules: Each SELECT statement identifies these parameters.
prompt | FB_APPLICATION (FB application_[id/short_name/name]),
prompt | FB_FUNCTION (FB function_[code/name]),
prompt | KFF_STRUCTURE (KFF id_flex_[num/structure_name]),
prompt | SEQ (sequence),
prompt | ASSG_TYPE (assignment_type),
prompt | <RULE SPECIFIC ADDITIONAL INFO>,
prompt | 'WHO <table_name>'
prompt | Use Form-A to query these assignments and
prompt | make sure the rule is satisfied.
prompt |
prompt | LOOKUP CODES :

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 63
prompt | PRM_TYPE : Parameter Type : (FLEXBUILDER_PARAMETER_TYPES)
prompt | C : Constant
prompt | D : Derived
prompt | K : Key Flexfield Segment
prompt | R : Raw
prompt |
prompt | PRM_ASSIGN_TYPE :
prompt | Parameter Assign. Type : (FLEXBUILDER_PARAMETER_ASSIGNS)
prompt | A : Always
prompt | F : Flexfield
prompt | N : Never
prompt | S : Segment
prompt |
prompt | ASSG_TYPE : Assignment Type : (FLEXBUILDER_ASSIGNMENT_TYPES)
prompt | C : Constant
prompt | F : Flexfield
prompt | Q : Qualifier
prompt | S : Segment
prompt +======================================================================

IMPORTANT DEVELOPER NOTE:

I should have put this comment in the check script. too late...

QUESTION:

During upgrade, they are running afffcfb.sql. They are encountering a


violation in rule C.13 for about 31 Purchasing accounts. Violation of Rule
C.13 indicates a segment usage for an account is Null and it should not be
null. Release 10.7 seems to accept a null value as it has caused no
previous problem but it has changed for Release 11i. The solution is to
populate the field with a yes or no value.

Client would like to verify that inserting No into these Null fields will keep
the same process as the Null value. He wants to verify there will be no
change in function by inserting this 'no' value.

ANSWER:

In segment usages column NULL means all Yes. Customer should use
assignments form and set the usage flags to 'Yes'.

SCRIPT = Check Value Sets filename = afffcvst.sql

prompt /=====================================================================\
prompt | VALUE SETS CONSISTENCY CHECKS
prompt |======================================================================

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 64
prompt |
prompt | DESCRIPTION
prompt | Value Sets data integrity check script.
prompt |
prompt | Forms :
prompt | FNDFFMVS : Value Set Registration Form.
prompt | Maintains value sets.
prompt | Responsibility : Application Developer
prompt | Navigation Path : Application->Validation->Set
prompt |
prompt | FNDFFMSV : Value Define Form.
prompt | Maintains Values for Independent, Dependent,
prompt | Tranaslatable Independent, Translatable Dependent, and
prompt | Table Validated (Summary values only) value set values.
prompt | Responsibility : Application Developer
prompt | Navigation Path : Application->Validation->Value
prompt |
prompt | FNDFFMHL : Rollup Groups Form.
prompt | Maintains value rollup groups.
prompt | Responsibility : Application Developer
prompt | Navigation Path : Flexfield->Key->Groups
prompt |
prompt | FNDFFSRN : Security Rule Define Form.
prompt | Maintains value set security rules.
prompt | Responsibility : System Administrator
prompt | Navigation Path : Security->Responsibility->ValueSet->Define
prompt |
prompt | FNDFFSRA : Security Rule Assign Form.
prompt | Maintains value set security rule assignments.
prompt | Responsibility : System Administrator
prompt | Navigation Path : Security->Responsibility->ValueSet->Assign
prompt |
prompt | Abbreviations in this script:
prompt | KFF : Key Flexfield.
prompt | DFF : Descriptive Flexfield.
prompt | VST : Value set.
prompt |
prompt | To help find the history of the corruption, all the select stmts
prompt | also dump the WHO columns from relevant tables.
prompt | (Dates will be in RRRR/MM/DD format.)
prompt |
prompt | 'WHO <table name without fnd_ prefix>'
prompt | =========================
prompt | 'CD :<creation_date>
prompt | CB :<created_by>
prompt | LUD:<last_update_date>
prompt | LUB:<last_updated_by>
prompt | LUL:<last_update_login>'
prompt |
prompt | HOW TO FIX DATA:
prompt | Before you begin to fix the data, first read the rule description.
prompt | Individual rules may have specific "how to fix" instructions.
prompt | Some of the rules has fix scripts. Please either COMMIT or ROLLBACK
prompt | depending on the results of the fix script.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 65
prompt | After running fix script, do not run the check script again in the
prompt | same session, since it has a COMMIT/EXIT at the end of it. (This is
prompt | a requirement for all sql scripts, you can comment out COMMIT/EXIT
prompt | command.)
prompt |
prompt | ER DIAGRAM:
prompt | This script basically enforces the entity relation diagram for
prompt | VSTs. Here is a simple representation of the VST ER diagram.
prompt |
prompt | (A)FND_FLEX_VALUE_SETS .....
prompt | | | | | |
prompt | | | | | |
prompt | | | | | (B)FND_FLEX_VALIDATION_TABLES
prompt | | | | |
prompt | | | | /|\
prompt | | | | (C)FND_FLEX_VALIDATION_EVENTS
prompt | | | |
prompt | | | /|\
prompt | | | (H)FND_FLEX_HIERARCHIES
prompt | | | FND_FLEX_HIERARCHIES_TL (_VL)
prompt | | |
prompt | | /|\
prompt | | (D)FND_FLEX_VALUE_RULES
prompt | | FND_FLEX_VALUE_RULES_TL (_VL)
prompt | | | |
prompt | | | /|\
prompt | | | (E)FND_FLEX_VALUE_RULE_LINES
prompt | | |
prompt | | /|\
prompt | | (F)FND_FLEX_VALUE_RULE_USAGES ->---<- FND_RESPONSIBILITY
prompt | |
prompt | /|\
prompt | (G)FND_FLEX_VALUES
prompt | FND_FLEX_VALUES_TL (_VL)
prompt | |
prompt | /|\
prompt | (I)FND_FLEX_VALUE_NORM_HIERARCHY
prompt | |
prompt | /|\
prompt | (J)FND_FLEX_VALUE_HIERARCHIES
prompt |
prompt |
prompt | SELECT RESULT SET NOTES:
prompt | Following Column Titles (aliases) will be used to identify entities.
prompt |
prompt | VALUE_SET :
prompt | VST details from FND_FLEX_VALUE_SETS.
prompt | See FND_FLEX_DIAGNOSE.GET_VST_SET() for syntax and example.
prompt |
prompt | TABLE_APPLICATION :
prompt | VST base table application details from FND_APPLICATION_VL.
prompt | See FND_FLEX_DIAGNOSE.GET_APP() for syntax and example.
prompt |
prompt | VST_TABLE :

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 66
prompt | VST Table details from FND_FLEX_VALIDATION_TABLES.
prompt | See FND_FLEX_DIAGNOSE.GET_VST_TBL() for syntax and example.
prompt |
prompt | VST_EVENT :
prompt | VST Event details from FND_FLEX_VALIDATION_EVENTS.
prompt | See FND_FLEX_DIAGNOSE.GET_VST_EVT() for syntax and example.
prompt |
prompt | SECURTIY_RULE :
prompt | Security Rule details from FND_FLEX_VALUE_RULES_VL.
prompt | See FND_FLEX_DIAGNOSE.GET_VST_SCR() for syntax and example.
prompt |
prompt | LANGUAGE :
prompt | Language details from FND_LANGUAGES.
prompt | See FND_FLEX_DIAGNOSE.GET_LNG() for syntax and example.
prompt |
prompt | SECURTIY_LINE :
prompt | Security Rule Line details from FND_FLEX_VALUE_RULE_LINES.
prompt | See FND_FLEX_DIAGNOSE.GET_VST_SCL() for syntax and example.
prompt |
prompt | SECURTIY_USAGE :
prompt | Security Rule Usage details from FND_FLEX_VALUE_RULE_USAGES.
prompt | See FND_FLEX_DIAGNOSE.GET_VST_SCU() for syntax and example.
prompt |
prompt | RESP_APPLICATION :
prompt | Responsibility application details from FND_APPLICATION_VL.
prompt | See FND_FLEX_DIAGNOSE.GET_APP() for syntax and example.
prompt |
prompt | RESPONSIBILITY :
prompt | Responsibility details from FND_RESPONSIBILITY_VL.
prompt | See FND_FLEX_DIAGNOSE.GET_RSP() for syntax and example.
prompt |
prompt | FLEX_VALUE :
prompt | Flex Value details from FND_FLEX_VALUES_VL.
prompt | See FND_FLEX_DIAGNOSE.GET_VST_VAL() for syntax and example.
prompt |
prompt | ROLLUP_GROUP :
prompt | Rollup Group details from FND_FLEX_HIERARCHIES_VL.
prompt | See FND_FLEX_DIAGNOSE.GET_VST_RLG() for syntax and example.
prompt |
prompt | NORM_HIERARCHY :
prompt | Normalized hierarchy details from FND_FLEX_VALUE_NORM_HIERARCHY.
prompt | See FND_FLEX_DIAGNOSE.GET_VST_FVN() for syntax and example.
prompt |
prompt | DENORM_HIERARCHY :
prompt | DeNormalized hierarchy details from FND_FLEX_VALUE_HIERARCHIES.
prompt | See FND_FLEX_DIAGNOSE.GET_VST_FVH() for syntax and example.
prompt |
prompt | CODE_TO_FIX :
prompt | PL/SQL code to fix the problem.
prompt |
prompt \=====================================================================/

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 67
Additional Flexfield Scripts

Additional
Additional Flexfield
Flexfield Scripts
Scripts

•• Descriptive
Descriptive Flexfield
Flexfield Definitions
Definitions
•• Describe
Describe Flexfield
Flexfield Tables
Tables

Copyright  Oracle Corporation, 2000. All rights reserved.

Here are some additional flexfield diagnostic scripts that may help.

SCRIPT = Descriptive Flexfield Definitions


filename = fnddflex.sql

rem fnddflex.sql
rem
ttitle 'Descriptive Flex Table/Column Definitions'
rem
col applicaiton_id format 99999 heading 'APPL|ID'
col descriptive_flexfield_name format a20 heading 'FLEXFIELD NAME'
col title format a20 heading 'TITLE'
col descriptive_flex_context_code format a20 heading 'FLEX CONTEXT CODE'
col application_table_name format a20 heading 'TABLE NAME'
col application_column_name format a20 heading 'APPLICATION|COLUMN NAME'
col end_user_column_name format a20 heading 'END USER|COLUMN NAME'
rem
break on application_id on application_table_name on descriptive_flexfield_name -
on title on descriptive_flex_context_code
rem
select f.application_id,
f.descriptive_flexfield_name,
f.title,
c.descriptive_flex_context_code,
f.application_table_name,

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 68
cu.application_column_name,
cu.end_user_column_name
from &aol..fnd_descr_flex_column_usages cu,
&aol..fnd_descr_flex_contexts c,
&aol..fnd_descriptive_flexs f,
&aol..fnd_application a
where a.application_id = f.application_id
and f.application_id = c.application_id
and f.descriptive_flexfield_name = c.descriptive_flexfield_name
and c.application_id = cu.application_id
and c.descriptive_flexfield_name = cu.descriptive_flexfield_name
and c.descriptive_flex_context_code = cu.descriptive_flex_context_code
and a.application_short_name like upper('&short_name')
and f.application_table_name like upper('&table_name')
order by a.application_short_name, f.application_table_name,
f.descriptive_flexfield_name, c.descriptive_flex_context_code,
cu.column_seq_num
/

SCRIPT = Describe Flexfield Tables


filename = describeflexs.sql

DECLARE

flextable_name ALL_TAB_COLUMNS.table_name%TYPE;
flexcol_name ALL_TAB_COLUMNS.column_name%TYPE;
flexcol_nullable ALL_TAB_COLUMNS.nullable%TYPE;
flexcol_dtype ALL_TAB_COLUMNS.data_type%TYPE;
flexcol_dlen ALL_TAB_COLUMNS.data_length%TYPE;
flexcol_dprec ALL_TAB_COLUMNS.data_precision%TYPE;
flexcol_dscale ALL_TAB_COLUMNS.data_scale%TYPE;

tableinfo_name ALL_TABLES.table_name%TYPE;
tableinfo_tblsp ALL_TABLES.tablespace_name%TYPE;
tableinfo_part ALL_TABLES.partitioned%TYPE;
tableinfo_pfree ALL_TABLES.pct_free%TYPE;
tableinfo_pused ALL_TABLES.pct_used%TYPE;
tableinfo_nrows ALL_TABLES.num_rows%TYPE;
tableinfo_init ALL_TABLES.initial_extent%TYPE;
tableinfo_next ALL_TABLES.next_extent%TYPE;
tableinfo_min ALL_TABLES.min_extents%TYPE;
tableinfo_max ALL_TABLES.max_extents%TYPE;
tableinfo_pinc ALL_TABLES.pct_increase%TYPE;

oldtable_name ALL_TAB_COLUMNS.table_name%TYPE;
oldcol_name ALL_TAB_COLUMNS.column_name%TYPE;

CURSOR flextables IS
SELECT ATC.table_name, ATC.column_name, ATC.nullable, ATC.data_type,
ATC.data_length, ATC.data_precision, ATC.data_scale
FROM ALL_TAB_COLUMNS ATC, ALL_TABLES ATBLS
WHERE (ATC.table_name LIKE 'FND%FLEX%' OR

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 69
ATC.table_name LIKE 'FND%SEGMENT%' OR
ATC.table_name LIKE 'FND%VAL%ATTRIB%' OR
ATC.table_name LIKE 'FND%CONTEXT_FIELD') AND
ATC.table_name = ATBLS.table_name
ORDER BY ATC.table_name, column_id;

CURSOR tableinfo IS
SELECT table_name, tablespace_name, partitioned, pct_free, pct_used,
num_rows, initial_extent, next_extent, min_extents, max_extents,
pct_increase
FROM ALL_TABLES
WHERE table_name LIKE 'FND%FLEX%' OR
table_name LIKE 'FND%SEGMENT%' OR
table_name LIKE 'FND%VAL%ATTRIB%' OR
table_name LIKE 'FND%CONTEXT_FIELD'
ORDER BY table_name;

BEGIN
DBMS_OUTPUT.ENABLE (1000000);
OPEN flextables;
OPEN tableinfo;
oldtable_name := ' ';
oldcol_name := ' ';
LOOP
FETCH flextables INTO flextable_name, flexcol_name, flexcol_nullable,
flexcol_dtype, flexcol_dlen, flexcol_dprec, flexcol_dscale;
EXIT WHEN flextables%NOTFOUND;
IF oldcol_name <> flexcol_name THEN
oldcol_name := flexcol_name;
IF oldtable_name <> flextable_name THEN
FETCH tableinfo INTO tableinfo_name, tableinfo_tblsp,
tableinfo_part, tableinfo_pfree, tableinfo_pused,
tableinfo_nrows, tableinfo_init, tableinfo_next,
tableinfo_min, tableinfo_max, tableinfo_pinc;
DBMS_OUTPUT.PUT_LINE (CHR(10));
DBMS_OUTPUT.PUT_LINE ('TABLE NAME: '||flextable_name);
DBMS_OUTPUT.PUT_LINE ('TABLESPACE: '||tableinfo_tblsp);
DBMS_OUTPUT.PUT_LINE ('PARTITIONED: '||tableinfo_part);
DBMS_OUTPUT.PUT_LINE ('% FREE: '||LPAD(TO_CHAR(
tableinfo_pfree),10,' ')||' % USED: '
||LPAD(TO_CHAR(tableinfo_pused),10,' '));
DBMS_OUTPUT.PUT_LINE ('# OF ROWS: '
||LPAD(TO_CHAR(ROUND(tableinfo_nrows,0)),10,' '));
DBMS_OUTPUT.PUT_LINE ('INIT EXTENT: '
||LPAD(TO_CHAR(tableinfo_init),10,' ')||' NEXT EXTENT: '
||LPAD(TO_CHAR(tableinfo_next),10,' '));
DBMS_OUTPUT.PUT_LINE ('MIN EXTENTS: '
||LPAD(TO_CHAR(tableinfo_min),10,' ')||' MAX EXTENTS: '
||LPAD(TO_CHAR(tableinfo_max),10,' '));
DBMS_OUTPUT.PUT_LINE ('% INCREASE: '
||LPAD(TO_CHAR(tableinfo_pinc),10,' '));
DBMS_OUTPUT.PUT_LINE (CHR(10));
DBMS_OUTPUT.PUT_LINE ('Name NULL?
TYPE');

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 70
DBMS_OUTPUT.PUT_LINE ('------------------------------- -------- ------
-------');
oldtable_name := flextable_name;
END IF;
DBMS_OUTPUT.PUT (RPAD(flexcol_name,32,' '));
IF flexcol_nullable = 'Y' THEN
DBMS_OUTPUT.PUT (' ');
ELSE
DBMS_OUTPUT.PUT ('NOT NULL ');
END IF;
IF (flexcol_dtype = 'LONG') OR (flexcol_dtype = 'DATE') OR
(flexcol_dtype = 'LONG RAW') OR (flexcol_dtype = 'ROWID') OR
(flexcol_dtype = 'MLSLABEL') OR (flexcol_dtype = 'CLOB') OR
(flexcol_dtype = 'NCLOB') OR (flexcol_dtype = 'BLOB') OR
(flexcol_dtype = 'BFILE')
THEN
DBMS_OUTPUT.PUT_LINE (RPAD(flexcol_dtype,13,' '));
ELSIF (flexcol_dtype = 'NUMBER') THEN
IF flexcol_dscale = 0 THEN
DBMS_OUTPUT.PUT_LINE
(RPAD(flexcol_dtype||'('||TO_CHAR(flexcol_dprec)||')',13,' '));
ELSE
DBMS_OUTPUT.PUT_LINE
(RPAD(flexcol_dtype||'('||TO_CHAR(flexcol_dprec)||','||TO_CHAR(flexcol_dscale)||')
',13,' '));
END IF;
ELSE
DBMS_OUTPUT.PUT_LINE
(RPAD(flexcol_dtype||'('||TO_CHAR(flexcol_dlen)||')',13,' '));
END IF;
END IF;
END LOOP;
END;
/

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 71
Flexfield Test Form

Flexfield
Flexfield Test
Test Form
Form

•• Testing
Testing Key
Key Flexfields
Flexfields
•• Testing
Testing Descriptive
Descriptive Flexfields
Flexfields
•• Testing
Testing Range
Range Flexfields
Flexfields

Copyright  Oracle Corporation, 2000. All rights reserved.

The "Flexfield Test" form is available under the "Application Developer"


responsibility under the menu path Flexfields -> Test. This form can be
used to test the flexfield behavior under various flexfield definition
scenarios. From a developer perspective, it allows a flexfield to be tested
without coding it into a form. From a diagnostic perspective, it can be
used to rule out the problem from residing in the flexfield or its definition.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 72
Testing Key Flexfields

The Flexfield Test form can be used to test any key flexfield structure as
defined in a foreign key form (i.e.,. you can use VALIDATE modes of
FULL, PARTIAL, PARTIAL_IF_POSSIBLE and NONE). Currently the test
form supports only the Oracle General Ledger Accounting Flexfield
structures to be tested in the combinations (maintenance) form (i.e.,
VALIDATE mode of FOR_INSERT).

To test a key flexfield definition, choose "Key Flexfields" in the main


window of the Flexfield Test form. You can then use "Query Find" to get a
list of all frozen key flexfield structures defined in the database. Choose
the structure you wish to test. If you do not find the structure you are
looking for make sure that the "Freeze Flexfield Definition" flag is checked
for the structure (and the segments have been setup) in the "Key Flexfield
Segments" form.

You can modify the definition of the key flexfield in the test form by clicking
the "Define" button. This takes you to the Key Flexfield Definition
Arguments screen.

You can set the values for all the arguments to key flexfield definition (i.e.,
the call to FND_KEY_FLEX.DEFINE procedure) in this screen. Please
refer to the Oracle Applications Developer's Guide for descriptions of

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 73
these arguments. These fields default to the default values of these
arguments.

You can use the BLOCK.FIELDs given below with the following arguments
that require a BLOCK.FIELD value.

KEY_FLEX.COPY with the COPY argument


KEY_FLEX.VALATT1 through KEY_FLEX.VALATT5 with the VALATT argument.
KEY_FLEX.DERIVED1 through KEY_FLEX.DERIVED5 with the DERIVED argument.
KEY_FLEX.QUERY_SECURITY with the QUERY_SECURITY argument.

Note: Since we are passing arguments though :BLOCK.FIELD references


you do not have to escape the backslash (\) character in the argument
values with another backslash as you would when you pass values
directly to the FND_KEY_FLEX.DEFINE call, i.e., use \n instead of \\n, or
\0 instead of \\0. For example, a possible value for the DISPLAYABLE
argument will be "ALL\01" instead of "ALL\\01".

You can also set the INSERT and UPDATE properties of the block where
the flexfield is defined by checking the corresponding checkboxes. The
"Use Data Field" checkbox can be used to test the case where you pass in
a DATA_FIELD to the flexfield definition.

Once the Flexfield has been defined click the "Flexfield" button on the
main window to get to the Key Flexfield Test screen.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 74
The various fields in this block are described below.

The "Copy" field is to be used in cases where you used the COPY
argument to the Flexfield Definition. Using this argument you can "copy"
values from this field to the flexfield window.

The "Segments" field is where the flexfield is defined. You can enter code
combinations into this field or use "List of Values" or "Field Edit" from this
field to open the Key Flexfield window.

The "Query Security" field is used to indicate secured combinations when


the QUERY_SECURITY argument is used for this special case.

The "Descriptions" field will display the concatenated descriptions.

The "ID" field will display the code combination id (When doing a "FULL"
validation).

The "Data Field" will display the concatenated id values (When the "Use
Data Field" checkbox is checked in the Arguments screen).

The fields "Valatt 1 - 5" will display the segment qualifier values if used in
the VALATT argument to the flexfield definition.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 75
The fields "Derived 1 - 5" will display the derived value of segment
qualifiers for a code combination if used in the "DERIVED" argument to
the key flexfield definition.

The fields "Segment 1 - 30" will display the individual segment values
depending on the segment to column mapping of the key flexfield
segments (If USEDBFLDS argument is set to "Y").

This block will allow you to test your flexfield definition. It allows you to
enter code combinations, query up combinations and do inserts.

Testing Descriptive Flexfields

The Flexfield Test form can be used to test descriptive flexfields that use
the standard naming conventions for column names; ATTRIBUTE1
through ATTRIBUTE30, or GLOBAL_ATTRIBUTE1 through
GLOBAL_ATTRIBUTE30 for the segment columns, and either
ATTRIBUTE_CATEGORY, ATTRIBUTE_CATEGORY_CODE or
CONTEXT for the context column. If the descriptive flexfield you wish to
test does not have such columns you can replicate your flexfield setup on
a special test flexfield called "Test Descriptive Flexfields" (Owned by the
"Application Object Library" application). This is a descriptive flexfield that
has been created for testing purposes.

If you have a context reference field defined for your flexfield, that field will
not exist in this form. As a workaround temporarily change the context
reference field to "DESCR_FLEX.ATTRIBUTECAT". Similarly
:BLOCK.FIELD references in your value sets and defaults will not work as
these fields will not exist in this form. As a workaround the form provides
five fields called "DESCR_FLEX.REFERNECE1 through
DESCR_FLEX.REFERENCE5 that can be used for such cases. Update
value sets and defaults that have such :BLOCK.FIELD references to use
these fields instead.

To test descriptive flexfields, choose "Descriptive Flexfield" in the main


window. By default this will query up the special test flexfield "Test
Descriptive Flexfields". If you wish to test other flexfields you can use
query find to get a list of flexfields that you can test. To be on this list the
flexfield should be frozen (i.e., the "Freeze Flexfield Definition" flag should
be set to "Yes" in the "Descriptive Flexfield Segments" form) and should
have context column name match one of the names given above. (The
LOV does not check the individual segment columns. The form assumes
they will be either ATTRIBUTEn or GLOBAL_ATTRIBUTEn).

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 76
You can modify the definition of the descriptive flexfield by clicking the
"Define" button. This takes you to the Descriptive Flexfield Definition
Arguments screen.

You can set the values for all the arguments to descriptive flexfield
definition (i.e., the call to FND_DESCR_FLEX.DEFINE procedure) in this
screen. Please refer to the Oracle Applications Developer's Guide for
descriptions of these arguments. These fields default to the default values
of these arguments.

You can also set the INSERT and UPDATE properties of the block where
the flexfield is defined by checking the corresponding checkboxes. The
"Use Data Field" checkbox can be used to test the case where you pass in
a DATA_FIELD to the flexfield definition.

Once the Flexfield has been defined click the "Flexfield" button on the
main window to get to the Descriptive Flexfield Test screen.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 77
The various fields in this block are described below.

The ID field can be used to enter any numeric ID value to identify this
record. This is a required field, so a value should be entered before you
save the record.

The "Context Reference Field" is the field that you can use as a reference
field for the flexfield context value. The internal name of this field is
DESCR_FLEX.ATTRIBUTECAT. The LOV on this field will give you a list
of enabled contexts for the flexfield.

The next field [ ] is the field where the descriptive flexfield is defined.
Navigating to this field should open the Descriptive Flexfield window.

The "Descriptions" field will display the concatenated descriptions of the


segment values.

The fields "Reference 1 - 5" fields can be used as :BLOCK.FIELD


references (:DESCR_FLEX.REFERENCE1, ...
:DESCR_FLEX.REFERENCE5) in value set where clauses and segment
defaults. If you do this you need to enter values here before navigating to
the descriptive flexfield field.

The "Context" field displays the context value.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 78
The "Data Field" will display the concatenated id values (When the "Use
Data Field" checkbox is checked in the Arguments screen).

The "Attribute 1 - 30" fields will display the individual segment values
depending on the segment to column mapping of the descriptive flexfield
segments. (If USEDBFLDS argument is set to "Y")

Two Number type fields ATTRIBTUE21_NUMBER and


ATTRIBUTE22_NUMBER, and Two Date type fields
ATTRIBUTE23_DATE and ATTRIBUTE24_DATE are also provided for
use with the "Test Descriptive Flexfield" flexfield to test cases where the
underlying column is not of type VARCHAR2.

This block will allow you to test your flexfield definition. It allows you to
enter descriptive flexfield values, query up records based on descriptive
flexfield values and do inserts.

Testing Range Flexfields

The test form can be used to test the Range Flexfield implementation of
any frozen key flexfield structure. The test form also allows you to enable
and test up to two Type fields.

To test a range flexfield definition, choose "Range Flexfields" in the main


window of the Flexfield Test form. You can use "Query Find" to get a list of
all frozen key flexfield structures defined in the database. Choose the
structure you wish to test. If you do not find the structure you are looking
for make sure that the "Freeze Flexfield Definition" flag is checked for the
structure (and the segments have been setup) in the "Key Flexfield
Segments" form.

You can modify the definition of the range flexfield in the test form by
clicking the "Define" button. This takes you to the Range Flexfield
Definition Arguments screen.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 79
You can set the values for all the arguments to range flexfield definition
(i.e., the call to FND_RANGE_FLEX.DEFINE procedure) in this screen.
Please refer to the Oracle Applications Developer's Guide for descriptions
of these arguments. These fields default to the default values of these
arguments

You can enable up to two Type fields in the range flexfield window. The
form has two fields called RANGE_FLEX.SEGMENTS_TYPE1 and
RANGE_FLEX.SEGMENTS_TYPE2 for the concatenated type values.
For concatenated type descriptions there are two fields named
RANGE_FLEX.DESCRIPTIONS_TYPE1 and DESCRIPTIONS_TYPE2
and for concatenated type ID values there are fields
RANGE_FLEX.DATA_FIELD_TYPE1, and
RANGE_FLEX.DATA_FIELD_TYPE2. There are also fields
SEGMENT1_TYPE1 through SEGMENT30_TYPE1 and
SEGMENT1_TYPE2 through SEGMENT30_TYPE2 to store individual
segment type values. So if you need to setup both type fields, the value
for the TYPE_FIELD will be:

RANGE_FLEX.SEGMENTS\n_TYPE1\0RANGE_FLEX.SEGMENTS\n_TYPE2

Similarly the value for the TYPE_DESCRIPTION field will be:

RANGE_FLEX.DESCRIPTIONS\0RANGE_FLEX.DESCRIPTIONS

and the value for the TYPE_DATA_FIELD will be:

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 80
RANGE_FLEX.DATA_FIELD\0RANGE_FLEX.DATA_FIELD

You can also set the INSERT and UPDATE properties of the block where
the flexfield is defined by checking the corresponding checkboxes.

Once the Flexfield has been defined click the "Flexfield" button on the
main window to get to the Range Flexfield Test screen.

The various fields in this block are described below.

The ID field can be used to enter any numeric ID value to identify this
record. This is a required field, so a value should be entered before you
save the record.

The four regions "Low", "High", "Type1" and "Type2" have the
concatenated values field, the concatenated descriptions field and the
concatenated ID values field for the low values, the high values and the
two type (if enabled) values. The range flexfield is defined on the
concatenated Low values field. Navigating to this field will open up the
range flexfield window.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 81
The "Low", "High", "Type1" and "Type2" fields for segments 1 through 30
will show the individual segment low and high values, and the type values
(if enabled).

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 82
Java Code Tracing

Java
Java Code
Code Tracing
Tracing

http://www-apps.us.oracle.com/atg/flex/static/aoldebug.html
http://www-apps.us.oracle.com/atg/flex/static/aoldebug.html

Copyright  Oracle Corporation, 2000. All rights reserved.

The following passages are subject to numerous updates. The latest


version of the steps and techniques is available at:
http://www-apps.us.oracle.com/atg/flex/static/aoldebug.html

The Flexfield edit window is one of a half-dozen modal dialogs provided


for Oracle Applications through AOL. They are dynamically created
through the C code in the forms server process, and presented to the user
for interaction through the java client. Lacking a runtime source debugger
that can handle this setup, the only means presently available for
debugging the java code that drives these dialogs is trace statements. To
support targeting of trace output to particular parts of the code, the trace
generating statements are tagged with category keywords, and each
category can be enabled/disabled independently of the others. And a
special dialog is provided to allow tracing to be enabled/disabled
dynamically at runtime, without recompiling the code, or even restarting
the current session. This support is implemented in fndaol.jar and is
available for use by any of the client java code, through the
oracle.apps.fnd.ui.AOLDebug class. The dynamic selection of trace
categories at runtime is accomplished using the dialog implemented by
the oracle.apps.fnd.ui.AOLDebugBox class. This text describes the
tracing support, and explains how to use it.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 83
Detailed Explanation and Justification

The simplicity that the internet computing architecture brings to users and
administrators has contributed greatly to the success that Oracle
Applications has been enjoying against its principal competitors.
However, the complexity that it brings to the development and
maintenance activities has presented a great many challenges. Forms
provides User Exits for running applications C code from within a form
trigger; however, lacking a way to call back into Forms from within a User
Exit requires alternative means for bringing up any kind of dialogs with
Forms. So things like alert windows, the help-about window, language-
translation window, and the Flexfield edit window have all been
implemented using Java support on the client side. This is not a great
stretch, by itself. The main problem is that none of the debugging tools
seems capable of operating on this code, given the physical fragmentation
between the tiers and the indirect means of passing control between them.
With the most powerful means of diagnosing bugs unavailable, the
developer/maintainer is left with one of the least sophisticated means for
diagnosing problems and isolating bugs: debug messages, or trace
statements. This mechanism was first formalized for AOL dialogs in the
AOLDebug class, to provide a framework for categorizing messages, so
that they can be selectively enabled and disabled to focus ones attention
on particular areas of the code needing diagnosis.

Debug messages in AOLDebug were originally compile-controlled, using


simple boolean flags. Getting diagnostic information for a misbehaving
system involved replacing the jarfile with a new one that had debug
messages enabled in appropriate places. High-water-mark constraints in
our apps patching mechanism meant that the trace-enabled jarfile rarely
had the same versions of classes that the questionable one did, so it gave
us our own Uncertainty Principle - we could never know what was really
happening inside, because in order to observe the system, we had to
change it, first. This was both frustrating and wasteful, to both the user
and the maintainer.

The AOLDebugBox dialog provides the ability to enable/disable tracing at


runtime, so one can start watching the code's execution with minimal
disruption to the circumstances that are misbehaving. Under ideal
conditions, when one of these Java dialogs starts malfunctioning, the
client can open this dialog, enable tracing in the appropriate area(s) of the
code, reproduce the malfunction on the spot, and analyze the trace
statements that are generated, to characterize the malfunction and isolate
the bug. The dialog can then be re-opened to disable the tracing, when
the desired output has been obtained. All of this can be done without

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 84
recompiling the jarfile - even without restarting the session, if the bug,
itself, isn't causing the session to crash.

The ability to generate category-targeted traces can limit the cost of


diagnosis, in time and effort. And the ability to dynamically control the
tracing has eliminated most of the overhead involved in capturing these
traces - even with the limited number of convenience features provided so
far.

Note that this support is targeted for internal developers and maintainers,
and is not "part of the product"; as such, we did not go to the trouble of
incorporating the standard user niceties (such as translatable button
labels), or providing the usual A.D.A. functionality (like shortcut keys, or
the showfields LOV popup).

Getting Traces at Runtime

The essential steps for getting traces are as follows:

1. Run your apps session. If you are using appletviewer, make


sure it is running in a window capable of showing output (such
as a DOS window, with a large scrollable area). If you are
using jinitiator, make sure your java console is open for that
session.
2. Perform any preparatory steps required to reach a point just
before the operation that you wish to trace.
3. Open any of the AOL dialogs, e.g. the Flexfield edit window,
Translation window, Help-About window, etc.
4. Hit the Forms BLOCK_MENU function key (commonly CTRL-B,
but look it up for your particular session, if unsure), to bring up
AOLDebugBox dialog.
5. Select the categories you wish to show, and de-select those
you wish not to show. Commit the choices with the OK button.
(tracing will now begin)
6. Continue with the operation that you want to trace.
7. When you've gotten enough output, open the AOLDebugBox
dialog, again; hit the Defaults button, and then the OK button.
(tracing will now end)

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 85
8. Use normal Windows cut/copy/paste capability to save the
portion(s) of the resulting trace that contain the information you
need.

The fndaol.jar dialogs are equipped to raise an AOLDebugBox dialog


when the user hits the Forms BLOCK_MENU function key. (It tends to be
bound to CTRL-B; but hitting CTRL-K in an application session will list the
keyboard bindings that are in effect for that session.) This dialog is for
enabling and disabling whichever trace categories the user chooses.

The tracing code is always present and always running. Each time a
trace-output instruction is encountered, AOLDebug will check the tracing
categories associated with the output; if any of these categories is
currently enabled for output, the line will be output. To view the defined
categories and optionally modify which are currently enabled for output,
just hit the BLOCK_MENU key from inside any of the AOL dialogs. The
AOLDebugBox dialog should be pretty straightforward - with a checkbox
for each category, which is checked if the category is enabled, or
unchecked if it is not enabled. You can use the mouse to select the
categories you want; keyboard-only control is also provided: The arrow
keys move up and down in the list; if a checkbox currently has the input
focus, the spacebar will toggle it on/off, and the ENTER key will commit
the current choices; but if a button has the focus, the spacebar or ENTER
key will press that button.

The buttons along the bottom of the dialog perform the following functions:

OK : Commit the current choices, and close the AOLDebugBox


dialog.
Apply : Commit the current choices, but leave the AOLDebugBox
dialog open. (primarily for debugging AOL dialog code,
itself)
Cancel : Close the AOLDebugBox dialog, and leave the choices as
they were before the dialog was opened. Hitting the ESC
key or clicking the X button on the window's frame does
the same thing.
Revert : Reset the choices to the way they were when the
AOLDebugBox dialog was opened this time. This is
essentially the same as hitting the Cancel button, and then
re-opening the AOLDebugBox dialog. This does not
automatically commit.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 86
Defaults : Reset the choices to the way they were when the apps
session began. This does not automatically commit.
Help : Bring up the apps help system. One of these days, it might
bring up this documentation for this dialog; but for now, it
just provides general help.

Once you have obtained the traces you need, just open one of the AOL
dialogs, bring up the AOLDebugBox dialog, click on the Defaults button,
then the OK button, to restore the system to its initial quiet mode.
Opening this dialog to reconfigure the tracing tends to generate tracing
output, itself, since it's an AOL dialog. If you're just going to be quitting the
apps session, you might as well just exit the apps, directly - the extra
tracing output generated by the really-exit confirmation dialog will be less
than the extra output generated by bringing up the AOLDebugBox dialog
to disable the output...

Where Does the Output Go?

Presently, all output is directed to the java console, using the


System.out.println() method. For this reason, you are strongly advised to
display the java console before you start enabling trace outputs. Future
enhancements are planned, to allow the output to be directed to one or
more destinations, including files and streams. The idea of integrating
(interlacing) these debug outputs with those coming from the middle-tier
and server side was discussed; but since the primary use for this would be
debugging the messaging handshake between the java client and middle
tier - and integrating these outputs would itself have to use this messaging
layer to get its output into a combined log - the cost in complexity appears
to outweigh any benefit that can't be realized without combining the
outputs. So this debugging support is not intended to be combined with
the unified tracing support that is currently evolving for the middle-tier and
database server modules.

When support for file/stream output is added, the output destination(s) will
be selected using a different panel in the AOLDebugBox dialog.

Which Tracing Categories Should Be Chosen?

Choosing fewer categories means less output, and narrower output focus.
As a general rule, fault-isolation tracing will begin with a fairly broad net,
and progressively narrow, until just one or two specific categories are
needed. It is generally not useful, for instance, to enable categories that
generate highly detailed trace output, until the target has been narrowed

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 87
down a bit. A better strategy would be to use some general-purpose
tracing to narrow things down to a particular area of the code, and then
enable the detailed tracing on just that area. For example - when trying to
isolate a crash, don't enable full tracing for KEYS, EVENTS, MSGS,
MSGDETAIL, and TABS right away. First enable GENERAL, and perhaps
TRACEENTRY; then examine the output that is generated leading up to
the crash - and perform a second run with detailed tracing enabled for just
the functional area related to that output. The success of this kind of
strategy can be strongly affected by how much thought went into the
positioning of the output in the code, and how well each output's
categories were chosen. If a developer targets all of a module's output to
the GENERAL category, for example, it will take more time to isolate
malfunctions in that module. Of course, this area tends to be more of an
art than a science; it took some trial and error for even the developer of
this feature to get a good feel for the best way to choose categories for
tracing, under various circumstances...

Anatomy of a Trace Line

Here is a sample of the output generated by AOLDebug tracing; it shows a


fairly minimal view into the processing of the KEY_PRESSED event, when
the user hit ALT-C to cancel the FlexWindow dialog:

2 FormattedTextField.keyPressed() : ------- ENTER -------


2 FormattedTextField.keyPressed() : Thread: java.awt.event.KeyEvent
[KEY_PRESSED,keyCode=67,
keyChar='c',modifiers=Alt] on
FlexTextField0
3 CommonDialog.handleKeyEventFragments() : ------- ENTER -------
3 CommonDialog.handleKeyEventFragments() : ------- EXIT -------
3 FormattedTextField.keyHandleEvent() : ------- ENTER -------
3 FormattedTextField.keyHandleEvent() : Giving dialog first stab at the
event...
3 FlexWindow.handleDialogKeyEvent() : Client key bindings are
available...
3 FlexWindow.handleDialogKeyEvent() : --- no binding found ---
3 FlexWindow.handleDialogKeyEvent() : Key is not special to this
dialog...
3 FormattedTextField.keyHandleEvent() : ------- EXIT -------
2 FormattedTextField.keyPressed() : ------- EXIT -------

Each trace line includes these parts:

1. trace level : Each traceEntry() increases this number by 1, and


each traceExit() decreases it by 1. This gives us a kind of
call-stack depth indicator, which helps to quickly identify which

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 88
output lines belong to a particular call, which lines belong to
calls made by that call, and when that call has finished. Also, if
a certain method can be called in a nested fashion, the different
trace-level tags makes it easy to tell where the execution is --
when two trace output lines might otherwise look identical to
each other.
2. method name : The name of the java method from which the
trace line was output. This shows just the last two pieces of the
full method name, with the expectation that this will be enough
to identify a given class. (If there were three different
FormattedTextField classes, for example, this would not be
enough information to disambiguate them. If half an ounce of
care is exercised when naming classes, though, this should be
a non-issue...)
3. An output string, preferably something revealing information
about what's happening inside, such as variable values,
conditions encountered, etc.

One thing worth noting about this output: The only line that actually shows
data is near the top, when the event's attributes are output. The rest of
this trace simply shows the entry and exit for the principal methods, and a
couple of brief text lines that indicate which path is being taken at critical
conditional points. This illustrates how a small set of sparse traces,
carefully positioned, can be enough to 'see' what is going on, in many
cases. Also, by placing the event-detail output in the 'right' code location,
we only have to see it one time, for one event. This not only makes the
output less verbose, it also means the reader doesn't have to waste time
looking at multiple lines showing the same event, trying to figure out
whether two lines represent two events or just one. (This was extracted
from a trace that was captured by enabling just three trace categories:
KEYS, TRACEENTRY, and TRACEEXIT...)

Tips for Good Tracing

Tracing is, by its very nature, an unsophisticated diagnostic tool; but


following a few guidelines can improve the usability of the resulting trace,
including:

1. Start general, then get detailed. If you have no idea what code
to watch, enabling entry/exit tracing can give you an idea of
where a problem is occurring. Then enable more detailed

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 89
tracing in that area, and repeat the operation you're tracing.
The second pass will then show details of what is happening
inside the code where you believe the problem is occurring.
2. Once you have a good idea of what specific user action
immediately precedes the point where problems start showing
up, perform all your operations up until that point, before
enabling your trace. Tracing slows down the system (each line
generates and parses a stack trace), so the less time you have
tracing enabled, the less time you'll waste in areas of the code
that aren't relevant to your problem.
3. Enable the fewest categories needed to get the information
you're after. More categories means more output, and more
lines of output makes it harder to find the lines of output that
are relevant.
4. Make a mental note of where the trace output is, just before the
erroneous action is performed. This will make it easier to focus
your analysis on the part of the output that is relevant.
5. If you notice that the trace-level indicator seems to be losing
track of its position -- either getting progressively larger or
going negative -- it indicates that one or more traced methods
have a traceEntry() without a corresponding traceExit(), or
vice-versa. This is mostly an issue for the developer, who
should take care to have every entry paired with an exit, to
keep these accurate. But if you see signs of this in the output,
it means that you shouldn't trust the level indicators in your
trace all that much.

Developer Notes

Setting Up Code for Runtime Tracing Support

If you are writing java client code and wish to include tracing support
inside your code, please refer to the instructions in the header section of
the AOLDebug, AOLDebugFlag, and AOLDebugBox source files (in the
oracle.apps.fnd.ui package), for up-to-date developer-oriented information.
A few classes that already have tracing in them can be used as examples.
Refer to the oracle.apps.fnd.flex.FlexWindow class, or to the
CommonDialog, FormattedTextField, and AOLDebugBox classes in the
oracle.apps.fnd.ui package.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 90
Wiring up a class for tracing support occurs in two different modes --
proactive and reactive. There are certain ways to prepare a chunk of code
for supporting tracing, before things ever go awry inside. And there are
ways to apply additional tracing to a chunk of code, when its behavior is
being scrutinized for diagnosing a bug.

Development-Time Tips

One approach to this would be like a full-court press: Make sure that
every step of a calculation and every branch of execution in the code
contains a trace statement, to expose the information relevant to that step
or branch, and make sure every method in every class has call/entry/exit
tracing in it. This would make the debugging trace log effectively the
same as single-stepping through the code, providing complete visibility
into every nontrivial action the code can take. If tracing was free and time
was infinite, this approach would clearly be the best. But tagging each
generated trace line with the current method name requires a stack trace
to be captured and the calling method's name to be parsed from the
appropriate line in that trace -- so an incremental performance loss is
incurred with each line that is output to the trace. Plus, the more trace
hooks that are in a piece of code, the harder it is to actually read the code;
and the more trace lines that are generated to a log, the harder it is to sift
through all the output and find the pieces of information that are relevant
to the behavior being diagnosed. So clearly, some kind of cost/benefit
equation applies to tracing support, and some good judgement must be
exercised -- both by the developer, when choosing where to put the trace
points in the code, and by the maintainer, when choosing which trace
areas to enable for a log.

Another approach would be purely passive: Only add a trace hook to a


piece of code, when that hook is needed during actual diagnostic work.
This would certainly minimize the trace-support footprint in the code, by
including just those hooks that have already proven themselves to be
useful. But since each useful trace hook becomes evident, only after a
test run is performed that did not provide quite enough information to
diagnose a given problem, the process inches forward one or two hooks at
a time. And the cost of so many iterations through the test/probe/compile
cycle -- in terms of time and frustration -- makes this approach just as bad
as the other extreme. A compromise approach tends to be best.

The principal challenge during the development phase is anticipating the


diagnostic value of having a trace hook at any given point in the code. A
pretty good rule of thumb is to start out conservative, including trace hooks
at only the most complicated steps of a calculation or the most
complicated decision-making points of the code, and applying

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 91
call/entry/exit tracing to only those methods that present the highest risks
of incurring hangs or crashes. After this basic framework is set up,
additional trace hooks can be applied during the development/testing
phase, as the need for them arises. This way, the delicate balance
between too many trace hooks and too few trace hooks will be easier to
manage.

There are three main choices to make, when wiring your code up to use
debug tracing:

1. What diagnostic information will be helpful to expose during


runtime, to provide ample visibility into the meaningful workings
of the code?
2. Where are the places that the code makes meaningful choices
between different execution paths?
3. What functionality categories are relevant to each trace hook,
for effective output control by the engineer gathering
diagnostics?

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 92
Diagnostic Style

Diagnostic
Diagnostic Style
Style

•• II know
know what
what II know.
know.
•• II know
know what
what II don't
don't know.
know.
•• II don't
don't know
know what
what II don't
don't know.
know.

Copyright  Oracle Corporation, 2000. All rights reserved.

I wish I could use a witty remark like, “diagnostics and troubleshooting is


like finding a needle in a stack of needles.” But, I can’t. I can’t use such
remarks if I wish to remain true to the content. Diagnostics and
troubleshooting is hard and easy, short and long, complex and simple,
tiring and pleasurable, and just about any other opposite pair you’d
choose to pick.

Diagnostics and troubleshooting is the very nature of an unknown. But


some unknowns are easier than others. I’d like to discuss 3 different
scenarios in which you might find yourself using diagnostic and
troubleshooting techniques.

Scenario 1: “I know what I know”

This scenario is where you have a strong idea what the problem is, and
you use your techniques to confirm the problem.

Scenario 2: “I know what I don’t know”

This scenario is where you encounter a problem, and you have an idea
where to start looking for the problem.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 93
Scenario 3: “I don’t know what I don’t know”

This scenario is where you encounter a problem, and you don’t even have
an idea where to start looking for an answer.

In all of these scenarios, it is imperative that you know and use diagnostic
techniques. However, as the scenarios increase, it becomes even more
imperative to have a good diagnostic style. Why?

Well, using scenario 3, what can you do? If you have a diagnostic style,
you may NOT be able to say where or what the problem is. But! you will
be able to definitively say where or what it is not.

So, what style should you use? Answer, your own. This sounds like a
trite answer, but it is not meant that way. The only style you’re going to be
able to easily follow is your own. Adopting other people’s style forces you
to accept their weaknesses, and to ignore your own strengths. In most
diagnostic situations, there will be multiple methods to get an answer.
Using a method that plays into your strengths is the most effective. Also,
accept that any given style is going to have weaknesses. Those
weaknesses will mean that some problems appear more difficult than
others, and some problems will take more time than others. Don’t let the
weaknesses discourage you from developing and pursuing a style. Even
no style is, in effect, a style.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 94
Summary

Summary
Summary

You
You should
should feel
feel comfortable
comfortable with
with the
the following
following
statements
statements about
about your
your knowledge
knowledge of of flexfields
flexfields ::
•• II can
can read
read and
and understand
understand Entity
Entity Relationship
Relationship
Diagrams (ERDs)
Diagrams (ERDs)
•• II can
can read
read and
and understand
understand the
the Oracle
Oracle Applications
Applications
Flexfield
Flexfield ERDs.
ERDs.
•• II can
can run
run and
and understand
understand Oracle
Oracle SQL
SQL scripts
scripts that
that
probe
probe Oracle
Oracle database
database objects.
objects.
•• II can
can identify
identify and
and understand
understand the
the major
major
configuration
configuration files
files used
used with
with Oracle
Oracle Applications.
Applications.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 95
Summary

Summary
Summary

•• II can
can run
run and
and understand
understand flexfield
flexfield diagnostic
diagnostic
scripts
scripts and
and forms.
forms.
•• II am
am developing
developing mymy own
own diagnostic
diagnostic style,
style, and
and II am
am
aware of its importance.
aware of its importance.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 96
Practice Overview

Practice
Practice Overview
Overview

This
This practice
practice covers
covers the
the following
following topics:
topics:
•• Skills
Skills practice
practice
•• Running
Running SQL
SQL scripts
scripts
•• Using
Using Oracle
Oracle Applications
Applications forms
forms

Copyright  Oracle Corporation, 2000. All rights reserved.

1. Pick a responsibility of your choice. Find a form in that responsibility


with at least 1Descriptive Flexfield and at least 1 Key Flexfield.
Query up a record into that form.

Answer the following questions about that form.

A. What is its shortname and version? ______________________

B. What table/view does that form use? _____________________

C. How many Descriptive Flexfields are on that form? __________

D. Name them _________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 97
E. How many segments do each of those Descriptive Flexfields
have, and what is their size?

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

F. Find 1 field that is in the table that is not on the form. What is it?

______________________________________________________

______________________________________________________

______________________________________________________

G. For each Descriptive Flexfield you found, has it been defined?


frozen?

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

H. What key flexfield(s) are on your form?

______________________________________________________

______________________________________________________

______________________________________________________

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 98
I. What structure(s) are those key flexfield(s) using?

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

2. Repeat Question 1, but this time attempt to answer EVERY question


using a different technique. Then, answer sub-question J.

A. What is its shortname and version? _____________________

B. What table/view does that form use? ____________________

C. How many Descriptive Flexfields are on that form? __________

D. Name them

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

E. How many segments do each of those Descriptive Flexfields


have, and what is their size?

______________________________________________________

______________________________________________________

______________________________________________________

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 99
F. Find 1 field that is in the table that is not on the form. What is it?

______________________________________________________

______________________________________________________

G. For each Descriptive Flexfield you found, has it been defined?


frozen?

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

H. What key flexfield(s) are on your form?

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

I. What structure(s) are those key flexfield(s) using?

______________________________________________________

______________________________________________________

______________________________________________________

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 100
J. Were you able to use a different technique for …

Question A: YES/NO If No, why not? ______________

__________________________________________________

__________________________________________________

Question B: YES/NO If No, why not? ______________

__________________________________________________

__________________________________________________

Question C: YES/NO If No, why not? ______________

__________________________________________________

__________________________________________________

Question D: YES/NO If No, why not? ______________

__________________________________________________

__________________________________________________

Question E: YES/NO If No, why not? ______________

__________________________________________________

__________________________________________________

Question F: YES/NO If No, why not? ______________

__________________________________________________

__________________________________________________

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 101
Question G: YES/NO If No, why not? ______________

__________________________________________________

__________________________________________________

Question H: YES/NO If No, why not? ______________

__________________________________________________

__________________________________________________

Question I : YES/NO If No, why not? ______________

__________________________________________________

__________________________________________________

3. Run the Check Descriptive Flexfields script.

4. Run the Check Key Flexfields script.

5. Run the Check Value Set script.

6. Pick a Descriptive Flexfield. Which one did you pick?

__________________________________________________

Examine that Descriptive Flexfield in the Flexfield Test form.

7. Pick a Key Flexfield. Which one did you pick?

__________________________________________________

Examine that Key Flexfield in the Flexfield Test form.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagnostic Tools and Methods


Chapter 2 - Page 102
High-Level Design
Chapter 3

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 1
High-Level Design

High-Level
High-Level Design
Design

Copyright  Oracle Corporation, 2000. All rights reserved.

ILT Schedule: Timing Topic


60 minutes Lecture
120 minutes Practice
180 minutes Total

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson,
lesson, you
you should
should be
be able
able to:
to:
•• Find
Find the
the tables
tables that
that are
are part
part of
of Flexfields.
Flexfields.
•• Find
Find the
the forms
forms that
that are
are part
part of
of Flexfields.
Flexfields.
•• Find
Find the
the C
C code
code that
that makes
makes up
up Flexfields.
Flexfields.
•• Find
Find the
the PL/SQL
PL/SQL code
code that
that makes
makes up
up Flexfields.
Flexfields.
•• Find
Find the
the Java
Java code
code that
that makes
makes up
up Flexfields.
Flexfields.
•• Find
Find the
the remaining,
remaining, miscellaneous
miscellaneous pieces
pieces that
that are
are
part
part of
of Flexfields.
Flexfields.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 3
Flexfield Components

Flexfield
Flexfield Components
Components

•• Tables
Tables
•• Forms
Forms
•• C
C code
code
•• PL/SQL
PL/SQL code
code
•• Java
Java files
files
•• Other
Other components
components

Copyright  Oracle Corporation, 2000. All rights reserved.

While it may appear that showing the components of Flexfields is simply


an exercise in listing, it is not. Sometimes, it is in your best interest to lock
down where the problem may be occurring. Sometimes, it can be simply
an exhaustive method of removing the places where it is not. Whatever
the case, it is equally important for you to know how this list was
developed. Each piece is documented as to how it was obtained.

Flexfield Tables

While the number of tables that contain Descriptive and Key Flexfield data
is numerous, there are only a few tables that are part of the Flexfield
Definition. The following script will list those tables for you.

col table_name format A30 Heading "Table Name"


col tablespace_name format A30 Heading "Tablespace"
col partitioned format A3 Heading "Prt"
col pct_free format 990 Heading "Fr%"
col pct_used format 990 Heading "Us%"
col num_rows format 9999990 Heading "# Rows"
col initial_extent format 999999990 Heading "Initial"
col next_extent format 999999990 Heading "Next"
col min_extents format 999999990 Heading "Min"

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 4
col max format A10 Heading " Max"
col pct_increase format 90 Heading "In%"

set verify off


set pages 9999
set lines 132

SELECT table_name, tablespace_name, partitioned, pct_free,


pct_used,
num_rows, initial_extent, next_extent, min_extents,
lpad(decode(to_char(max_extents),'2147483645','Unlimited',
to_char(max_extents)),10,' ') max,
pct_increase
FROM ALL_TABLES
WHERE table_name LIKE 'FND%FLEX%'
OR table_name LIKE 'FND%SEGMENT%'
OR table_name LIKE 'FND%VAL%ATTRIB%'
OR table_name LIKE 'FND%CONTEXT_FIELD'
OR table_name = 'FND_APPLICATION'
OR table_name = 'FND_TABLES'
OR table_name = 'FND_COLUMNS'
OR table_name LIKE 'WF_ITEM_TYPES%'
ORDER BY table_name
/

Type Name Description


AOL FND_APPLICATION Applications registered with AOL
AOL FND_TABLES Tables registered with AOL
AOL FND_COLUMNS Columns registered with AOL

KEY FND_COMPILED_ID_FLEXS Compiled Key flexfields


KEY FND_COMPILED_ID_FLEX_STRUCTS Compiled Key flexfield structures
KEY FND_FLEX_EXCLUDE_RULE_LINES Cross-validation rule exclude lines
KEY FND_FLEX_INCLUDE_RULE_LINES Cross-validation rule include lines
KEY FND_FLEX_VALIDATION_QUALIFIERS Key flexfield flexfield and segment qualifiers
KEY FND_FLEX_VALIDATION_RULES Cross-validation rules
KEY FND_FLEX_VALIDATION_RULE_LINES Cross-validation rule lines
KEY FND_FLEX_VALIDATION_RULE_STATS # of Cross-validation rules for a Key flexfield
KEY FND_FLEX_VDATION_RULES_TL Translatable info about cross-validation rules
KEY FND_ID_FLEXS Key flexfield
KEY FND_ID_FLEX_SEGMENTS Key flexfield segments
KEY FND_ID_FLEX_SEGMENTS_TL Translatable info about Key flexfield segments
KEY FND_ID_FLEX_STRUCTURES Key flexfield structures
KEY FND_ID_FLEX_STRUCTURES_TL Translatable info about Key flexfield structures
KEY FND_SEGMENT_ATTRIBUTE_TYPES Flexfield qualifiers for Key flexfields
KEY FND_SEGMENT_ATTRIBUTE_VALUES Values of flexfield qualifiers for Key flexfields
KEY FND_SHORTHAND_FLEX_ALIASES Shorthand aliases
KEY FND_VALUE_ATTRIBUTE_TYPES Segment qualifiers for Key flexfields

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 5
KEY FND_VAL_ATTRIBUTE_TYPES_TL Translatable info about segment qualifiers
KEY FND_FLEX_HASH Prevents conflicting combinations

DESC FND_COMPILED_DESCRIPTIVE_FLEXS Compiled Descriptive flexfields


DESC FND_DESCRIPTIVE_FLEXS Descriptive flexfields
DESC FND_DESCRIPTIVE_FLEXS_TL Translation info about Descriptive flexfields
DESC FND_DESCR_FLEX_COLUMN_USAGES How table columns relate to flexfield
DESC FND_DESCR_FLEX_COL_USAGE_TL Translatable info on table columns to flexfield
DESC FND_DESCR_FLEX_CONTEXTS Descriptive flexfield contexts
DESC FND_DESCR_FLEX_CONTEXTS_TL Translatable info on Descriptive flexfield contexts

VSET FND_FLEX_HIERARCHIES Flexfield hierarchies info


VSET FND_FLEX_HIERARCHIES_TL Translatable info about flexfield hierarchies
VSET FND_FLEX_VALIDATION_EVENTS Info about special validated value sets
VSET FND_FLEX_VALIDATION_TABLES Info about Key and Descriptive validation tables
VSET FND_FLEX_VALUE_SETS Value set information
VSET FND_FLEX_VALUES Valid values for Key and Descriptive flexfields
VSET FND_FLEX_VALUES_TL Translatable info about valid values
VSET FND_FLEX_VALUE_HIERARCHIES Child value ranges for Key flexfield segments
VSET FND_FLEX_VALUE_NORM_HIERARCHY Multi-level value hierarchies for indep & dep sets
VSET FND_FLEX_VALUE_RULES Security rules
VSET FND_FLEX_VALUE_RULES_TL Translatable info about security rules
VSET FND_FLEX_VALUE_RULE_LINES Security rule lines
VSET FND_FLEX_VALUE_RULE_USAGES Assignment of security rules to responsibilities

WF FND_FLEX_WORKFLOW_PROCESSES Process used to generate combinations


WF WF_ITEM_TYPES Item transistioning through workflow
WF WF_ITEM_TYPES_TL Translatable info about item transistion

TEST FND_FLEX_TEST Flexfield testing information

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 6
Flexfield Forms

There are only 13 forms that are used to maintain Flexfields. The URL
listed is the link to the latest version of that form in ARU.

1. FNDFFIDF - Descriptive Flexfield Register


http://aru.us.oracle.com:8080/ARU/FileHistory/process_form?release=&file=FNDFFIDF.fmb&baseline=1

2. FNDFFIIF - Key Flexfield Register


http://aru.us.oracle.com:8080/ARU/FileHistory/process_form?release=&file=FNDFFIIF.fmb&baseline=1

3. FNDFFMCV - Key Flexfield Cross-validation Rules


http://aru.us.oracle.com:8080/ARU/FileHistory/process_form?release=&file=FNDFFMCV.fmb&baseline=1

4. FNDFFMDC - Descriptive Flexfield Segments


http://aru.us.oracle.com:8080/ARU/FileHistory/process_form?release=&file=FNDFFMDC.fmb&baseline=1

5. FNDFFMHL - Key Flexfield Hierarchies (Rollup Groups)


http://aru.us.oracle.com:8080/ARU/FileHistory/process_form?release=&file=FNDFFMHL.fmb&baseline=1

6. FNDFFMIS - Key Flexfield Segments


http://aru.us.oracle.com:8080/ARU/FileHistory/process_form?release=&file=FNDFFMIS.fmb&baseline=1

7. FNDFFMSA - Key Flexfield Aliases


http://aru.us.oracle.com:8080/ARU/FileHistory/process_form?release=&file=FNDFFMSA.fmb&baseline=1

8. FNDFFMSV - Value Set/KFF/DFF/Concurrent Programs


Values
http://aru.us.oracle.com:8080/ARU/FileHistory/process_form?release=&file=FNDFFMSV.fmb&baseline=1

9. FNDFFMVS - Value Set Define


http://aru.us.oracle.com:8080/ARU/FileHistory/process_form?release=&file=FNDFFMVS.fmb&baseline=1

10. FNDFFMWP - Key Flexfield Account Generator


http://aru.us.oracle.com:8080/ARU/FileHistory/process_form?release=&file=FNDFFMWP.fmb&baseline=1

11. FNDFFSRA - Security Rule Assign


http://aru.us.oracle.com:8080/ARU/FileHistory/process_form?release=&file=FNDFFSRA.fmb&baseline=1

12. FNDFFSRN - Security Rule Define


http://aru.us.oracle.com:8080/ARU/FileHistory/process_form?release=&file=FNDFFIDF.fmb&baseline=1

13. FNDFFTST - Flexfield Test


http://aru.us.oracle.com:8080/ARU/FileHistory/process_form?release=&file=FNDFFTST.fmb&baseline=1

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 7
To obtain this list of forms, do the following.

1. Log on to the Application, choosing the Application Developer


responsibility
2. Navigate to … Application -> Forms
3. Query on FORM field using the criteria … FNDFF% …

Why FNDFF%? All the forms developed and used to define and maintain
flexfields are designated with FNDFF as the starting characters.

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 8
Flexfield C Code

Header files are kept in $FND_TOP/include, and start with fdf*.h, with the
exception of fdfile.h. Source files are kept in $FND_TOP/src/flex, and are
named fdf*.*c.

Header Files

fdf.h Function specifications for most of the global Flex


functions.
fdffds.h Flexfield structure and macro definitions.
fdfapi.h Function specs, structures, and macros for the flexfield c
api.
fdffrm.h GUI Flexfield specific structures.
fdfgbl.h Flexfield global data structure (All cached information is
here)
fdfkba.h Flexbuilder function specs and structure definitions.
fdfkfu.h Specs of functions shared between fdfkfu.lc and fdfkfu2.lc
fdfwin.h Flexfield window function specs and structure definitons.
fdfwtk.h Toolkit Flexfield window function specs and structure
definitions.
fdfweb.h NCA Flexfield window function specs and structure
definitions
fdfwmsg.h Function specs and structure definitions for messages to
support the flexfield java window for NCA.
fdfwrt.h Web forms RT function specs, structure definitions and
macros.
fdffile.h File utility functions.
fdfwfld.h fdfwi* functions, field properties for use with a remote
client.
fdfstr.h String utility functions.
fdfobj.h Object utility functions.
fdflist.h A basic list.
fdfgli.h Application Foundation Flexfields GL Insert data
structures.
fdfdbg.h Flexfield debugging code to print structures.
fdfbtr.h Flexbuilder tracing and debugging functions.
fdfasrt.h Assert functionality.
fdffpp.h Flex preprocessor.

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 9
Key Flexfields

Filename Function Description


fdfkfu.lc Key flex user exits (POPID)
Key_flex() main entry for POP/VAL/LOAD-ID user
exits.
popid() Code for the POPID user exit.
[->fdfsff() -> fdfkff()]
fdfqpc() QuickPick. Build the select statement and
run the LOV for the combination level LOV.
fdfbqc() Builds a query condition from individual
segment values entered in ENTER-QUERY
mode. (This is the sun query that will be put
into CCID field)
fdfsha() Open and run the shorthand alias window.
fdfsgoe() Get field output expression.
fdfcat() Copy and re-Alias Table/Column clause.
fdfcac() Copy and re-Alias Table/Column clause.
fdfbqe() Build query expression.
fdfgcf() Get copy field values.
fdfpcf() Put copy field values.
fdfpdf() Put derived value into field.
fdfpad() Put all derived values into fields.
fdfpva() Put value attribute into field.
fdfpac() Put Additional Columns into fields.
fdfkgdfv() (Key) Get Direct entry Field Values (for kff).
fdfgnfv() (Key) Get New Field Values (for kff)
fdfkff() Key Form Flex.
fdfsff() Setup Fom Flex.
fdfwxv() Window Cross Validate function.
fdfqwxv() Window cross-validation for qbe
fdfkfu2.lc Key flex user exits (VALID, LOADID)
loadid() Code for the LOADID user exit.
valid() Code for the VALID user exit.
fdfkds.lc Key Flexfield Compiler
fdfrkf() Read main flexfield information [->fdfbkf()]
fdfbkf() gets main compiled definition [->fcfidget()], if

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 10
no compiled definition exists, reads data from
flex tables and builds compiled definition
[->fcfidcom()]
fdfrks() Read flexfield structure definition [->fdfbks()]
fdfbks() gets compiled struct definition [->fdficget()] , if
no compiled definition exists, reads data from
flex tables and builds compiled definition
[->fcfiscom()]
(See fdfcom.lc for fcfidget, fdfidcom, fdfisget,
fdfiscom)
fdfakf() Allocate Key Flex Read/Write Structure
fdffkf() Free Key Flex r/w structure
fdfkva.lc Key Flex Validation routines (Cross validation,
VRULE, etc.)
fdfvcc() Validate a code combination. Get it from
database [->fdfgcd()], do cross validation if
required [->fdfvxr()], do VRULE validation if
required [->fdfcvr()].
fdfvxr() Read cross validation rules [->fdfgxr()], and
validate against rules [->val_value()].
fdfgcd() Build and execute the select statement to get a
combination from the code combinations table
given either CCID, or segment values and
caches it.
fdficd() Do dynamic inserts. Lock the table, build the
insert statement and insert a new code
combination into the code combinations table.
fdfplv() Call server side procedure
FND_FLEX_PLSQL.VALIDATE for AT&T
special case validation. (Checks
FDFLEXVALIDATE env variable.)
fdfksr.lc Key Flexfield Server Validation Calls.
fdfksr() Cover function to call flex server side
validation.
fdfccs() Cover function to call flex server side security
check
(FND_FLEX_SERVER.SEGS_SECURED)
fdfgli.lc General Ledger Insertion routine. (This is

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 11
owned and maintained by the Government GL
team. Contact : Nancy Raabe, Manisha
Desai.)
fdfgli() General Ledger Insert routine
fdfglf() General Ledger Free routine

Descriptive Flexfields

fdfdfu.lc Descriptive flex user exits. (POPDESC,


VALDESC, LOADDESC)
desc_flex() main entry for POP/VAL/LOAD-DESC user
exits.
popdesc() Code for POPDESC user exit.
valdesc() Code for VALDESC user exit.
loaddesc() Code for LOADDESC user exit.
fdfwpc() Flex window post-change function for context.
fdfgdc() Get Descriptive flex context.
fdfdds.lc Descriptive Flexfield compiler.
fdfrdf() Read Descriptive flexfield information
[->fdfbdf()]
fdfbdf() Get compiled definition [->fcfdsget()], if not
read data from flex table and build compiled
definition [->fcfdscom()].
(See fdfcom.lc for fcfdsget(), and fcfdscom()).
setup_descr_vsets()
Set up vsets, and vset extensions.
fdfadf() Allocate Desc Flex Read/Write Structure
fdffdf() Free Desc Flex r/w structure.
fdfsdf.lc Called from popdesc, valdesc, and loaddesc
for SRS desc flexs. Sets display, insert,
update flags, default values and shared
parameter values.
fdssdf() Setup Descriptive flex for report set
fdsgsp() Get shared parameter values
fdsssp() Save shared parameter value
srs_df_free()
Free memory used by report set program
desc flexs

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 12
Range Flexfields

fdfrfu.lc Range flex user exits. (POPIDR, VALIDR,


LOADIDR)
range_flex() main entry for POP/VAL/LOAD-IDR user exits.
popidr() Code for POPIDR user exit.
validr() Code for VALIDR user exit.
loadidr() Code for LOADIDR user exit.
fdfsts() Setup type structures

Flexfield Window

fdfwin.lc Flex window specific routines


fdfwopn() Pop up the flex window.
fdfwed() Foundation Flexfields Window Editor.
fdfqpf() Foundation Flexfields QuickPick Field.
fdffva() Foundation Flexfields window Field Validate.
fdfwva() Foundation Flexfields Window Validate.
fdfwtk.lc Flex toolkit window specific routines
fdfwt*()
fdfweb.lc Flex Webforms window specific routines
fdfww*()
fdfwfld.lc Flex Webforms window Field structures.
fdfwi*()
fdfwmsg.lc Flex Webforms window messages
fdfwm*()
fdfwrt.lc Flex Webforms window RTs.
fdfrt*(), fdfwr*()

Common Utility Functions

fdffds.lc Key and Descriptive Flexfield data structure


functions.
fdfbco() Read columns from FND_COLUMNS table.
fdfasb() Allocate buffers to store value, id, and
description for segments.
fdfcsb() Clears the segment buffers.

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 13
fdfssr() Sets up segment references to parents,
children, default dependencies, High/Low
ranges etc.
fdfsvx() Setup value set extensions.
fdfimc() Install Free memory callback.
fdffre() Free allocated data structures.
fdfcvc() Free value caches.
fdffdm() Free Desc flex data.
fdffks() Free Key flex structure data.
fdffkm() Free Key flex data.
fdfffu.lc Form flex (10SC Flexfield) user exits
register_form_flex()
Code for the DEFINE_FFLEX user exit,
(Called from the DEFINE procedure in
packages FND_KEY_FLEX,
FND_DESCR_FLEX, and
FND_RANGE_FLEX in FNDSQF library)
Saves flex definition in forms in flex data
structures.
update_form_flex()
Updates form flex.
compile_form_flex()
Compiles the pseudo flex in the whole form.
update_fflex_args()
Code for the UPDATE_FFLEX user exit.
(Called from UPDATE_DEFINITON
procedures) Updates the flex definition.
event_form_flex()
Code for the FFLEX user exit. (Called from the
FND_FLEX.EVENT procedure). Handles the
various event logic.
find_descr_flex()
Finds all the Desc Flexs in a block. #FND
FIND_DFLEXS.
fdffrf() FounDation Flex FRee Form.
fdfdlist() Returns list of BLOCK.FIELDs in a form on
which Descriptive flexfields have been defined.
fdfdfind() Finds the Descriptive flexfield defined on the

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 14
given field.
fdffld.lc Key and Descriptive Flexfield field processing
(getting and putting values between flex
structures and form fields)
fdfgfv() Reads [->afugfv()] values from segment fields,
concatenated segment/description/id fields in
the forms and populates the segment buffers.
fdfpfv() Puts [->afupfv()] values from the segment
buffers to the segment fields and concatenated
segment/description/id fields.
fdfbqf() FounDation Flexfield Build Query for Field
fdfsfv() Scan flexfield field values
fdfcfv() Clear flexfield field values
fdfcaf() Clear all flexfield segment fields
fdfcff() Check if form field is database field

Validation Functions

fdffvs.lc Flexfield Value set routines.


fdfgit() Get Independent value set Table
fdfpux() Parse User-eXits.
fdfaus() Attach User-exitS - read from RDBMS if
needed
fdfpco() FounDation Flexfield Parse COlumn= clause
fdfats() Attach TableS - read from RDBMS if needed
fdfavs() Reads the value set information from the flex
value set tables to the flex value set data
structures.
fdfval.lc Flexfield Value Validation Routines
fdfvva() Validate values against a value set. Check
formats, min/max values, and get values from
database if required [->fdfrvd()->fdfgvd()]. If
Special/Pair validated execute user exit
[->fdfrux()->fdfxux()] Also checks for security
rules [->fdfvsr()].
fdfgvd() Read value/id/description from database for
table/Ind/Dep validated value sets.
fdfrux() Runs a user exit attached to a special/pair

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 15
validated value set.
fdfxux() FounDation Flexfields eXecute User-eXit
(build fakefields, etc)
fdfsux() FounDation Flexfield segment execute
user-exit
fdfahb() FounDation Flexfields allocate host binding
variable buffer.
fdfshb() FounDation Flexfields setup Segment based
host binding buffers
fdfavc() Flexfields Value Cache Allocation function
fdffvc() Flexfields Value Cache Free function
fdfrvc() Flexfields Read Value from Cache
fdfwvc() Flexfields Write Value to Cache
fdfgvd() Get value from database
fdfrvd() Read value from database
fdfvds() FounDation Flexfield Value Default Source
fdfsds() FounDation Flexfield Segments Default
Source
fdfgsr() FounDation Flexfield Get Security Rules
fdfvcmp() FounDation Flexfields Value CoMPare
fdfvcol() FounDation Flexfields Value COLumn
expression
fdfvsr() Read security rules [->fdfgxr()] and validate
values against security rules.
fdfvsd() Loads default values for segments. [->fdfgdf()]
and validates them.
fdfgdf() Compute the default value for a segment.
fdfvvr() FounDation Flexfield Validate Value against
vRules
fdfsva() FounDation Flexfields segment validation
fdfsvr() FounDation Flexfield Setup Value Rule
(VRULE)

Other Utilities

fdfutl.lc Flexfields Utility Routines


fdfpsv() Parse concatenated segment
values/ids/descriptions and load into segment

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 16
buffers.
fdfcsv() Reads values from segment buffers and
generates concatenated
values/ids/descriptions. Does delimiter
substitution when values have delimiter
character.
fdfphv() Parses sql strings for bind variables like
:$FLEX$, $PROFILES$, :BLOCK.FIELD etc.
fdfaqb() Flexfields Query Buffer Allocation function
fdffq1() Flexfields Query Buffer Free function (generic
function)
fdffqb() Flexfields Query Buffer Free function
fdfugv() Foundation Flexfields Utility Get Validation
type
fdfgst() Foundation Flexfield Get Segment attribute
Type number
fdfgvt() Foundation Flexfield Get Value aTtribute
number
fdfgvp() Foundation Flexfield Get Value attribute
Position
fdfpvv() Foundation Flexfield Parse Value attribute
Values
fdfgdv() Foundation Flexfield Get Derived Value
fdfufa() Foundation Flexfields Utility, interpret field
attributes
fdfdtj.lc Flexfields Date/Number Routines.
is_*_valueset_*()
Check value set format types.
fdfcon*() Canonical conversions.
fdfdtj() Converts dates to julian values.
fdfjtd() Converts julian values to dates.
fdfsin() Checks if a value is a number.
fdfisd() Checks if a value is a date.
fdfisndt() Checks if a value is a date in the
NLS_DATE_FORMAT.
fdfcondt() Converts dates between format masks.
fdfdtmask() Gets current NLS_DATE_FORMAT.
fdffile.lc Some basic file output functions for use with

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 17
debug code.
fdflist.lc A very basic list implementation.
fdfstr.lc A very basic implementation of StringBuffer.
fdfobj.lc Object utility functions.
fdfdbg.lc Flexfield debugging code to print structures.

FlexBuilder

fdffbu.lc Flexbuilder user exit.


fdfbtr.lc FB trace file functions.
fdfkba.lc FB functions.
fdfkbe.lc FB error messaging functions.
fdfkbp.lc Contains routines to fetch the data from
flexbuilder tables and populate the data
structures.
fdfkbr.lc Contains routines to build the flex code using
the populated data structures.
fdfkbt.lc FB test functions.

Flexfield C APIs

fdfapi.lc Flexfield API functions. (For documentation on


these APIs see the file $fnd/doc/flex/flexapi.txt)
fdfdfa() Descriptive flexfield APIs.
fdfkfa() Key Flexfield APIs.

Flexfield SRW User Exits

fdfsrw.lc SRW/Flexfields API functions, called from


Oracle Reports (For FLEXIDSQL and
FLEXIDVAL user exits in Reports)

Other User Exits

fdflop.lc Flexfield Hierarchy Loop Detector


(LOOPCHECK) Called from FNDFFMSV form.
fdfvsu.lc (1) Create Value attribute Values (POPVTV,
VALVTV),

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 18
(2) Create default Children
(CREATEDEFCLD),
(3) Validate value (FLEXVALIDATE)
POPVTV, VALVTV and CREATEDEFCLD are
called from FNDFFMSV form.
FLEXVALIDATE is called from FNDFFMSV,
FNDFFMVS, FNDFFMIS, and FNDFFMDC
forms.
fdfdvu.lc User exit to check to see if validation will
succeed or fail for a Descriptive flexfield.
(DESCVALID) This is called from the Conc.
Manager Forms.
fdftdu.lc Date translation - create hybrid of id and value
strings (TRANSLATE_DATE). Called from
FNDFFMCV.

Other Standalone Programs

Flexfield Compiler (fdfcmp)


fdfcmp.opc main() main function.
fdfcom.lc Compile Flex utility routines

Compile flexfield value Hierarchy (FNDFFCHY) (Called from FNDFFMSV


form)
fdfcvh.oc main() main function
fdfchy.lc Compile flexfield value hierarchy functions.

Flexfield View Generator (FNDFFVGN) (Called from FNDFFMIS and


FNDFFMDC forms)
fdfgfv.oc main() main function
fdfvgn.lc Flexfield view generator functions.

Flex PreProcessor (FDFLEXPP) (Obsolete. No longer used)


fdfpp.oc Flex preprocessor.
fdffpp.lc Flex preprocessor functions.
fdfppc.lc Flex preprocessor: Convert.
fdfpps.lc Flex preprocessor: Get segment information.
fdfspp.lc Single report flex preprocessor.

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 19
Cross Validation Rule Violation Report (FNDFFRXR)
fdfrxr.oc main() Reporting cross validation rule violation.
fdfgcx.lc Get code combination for cross validation
(similar to fdfgcd)

Flexfields Value Set Upgrade Utility (FNDFFUPG)


fdfupg.oc main() main function.
fdfupu.lc Flexfeild Upgrade Utilities.

Upgrade Flexbuilder functions into PLSQL functions. (FNDFBUPG,


FNDFBPLS)
fdfbup.oc main() main for FNDFBUPG.
fdfbcn.oc main() main for FNDFBPLS.
fdfbpl.lc FB->PL/SQL converter functions.

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 20
Flexfield PL/SQL Code

Flexfield PL/SQL files are stored in $FND_TOP/admin/sql, and are named


as follows:
AFFF*S.pls : Package Specs
AFFF*B.pls : Package Bodies

Table Handlers

Table handlers are generated (by $FND_TOP/bin/tltblgen). However


LOAD_ROW, and TRANSLATE_ROW procedures are coded manually,
and they are used by loader. If there is any data model change in
translated tables these packages should be regenerated and
LOAD_ROW, and TRANSLATE_ROW procedures should be added
manually.

Function Name Description


INSERT_ROW Inserts a row into base table, and multiple (as many
as number of 'B'ase, and 'I'nstalled languages in
FND_LANGUAGES table) rows into _TL table.
Returns ROWID from the base table.
LOCK_ROW Locks the row in base and the rows in _TL table.
UPDATE_ROW Updates the row in base table and the current
language row in _TL table.
DELETE_ROW Deletes the row from base table and the rows from
_TL table.
ADD_LANGUAGE Synchronizes base, _TL, and
FND_LANGUAGES tables. Deletes the extra rows
from _TL table, or inserts the missing rows into _TL
table.
load_row Resolves the internal primary keys by using
developer keys, and then tries to update the entity by
calling UPDATE_ROW, if the entity doesn't exist
then inserts it by calling INSERT_ROW.
translate_row Resolves the internal primary keys by using
developer keys, and then updates the current
language row in _TL table.

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 21
File Name Package Name Entity Table Names
AFFFDFFS.pls
AFFFDFFB.pls fnd_Descriptive_flexs_pkg Descript FF FND_DESCRIPTIVE_FLEXS
FND_DESCRIPTIVE_FLEXS_TL
FND_DESCRIPTIVE_FLEXS_VL
AFFFDFCS.pls
AFFFDFCB.pls fnd_descr_flex_contexts_pkg
DFF Context FND_DESCR_FLEX_CONTEXTS
FND_DESCR_FLEX_CONTEXTS_TL
FND_DESCR_FLEX_CONTEXTS_VL
AFFFDFSS.pls
AFFFDFSB.pls fnd_descr_flex_col_usage_pkg
DFF Segment FND_DESCR_FLEX_COLUMN_USAGES
FND_DESCR_FLEX_COL_USAGE_TL
FND_DESCR_FLEX_COL_USAGE_VL
AFFFSTRS.pls
AFFFSTRB.pls fnd_id_flex_structures_pkg KFF Structure FND_ID_FLEX_STRUCTURES
FND_ID_FLEX_STRUCTURES_TL
FND_ID_FLEX_STRUCTURES_VL
AFFFSEGS.pls
AFFFSEGB.pls fnd_id_flex_segments_pkg KFF Segment FND_ID_FLEX_SEGMENTS
FND_ID_FLEX_SEGMENTS_TL
FND_ID_FLEX_SEGMENTS_VL
AFFFVATS.pls
AFFFVATB.pls fnd_val_attribute_types_pkg KFF Seg Qual FND_VALUE_ATTRIBUTE_TYPES
FND_VAL_ATTRIBUTE_TYPES_TL
FND_VAL_ATTRIBUTE_TYPES_VL
AFFFVDRS.pls
AFFFVDRB.pls fnd_flex_vdation_rules_pkg KFF CV Rule FND_FLEX_VALIDATION_RULES
FND_FLEX_VDATION_RULES_TL
FND_FLEX_VDATION_RULES_VL
AFFFVLSS.pls
AFFFVLSB.pls fnd_flex_values_pkg Flex Value FND_FLEX_VALUES
FND_FLEX_VALUES_TL
FND_FLEX_VALUES_VL
AFFFVLRS.pls
AFFFVLRB.pls fnd_flex_value_rules_pkg Flex Value FND_FLEX_VALUE_RULES
Security Rule FND_FLEX_VALUE_RULES_TL
FND_FLEX_VALUE_RULES_VL
AFFFHIRS.pls
AFFFHIRB.pls fnd_flex_hierarchies_pkg Rollup Group FND_FLEX_HIERARCHIES
FND_FLEX_HIERARCHIES_TL
FND_FLEX_HIERARCHIES_VL

Setup Packages

File Name Pkg/Func Name Description


AFFFTYPS.pls
AFFFTYPB.pls fnd_flex_types Validates the lookup types used by
flexfields.
AFFFVAIS.pls

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 22
AFFFVAIB.pls fnd_flex_val_api Value set setup package.

AFFFDAIS.pls
AFFFDAIB.pls fnd_flex_dsc_api Descriptive flexfield setup package.

AFFFKAIS.pls
AFFFKAIB.pls fnd_flex_Key_api Key flexfield setup and query package.

Workflow/Flex Account Generator Packages

Flex WF activity functions are in fndffwk.wft.

File Name Package/Function Name Description


AFFFWFPS.pls
AFFFWFPB.pls fnd_flex_wf_processes Flex wf setup package.
add_workflow_item_type() Adds a new WF Item type to Flex structure.
delete_workflow_item_type() Deletes a new WF Item type to Flex structure.
change_workflow_process() Changes the assigned process.

AFFFWKFS.pls
AFFFWKFB.pls fnd_flex_workflow Main engine for account generator.
select_process() Returns the assigned process to a Flex Struct
and WF Item.
initialize() Initializes the workflow engine for account
generator.
generate() Generates the account.
generate_partial() Generates the partial account to be used in next
process.
load_concatenated_segments() This is a special procedure for loading values
returned by the flexbuilder upgrade plsql function
to the workflow process. This function should
ONLY be called for this case.
AFFFWKAS.pls
AFFFWKAB.pls fnd_flex_workflow_apis Workflow activity APIs.
start_generation Start Generating Code Combination
assign_to_segment Assign Value to Segment
get_value_from_combination Copy Segment Value from Code Combination
get_value_from_combination2 Copy Segment Value from other Structure Code
Combination
copy_from_combination Copy Values from Code Combination
copy_segment_from_combination Get Value from Code Combination
copy_segment_from_combination2 Get Value from other Structure Code Combination
is_combination_complete Is Code Combination Complete?
validate_combination Validate Code Combination
abort_generation Abort Generating Code Combination
end_generation End Generating Code Combination

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 23
Server Side Validation Packages

File Name Package/Function Name Description


AFFFKVLS.pls
AFFFKVLB.pls fnd_flex_keyval Key flexfield validation engine public
package internal development teams.
AFFFDVLS.pls
AFFFDVLB.pls fnd_flex_descval Descriptive flexfield validation engine
public package.
AFFFEXTS.pls
AFFFEXTB.pls fnd_flex_ext Key flexfield validation engine public
package for external users.
AFFFSSVS.pls
AFFFSSVB.pls fnd_flex_server Flexfield validation engine private
package.
AFFFSV1S.pls
AFFFSV1B.pls fnd_flex_server1 Flexfield validation engine utilities
(Global variables and misc utilities)
AFFFSV2S.pls
AFFFSV2B.pls fnd_flex_server2 Flexfield validation engine utilities
(mostly CVRs, and cached table
lookups)
AFFFSV3S.pls
AFFFSV3B.pls fnd_flex_trigger Trigger handlers for FlexField Server
Side Validation (for CVRs)
AFFFSV4S.pls
AFFFSV4B.pls fnd_flex_server4 Descriptive flexfield validation engine
(private)
AFFFPLVS.pls
AFFFPLVB.pls fnd_flex_plsql Additonal PL/SQL validation package.
(Called before a new combination is
inserted, if FDFLEXVALIDATE
environment variable is set to ON or
DEBUG.) By default this package
returns TRUE. Customers can add their
own logic to this package. We never
patch this package.
AFFFUTVS.pls
AFFFUTVB.pls fnd_flex_val_util Value validation routines, used by SSV,
and flex forms.

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 24
Query Packages

File Name Pkg/Func Name Description


AFFFDDUS.pls
AFFFDDUB.pls fnd_dflex Descriptive flex query package.

AFFFVDUS.pls
AFFFVDUB.pls fnd_vset Value set query package.

AFFFAPIS.pls
AFFFAPIB.pls fnd_flex_apis Key and Descriptive flexfield
query package used by forms
libraries.

Other packages

File Name Pkg/Func Name Description


AFFFLDRS.pls
AFFFLDRB.pls fnd_flex_loader_apis Flex loader package. See
Flex Loader web page.
AFFFCHYS.pls
AFFFCHYB.pls fnd_flex_hierarchy_compiler Flex value hierarchy compiler
used by FNDFFCHY program.
AFFFDGNS.pls
AFFFDGNB.pls fnd_flex_diagnose Flex diagnose package to find
and fix data integrity problems.
See check scripts.
AFFFUPUS.pls
AFFFUPUB.pls fnd_flex_upgrade_utilities Upgrade utilities. See
$FND_TOP/sql/afffupg1.sql
AFFFUPFS.pls
AFFFUPFB.pls fnd_flex_upd_fmt Convert dates in tables. (Should
be obsoleted.)
AFFFDTES.pls
AFFFDTEB.pls fnd_flex_date Convert date values from/to
date masks. (Should be
obsoleted)

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 25
Flexfield Java Files

The classes listed here are a portion of the full set of AOL classes, which
are all bundled together in the file fndaol.jar. Flex-related files that are
newly introduced or no longer being used for 11i releases are marked with
+11i or -11i, respectively.

Dir/Pkg File/Class Description


java/flex FlexTextField Standard AOL text field, with hooks for flex
validation and state management.
FlexWindow Main flexfield edit window. Standard AOL dialog
with flex layout and validation.
FlexWindowTest Standalone test module for FlexWindow class
(not released, so not in ARU) -11i
FlexWindowLogic Flex window's Server API, for speaking with
state management and validation code.
Segment Container class for each row in the flex window
(maps to a flexfield segment)
SegmentField Container class for each row/col pair in flex
window (maps to a flexfield segment field)
java/formsClient
FlexWindowMessenger Subclass of FormsMessenger, dedicated to
flex window client/server messages.
FormsMessenger Receives and dispatches messages from server;
composes and sends messages to server.
java/ui AOLDebug Rudimentary runtime debug/trace logging
support for AOL dialogs.
AOLDebugBox Popup dialog for enabling/disabling AOLDebug
tracing during runtime. +11i
AOLDebugFlag Debug/trace logging keyword, for controlling log
entries by category. +11i
AOLKey Common KeyEvent related support for AOL
dialogs.
AOLTrace Rudimentary runtime stack-trace generation and
extraction for runtime diagnostics. +11i
CommonDialog Base class for AOL dialogs, with content
management support, field-level navigation and
validation management hooks, and field/dialog
event handler support.
ComponentGrid A grid (table) container whose column widths
can vary, row by row.
ComponentGridLayout Custom layout manager for component grid
containers

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 26
FormButton A basic push button that runs within a
CommonDialog context.
FormCheckbox A basic checkbox that runs within a
CommonDialog context. +11i
FormattedTextArea A multi-line text box that runs within a
CommonDialog context.
FormattedTextField A single-line text box that runs within a
CommonDialog context.
IconButton A basic push button for use in iconic toolbars,
with support hooks for shortcut keys. -11i
KeyboardShortcut A simple implementation of shortcut keys
(needed before AWT support was provided).
ShortcutSource An interface implemented by any widget that
listens for shortcut keys.
TabHandler An interface for classes that can handle tab-Key
focus navigation within a dialog. +11i

Other Flexfield Components

ODF Files

You can find the ODF files in $FND_TOP/admin/odf/, and they are named
affl*.odf.

File Name Description


afflex.odf Flex value sets ODF file.
afflds.odf Descriptive flexfields ODF file.
afflky.odf Key flexfields ODF file.
afflbd.odf Flexbuilder ODF file.

DATA EXTRACT Files

You can find the Data Extract file in $FND_TOP/admin/import/, and they
are named affl*.*.

File Name Description


afflexa.ctl
afflexa.dat
afflexa.exp Flex value sets DATA EXTRACT files.
afflexa.log
afflexa.sum

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 27
affldsa.ctl
affldsa.dat
affldsa.exp Descriptive flexfields DATA EXTRACT files.
affldsa.log
affldsa.sum

afflkya.ctl
afflkya.dat
afflkya.exp Key flexfields DATA EXTRACT files.
afflkya.log
afflkya.sum

afflbda.ctl
afflbda.dat
afflbda.exp Flexbuilder DATA EXTRACT files.
afflbda.log
afflbda.sum

SQL Files

You can find the SQL Files in $FND_TOP/sql/, and they are named
afff*.sql.

File Name Description


afffcdff.sql
afffckff.sql
afffcvst.sql
afffcfb.sql Flexfields check scripts.

afffcvr1.sql
afffcvr2.sql Cross validation rule upgrade/fix scripts.

afffupg1.sql
afffupg2.sql Flexfields upgrade scripts.

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 28
These scripts should be OBSOLETED.
File Name Description
affldcm.sql Delete Compiled flexfields.
affldds.sql Delete a Descriptive flexfield definition from AOL tables
affldds2.sql Delete a Descriptive flexfield definition from AOL tables
affldky.sql Delete Key flexfield definition from AOL tables
affldky2.sql Delete Key flexfield definition from AOL tables
affldvs.sql Delete flexfield value set from AOL tables.
afflpdm.sql Flexfields Pre DataMerge, Delete Protected descriptive
flex data for all applications.

Other Files

File Name Location Description


FNDFFCVL.rdf $FND_TOP/reports/US Cross validation rules
report.
afffload.lct $FND_TOP/admin/import/
Flex loader configuration
file.

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 29
Summary

Summary
Summary

You
You should
should feel
feel comfortable
comfortable with
with the
the following
following
statements
statements about
about your
your knowledge
knowledge of of flexfields
flexfields ::
•• II can
can find
find the
the tables
tables that
that are
are part
part of
of Flexfields.
Flexfields.
•• II can
can find
find the
the forms
forms that
that are
are part
part of
of Flexfields.
Flexfields.
•• II can
can find
find the
the C
C code
code that
that makes
makes upup Flexfields.
Flexfields.
•• II can
can find
find the
the PL/SQL
PL/SQL code
code that
that makes
makes up
up
Flexfields.
Flexfields.
•• II can
can find
find the
the Java
Java code
code that
that makes
makes up
up Flexfields.
Flexfields.
•• II can
can find
find the
the remaining
remaining miscellaneous
miscellaneous pieces
pieces that
that
are
are part
part of
of Flexfields.
Flexfields.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 30
Practice Overview

Practice
Practice Overview
Overview

This
This practices
practices covers
covers the
the following:
following:
•• Skills
Skills practice
practice finding
finding tables,
tables, forms,
forms, C
C code,
code,
PL/SQL
PL/SQL code, Java code, and other pieces of
code, Java code, and other pieces of
Flexfields.
Flexfields.

Copyright  Oracle Corporation, 2000. All rights reserved.

1. Run the flexfield tables script

2. Find and examine the flexfield PL/SQL code.

3. What is the latest versions available of the following files?

A. AFFFKAIB.pls in file system? _______________

in database? _______________

B. FNDFFCVL.rdf? _______________

C. afflex.odf? _______________

D. fdfkfu.lc? _______________

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 31
4. How would you go about finding error messages related to
flexfields?

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

What range would you expect to find errors in?

______________________________________________________

Test it … did it work? __________

Repeat above 3 steps until it works.

5. How would you go about finding other database objects related to


flexfields?

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 32
Test it … did it work? __________

Repeat above 2 steps until it works.

Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 33
Copyright © Oracle Corporation, 2000. All rights reserved.

High-Level Design
Chapter 3 - Page 34
Flexfield Programs
Chapter 4

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 1
Flexfield Programs

Flexfield
Flexfield Programs
Programs

Copyright  Oracle Corporation, 2000. All rights reserved.

ILT Schedule: Timing Topic


120 minutes Lecture
60 minutes Practice
180 minutes Total

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson,
lesson, you
you should
should bebe able
able to:
to:
•• Define
Define and
and discuss
discuss the
the flexfield
flexfield memory
memory model
model
•• Define
Define and
and discuss
discuss the
the flexfield
flexfield client
client validation
validation
vs.
vs. server
server validation
validation model
model
•• Discuss
Discuss flexfield's
flexfield's programmatic
programmatic flowflow
•• Discuss
Discuss the
the flexfield
flexfield compiler
compiler
•• Discuss
Discuss the
the flexfield
flexfield view
view generator
generator
•• Discuss
Discuss the
the flexfield
flexfield hierarchy
hierarchy compiler
compiler

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 3
Flexfield Memory Model

Flexfield
Flexfield Memory
Memory Model
Model

Database
Database
Browser
Browser
Server
Server
(PC/Mac/etc.)
(PC/Mac/etc.)
(SERVER)
(SERVER)

Forms
Forms
Server
Server
(CLIENT)
(CLIENT)

Copyright  Oracle Corporation, 2000. All rights reserved.

Flexfields use a reserved memory model. This memory model is used to


store numerous pieces of flexfield data, including set-up tables, binder
definitions, compiled definitions, and LOVs. This memory model is
implemented on the Client layer.

To avoid confusion, let us be precise about client and server definitions.


In the 3-tier model currently used, these are the layers.

1. Browser
2. Forms Server (CLIENT)
3. Database Server (SERVER)

Note, the Browser layer, generally referred to as the client, is NOT the
client we are speaking of in discussion of the flexfield memory model. For
memory and validation purposes, the client is the forms server. Why?
Because the forms server is where the form is running, and the memory it
needs is maintained.

This is why many changes to flexfields require a responsibility change (or


re-logon) before those changes take effect. The cache that is the memory
is only reloaded on responsibility change (or start-up).

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 4
But, why do we implement such a memory model? Performance. The
memory model significantly increases the performance of flexfields with a
minimal price (flushing the cache on changes). Since flexfield changes
should be relatively infrequent if at all, the price is minimal.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 5
Flexfield Programming Concept

Flexfield
Flexfield Programming
Programming Concept
Concept

•• Client
Client validation
validation vs.
vs. Server
Server validation
validation
•• Flexfield's
Flexfield's programmatic
programmatic flow
flow

Copyright  Oracle Corporation, 2000. All rights reserved.

In addition to the memory, there is the issue of where validation is done.


Validation is only done for Key flexfields, but is critical to them. There are
2 validation engines for flexfields functionality.

1. Client Side: This is implemented in C. Runs on client side.


2. Server Side: This is implemented in PL/SQL. Runs on server side.

There are two possibilities that validation engine can be called.

1. By Flex itself. (i.e. when you use a key flexfield in a form, flex will
call validation engine to validate your combination.)
2. By Product Programs. (i.e. Both of the above validation engines
have public APIs and they can be called from product forms.)

There is a profile option called, Flexfield: Validation on Server. Here is


how that profile options controls validation behavior.

1. It is used to control behavior of Client Side Engine.


2. If it is set to 'No', Client Side Engine will just run normal, and do
everything on the client side by using C code.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 6
3. If it is set to 'Yes', Client Side Engine will call Server Side one, and
Server Side Engine will validate the combination.

Flex User Exits will always call Client Side Engine First, But depending on
above profile option Server Side Engine may be used. There are 5
possible paths.

Flex:Val Engine
Caller Engine Called on Ser. Used
Flex User Exit Client Yes Server
Flex User Exit Client No Client
Other Program Client Yes Server
Other Program Client No Client
Other Program Server <Unchecked> Server

Note: 'Flex User Exit' means:Flex POPID/VALID/LOADID user exits used


in Product forms by calling fnd_flex.event('TRIGGER-NAME') function.

Note: 'Other Program' means anything other then Flex User Exits. They
are written by Product Teams, and maintained by them. These can be
Concurrent programs, Server side PL/SQL programs. (for example,
invoice add program, year-end month-end financial programs etc...)

As a known fact, the PL/SQL Server Side Validation engine is much much
slower than Client Side C engine. Customers, depending on their network
performance, should select the Client Side engine. If they have very bad
network performance, suggest that they set the profile option Flexfield
:Validate on Server to 'Yes'. Why? The Client Side engine has to make
DB connection everytime it needs something from DB. If the customer’s
network performance is bad, this may take some time.

Then, starting in Release 11i, we add a significant new feature,


Autonomous Transactions. This feature is part of Oracle8i, and is used in
the Flexfields Server Side Validation Engine. If any of the following
packages is used to validate a non-existing combination, then this
combination will be created on the fly and the result will be committed to
database without affecting main transaction.

fnd_flex_ext
fnd_flex_keyval

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 7
Account Generator always calls server side validation engine, so all new
combinations generated by Account Generator will be committed to
database.

If Flexfields:Validate On Server profile option is set to 'Y' then Flex C code


will call SSV engine and if a combination is new it will be created. Flex C
code is both used by Key Flexfields window and some product team
concurrent programs. (Specifically they call fdfkfa() public C function to
validate a combination.) If this profile option is not set to 'Y', then old style
locking mechanism will be used and new combination will not be created
on the fly.

Maintenance Forms : These forms are defined on code combinations table


and they use 'FOR_INSERT' validate option in fnd_key_flex.define() call.
Since Form will make an insert when user makes a Save, Flex should not
create new combinations on the fly. So Autonomous Transactions feature
will not be used in
Maintenance Forms.

Note : If a new combination is validated when user types it for the first time
in Maintenance Form, then nothing will be locked, until user makes a
Save. Between first type-in and Save, some other user may create same
combination in a Foreign Key Form on the fly. In this case, Maintenance
Form user will get combination exists error, when he/she makes a Save.
So in any case Flex will not create same combination twice.

SQLGL/GL# (Accounting Flexfield) Specific Features : If a new


combination is created for SQLGL/GL# then Government GL specific
feature FDFGLI will be called to do extra validation and required updates
in GL tables. In this case those changes will also be committed to
database.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 8
Flexfield Flow

Here is what happens when a cursor is moved into a flexfield.

Descriptive Flexfield Key Flexfield Range Flexfield


Cursor enters field Cursor enters field Cursor enters field
POPDESC() POPID() POPIDR()
Enter data & commit Enter data & commit Enter data & commit
VALDESC() VALID() VALIDR()
If POST-QUERY If POST-QUERY, If POST- QUERY
Is done, is done, is done,
LOADDESC() LOADID() LOADIDR()

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 9
Flexfield's Programmatic Flow

Flexfield's
Flexfield's Programmatic
Programmatic Flow
Flow

key_flex( )

'P'
'P' 'L'
'L'
popid( ) argv[0][0]? loadid( )

1 'V'
'V' 3

valid( )

2
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 10
Flexfield's Programmatic Flow

Flexfield's
Flexfield's Programmatic
Programmatic Flow
Flow
popid( )
1
Process input arguments

Call fdfrks( ) to get the flexfield structure


(struct fflx_kstruct)

Check for database fields (fdfcff( )), query mode,


entered (fdfsfv( ))

Call fdfaqb( ) in query mode or fdfakf( ) otherwise


to get the segment buffers (struct fflx_sbufs)

Call fdfufa( ) to setup the segment


insert/update/display flags (struct fflx_sflg)

Process remaining input args


®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 11
Flexfield's Programmatic Flow

Flexfield's
Flexfield's Programmatic
Programmatic Flow
Flow
popid( ) continued
1
IF (entered)
{
Call fdfgfv( ) to load values from form fields to
segment buffers

Call fdfsva( ) to validate values (Check for


secured values).
}

Call fdfsha( ) to open shorthand window if


required

Call fdfgfc( ) to get values from COPY field if


Required

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 12
Flexfield's Programmatic Flow

Flexfield's
Flexfield's Programmatic
Programmatic Flow
Flow
popid( ) continued
1
IF (not entered)
{
Call fdfvsd( ) to load default values
}

Set up the flexfield window structure


(struct fflx_wids)

Call fdfwed( ) to open flexfield window

Check window direction after user closes window


(forward/back/abort/menu)

If in enter-query mode, call fdfbqc( ) to build


query conditions
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 13
Flexfield's Programmatic Flow

Flexfield's
Flexfield's Programmatic
Programmatic Flow
Flow
popid( ) continued
1
Call fdfpfv( ) to write values back to form fields

return

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 14
Flexfield's Programmatic Flow

Flexfield's
Flexfield's Programmatic
Programmatic Flow
Flow
valid( )
2
IF read_only return;

Process input arguments

Call fdfrks( ) to get the flexfield structure


(struct fflx_kstruct)

Check if entered (fsdsfv( ))

Call fdfakf( ) to get the segment buffers


(struct fflx_sbufs)

Call fdfufa( ) to setup the segment


insert/update/display flags (struct fflx_sflg)

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 15
Flexfield's Programmatic Flow

Flexfield's
Flexfield's Programmatic
Programmatic Flow
Flow
valid( ) continued
2
Process remaining input args

IF (entered)
{
Call fdfgfv( ) to load values from form fields to
segment buffers

Call fdfsva( ) to validate values (ignore expired,


disabled and secured).
}

IF (not entered)
{
Call fdfgfc( ) to get values from COPY field if req'd
}
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 16
Flexfield's Programmatic Flow

Flexfield's
Flexfield's Programmatic
Programmatic Flow
Flow
valid( ) continued
2
IF (not entered and flex is required)
{
Call fdfvsd( ) to load default values for required
segments only.
}

Check for missing required values and give error


if found.

Call fdfvcc( ) to check for cross-validation. This


also generates a ccid if exising combination.

If new combination, call fdficd( ) to insert


combination into the code combinations table

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 17
Flexfield's Programmatic Flow

Flexfield's
Flexfield's Programmatic
Programmatic Flow
Flow
valid( ) continued
2
Call fdfpfv( ) to write values back to form fields

return

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 18
Flexfield's Programmatic Flow

Flexfield's
Flexfield's Programmatic
Programmatic Flow
Flow
loadid( )
3
Process input arguments

Call fdfrks( ) to get flexfield structure


(struct fflx_kstruct)

IF FULL or FOR_INSERT mode, get ccid value


from form field

Call fdfaqb( ) to get query buffers and fdfakf( )


to get the segment buffers (struct fflx_sbufs)

Call fdfufa( ) to setup the segment


insert/update/display flags (struct fflx_sflg)

Process remaining input args


®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 19
Flexfield's Programmatic Flow

Flexfield's
Flexfield's Programmatic
Programmatic Flow
Flow
loadid( ) continued
3
IF not FULL mode, also call fdfgfv( ) to get
segment values from form fields

IF FULL mode, call fdflcc( ) to load code


combination from the code combinations table

Call fdfsva( ) to validate values


(Check for security)

Do additional checks for query by example.

Call fdfpfv( ) to write values back to form fields.

return

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 20
Flexfield Programs

Flexfield
Flexfield Programs
Programs

•• Flexfield
Flexfield Compiler
Compiler
•• Flexfield
Flexfield View
View Generator
Generator
•• Flexfield
Flexfield Hierarchy
Hierarchy Compiler
Compiler

Copyright  Oracle Corporation, 2000. All rights reserved.

Flexfield Compiler

Flexfield compilation is done in order to dramatically improve flexfield


performance. The compiled flexfield definitions are loaded into cache.

The flexfield compiler, fdfcmp, is called anytime the COMPILE button is


clicked for either a Descriptive or Key Flexfield. Additionally, the flexfield
compiler can be called from the command line as follows:

Syntax:

fdfcmp <concurrent program arguments> [<mode> [<mode


specific arguments>]]

Flexfield Compiler has 4 different modes:

Compile all flexfields.


fdfcmp <oracleid>/<passwd> 0 Y A

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 21
Compile a key flexfield structure.
fdfcmp <oracleid>/<passwd> 0 Y K <AppShortName>
<IdFlexCode> <IdFlexNum>
Compile a descriptive flexfield.
fdfcmp <oracleid>/<passwd> 0 Y D <AppShortName>
<DescFlexName>
Compile an SRS report descriptive flexfield.
fdfcmp <oracleid>/<passwd> 0 Y R <AppShortName>
<ReportName>

Note: 0 is the number zero, not the letter 'O'.

Description:

The flexfields compiler, fdfcmp, compiles key, descriptive, and report


parameter flexfields.

Arguments:

Argument Description Example


<oracleid>/<password> apps account name and password applsys/fnd
<ApplShortName> Short name of the application which SQLGL
owns the flexfield
<IdFlexCode> Internal Code of the key flexfield GL#
<IdFlexNum> Internal Structure Number of the key 101
flexfield structure
<DescFlexName> Internal Name of the descriptive FND_FLEX_TEST
flexfield
<ReportName> Report Name.

How to get these arguments:

<oracleid>/<passwd>: Please contact to your System Administrator to get


apps account name and password.

For other arguments, follow these steps.

Note: You will use Examine window to get some of the internal data. DO
NOT CHANGE ANYTHING IN EXAMINE WINDOW. IF YOU DO SO,
YOU WILL CORRUPT INTERNAL FLEX DATA. Please, let System
Administrators do these steps for you.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 22
For A mode:

You don't need any argument for this mode. fdfcmp will compile all
flexfields.

For K mode: (One key flexfield structure.)

1. Log in to Oracle Applications, and choose the Application


Developer responsibility.
2. Navigate to … Flexfield -> Key -> Segments.
3. Query the key flexfield that you want to compile.
4. Value in Application field is the application name of the owner
application.
5. Navigate to … Application -> Register … to get application
short name. This value will be used for <ApplShortName>
6. Repeat steps 2 and 3.
7. In the Structures section you should see all structures defined
for this key flexfield. Please click on one of them that you want
to compile.
8. From the menu … Do Help -> Tools -> Examine.
9. Select Block : STRUCT, Field : ID_FLEX_CODE. The value in
the Value field is the internal code for this key flexfield. This
value will be used for <IdFlexCode>.
10. Select Block : STRUCT, Field : ID_FLEX_NUM. The value in
the Value field is the internal number for this key flexfield
structure. This value will be used for <IdFlexNum>.
11. Now click on the Cancel button to close Examine window.
12. Close the form.
13. Exit from Oracle Applications.

Now you have all three arguments that is going to be used in fdfcmp call
for K mode.

For D mode:

1. Log in to Oracle Applications, and choose the Application


Developer responsibility.
2. Navigate to … Flexfield -> Descriptive -> Segments.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 23
3. Query the descriptive flexfield that you want to compile.
4. Value in Application field is the application name of the owner
application.
5. Navigate to … Application -> Register … to get application
short name. This value will be used for <ApplShortName>
6. Repeat steps 2 and 3.
7. From the menu … Do Help -> Tools -> Examine.
8. Select Block : TABLE, Field :
DESCRIPTIVE_FLEXFIELD_NAME.
The value in the Value field is the internal name for this
Descriptive flexfield. This value will be used for
<DescFlexName>.
9. Now click on the Cancel button to close Examine window.
10. Close the form.
11. Exit from Oracle Applications.

Now you have both of the arguments that is going to be used in fdfcmp
call for D mode.

For R mode:

Please provide report name for <ReportName> argument.

Examples:

Assume <oracleid>/<password> is apps/apps.

Compile all flexfields.


fdfcmp apps/apps 0 Y A

Compile 101 structure of 'Accounting Flexfield'. (Note: short name


for General Ledger is SQLGL.)
fdfcmp apps/apps 0 Y K 'SQLGL' 'GL#' 101

Compile 'Attachment context' descriptive flexfield. (Note: Application


Object Library is the owner application and it's short name is FND.)
fdfcmp apps/apps 0 Y D 'FND' 'ATCHMT_CONTEXT_FLEX'

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 24
Compile '$SRS$.FNDXYZ' descriptive flexfield.
fdfcmp apps/apps 0 Y D 'FND' '$SRS$.FNDXYZ'
fdfcmp apps/apps 0 Y R 'FND' 'FNDXYZ'

Both of these commands will compile $SRS$.FNDXYZ descriptive


flexfield. If you are using R mode, you don't need to provide $SRS$.
prefix. We concatenate $SRS$. prefix with the report name that you
provide.

Is there a quick way to get these arguments through SQL*Plus?

Following SQL statements will dump the fdfcmp command with correct
arguments. Save the output of these select statements to a file and use it
as a shell script.

Note: This method will compile flexfields one-by-one.

PLEASE ADD YOUR CONDITION TO THE END OF WHERE CLAUSE.


DO NOT CHANGE ANYTHING ELSE.

Note: <oracleid>/<password> is assumed to be apps/apps. You can


change it if your apps account login/passwd is different.

For Descriptive Flexfields:

SELECT 'fdfcmp apps/apps 0 Y D ''' ||


a.application_short_name ||''' '''||
d.descriptive_flexfield_name || ''''
FROM fnd_application a, fnd_descriptive_flexs_vl d
WHERE a.application_id = d.application_id
AND d.freeze_flex_definition_flag = 'Y'
<YOUR CONDITION>;

Examples:

<YOUR CONDITION> Effect


AND d.descriptive_flexfield_name = 'ATCHMT_CONTEXT_FLEX' will compile all descriptive
flexfields with name
'ATCHMT_CONTEXT_FLEX'.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 25
AND d.descriptive_flexfield_name LIKE '$SRS$.%' will compile all SRS flexfields.

AND d.title = 'Your Flexfield Title' will compile the DFF with
given title.

AND a.application_short_name = 'SQLGL' will compile all DFF's owned


by Oracle General Ledger.

AND a.application_short_name = 'FND' will compile all SRS flexfields


AND d.descriptive_flexfield_name LIKE '$SRS$.%' owned by Application Object
Library.

<Nothing> will compile all descriptive


flexfields.

For Key Flexfields:

SELECT 'fdfcmp apps/apps 0 Y K ''' ||


a.application_short_name ||''' '''||
k.id_flex_code || ''' ' ||
to_char(k.id_flex_num)
FROM fnd_application a, fnd_id_flex_structures_vl k
WHERE a.application_id = k.application_id
AND k.freeze_flex_definition_flag = 'Y'
<YOUR CONDITION>;

Examples:
<YOUR CONDITION> Effect
AND k.id_flex_code = 'GL#' will compile all KFF structures for 'GL#'
key flexfield which is Accounting
flexfield.

AND k.id_flex_code = 'GL#' will compile 101 structure of 'GL#' key


AND k.id_flex_num = 101 flexfield.

AND k.id_flex_code = 'GL#'


AND k.id_flex_structure_name' = 'Test Accounting Structure'
will compile ‘Test Accounting Structure’
named structure of 'GL#' flexfield.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 26
AND a.application_short_name = 'SQLGL'
will compile all structures of all key
flexfields owned by Oracle General
Ledger. (SQLGL)

<Nothing> will compile all structures of all key


flexfields.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 27
Flexfield View Generator

Flexfield views are generated to match your user column names to


SEGMENT/ATTRIBUTE names. This is done to greatly simplify ad hoc
reporting.

The flexfield view generator, FNDFFVGN, is called anytime you freeze


and compile a flexfield. Additionally, the flexfield view generator can be
called from the command line as follows:

Syntax:

FNDFFVGN <concurrent program arguments> [<mode> [<mode


specific arguments>]]

Flexfield View Generator has 3 different modes:

Generate Key Flexfield Structure View.


FNDFFVGN username/password 0 Y 1 <APPL ID>
<KEY FLEX CODE> <STRUCTURE NUMBER>
<STRUCTURE VIEW NAME>

Generate Key Flexfield Concatenated View.


FNDFFVGN username/password 0 Y 2 <APPL ID>
<KEY FLEX CODE> [<CONCAT VIEW NAME>]
[<SET USAGE FLAG>]
If concatenated view name is not given Flexfield View Generator will
use "_KFV" appended to the code combination table name.

Generate Descriptive Flexfield View.


FNDFFVGN username/password 0 Y 3 <APPL ID>
<DESCR FLEX NAME> [<DESC VIEW NAME>]
If descriptive view name is not given Flexfield View Generator will
use "_DFV" appended to the application table name.

Note:
0 is the number zero, not the letter 'O'.
If you set FDFVGNLOG environment variable to a file name,
Flexfield View Generator will dump the SQL statement to this

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 28
file.
Ex. : In UNIX c-shell : $>setenv FDFVGNLOG myfile.txt
FDFVGNLOG environment variable is obsoleted, see
bug847842. Flex will always dump the SQL statement to
concurrent program log file. (L<pid>.log)

Description:
The flexfields view generator, FNDFFVGN, generates key and descriptive
flexfield views.

Arguments:

Argument Description Example


username/password apps account name and password. apps/apps
<APPL ID> Id of the application which owns the 101
flexfield
<KEY FLEX CODE> Internal Code of the key flexfield. GL#
<STRUCTURE NUMBER> Internal Structure Number 101
of the key flexfield structure.
<DESCR FLEX NAME> Internal Name of the FND_FLEX_TEST
descriptive flexfield.
<STRUCTURE VIEW NAME> View name for the key flexfield TEST_
structure STRUCTURE_
VIEW
<CONCAT VIEW NAME> OPTIONAL. View name for the key GL_CODE_
flexfield. If concatenated view COMBINATIONS
name is not given Flexfield View _KFV
Generator will use "_KFV"
appended to the code combination
table name.
<SET USAGE FLAG> OPTIONAL. Default value is 'N'. It
must be set to 'Y' for these key
flexfields.
MSTK : 401/INV - System Items.
MTLL : 401/INV - Stock Locators
MICG : 401/INV - Item Catalogs
MDSP : 401/INV - Account Aliases
<DESC VIEW NAME> OPTIONAL. View name for the FND_FLEX_
descriptive flexfield. If descriptive TEST_DFV
view name is not given Flexfield
View Generator will use "_DFV"
appended to the application table
name.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 29
How to get these arguments:

username/password : Please contact to your System Administrator to get


apps account name and password.

For other arguments, follow these steps.

Note: You will use Examine window to get some of the internal data. DO
NOT CHANGE ANYTHING IN EXAMINE WINDOW. IF YOU DO SO,
YOU WILL CORRUPT INTERNAL FLEX DATA. Please, let System
Administrators do these steps for you.

For modes 1 and 2:

1. Log in to Oracle Applications, and choose the Application


Developer responsibility.
2. Navigate to … Flexfield -> Key -> Segments.
3. Query the key flexfield.
4. Value in Application field is the application name of the owner
application.
5. From the menu … Do Help -> Tools -> Examine.
6. Select Block : FLEX, Field : APPLICATION_ID. The value in the
Value field is the id of the owner application. This value will be
used for <APPL ID>.
7. Select Block : FLEX, Field : ID_FLEX_CODE. The value in the
Value field is the internal code for this key flexfield. This value
will be used for <KEY FLEX CODE>.
8. Select Block : FLEX, Field : APPLICATION_TABLE_NAME.
The value in the Value field is the code combination table of
this flexfield. You cannot use this value directly as
<CONCAT VIEW NAME> argument. You can append a proper
suffix and use it. Note: If concatenated view name is not given
Flexfield View Generator will use "_KFV" appended to the code
combination table name.
9. Click on the Cancel button to close Examine window.
10. In the Structures section you should see all structures defined
for this key flexfield. Please click on one of them that you want
to generate a view.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 30
11. From the menu … Do Help -> Tools -> Examine.
12. Select Block : STRUCT, Field : ID_FLEX_NUM. The value in
the Value field is the internal number for this key flexfield
structure. This value will be used for
<STRUCTURE NUMBER>.
13. Click on the Cancel button to close Examine window.
14. If there is a value in View Name field for this structure, you can
use it for <STRUCTURE VIEW NAME>, or you can use another
proper name.
15. Close the form and exit from Oracle Applications.

Now you have all arguments that is going to be used in FNDFFVGN call
either in mode 1 or mode 2.

For mode 3:

1. Log in to Oracle Applications, and choose the Application


Developer responsibility.
2. Navigate to … Flexfield -> Descriptive -> Segments.
3. Query the descriptive flexfield.
4. Value in Application field is the application name of the owner
application.
5. From the menu … Do Help -> Tools -> Examine.
6. Select Block : TABLE, Field : APPLICATION_ID. The value in
the Value field is the id of the owner application. This value will
be used for <APPL ID>.
7. Select Block : TABLE, Field :
DESCRIPTIVE_FLEXFIELD_NAME.
The value in the Value field is the internal name for this
descriptive flexfield. This value will be used for
<DESCR FLEX NAME>.
8. Select Block : TABLE, Field : APPLICATION_TABLE_NAME.
The value in the Value field is the base table of this descriptive
flexfield. You cannot use this value directly as <DESC VIEW
NAME> argument. You can append a proper suffix and use it.
Note : If descriptive view name is not given Flexfield View
Generator will use "_DFV" appended to the application table
name.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 31
9. Click on the Cancel button to close Examine window.
10. Close the form and exit from Oracle Applications.

Now you have the arguments that is going to be used in FNDFFVGN call
in mode 3.

Examples:

Assume username/password is apps/apps. Note: application id for


General Ledger is 101, and it is 0 for Application Object Library. Internal
code for ccounting Flexfield is 'GL#'.

Generate Structure View for Accounting Flexfield, structure 101.


FNDFFVGN apps/apps 0 Y 1 101 'GL#' 101
'ACCOUNTING_FLEXFIELD_VIEW'

Generate Concatenated View for Accounting Flexfield.


FNDFFVGN apps/apps 0 Y 2 101 'GL#'
'GL_CONCATENATED_VIEW'

Generate Descriptive Flexfield View for 'Attachment context'


descriptive flexfield.
FNDFFVGN apps/apps 0 Y 3 0 'ATCHMT_CONTEXT_FLEX'
'ATTACHMENT_VIEW'

Is there a quick way to get these arguments through SQL*Plus?

Following SQL statements will dump the FNDFFVGN command with


correct arguments. Save the output of these select statements to a file and
use it as a shell script.

Note: This method will generate flexfield views one-by-one.


<oracleid>/<password> is assumed to be apps/apps. You can
change it if your apps account login/passwd is different.

Mode 1 : For Key Flexfield Structures:

SELECT 'FNDFFVGN apps/apps 0 Y 1 ' ||


k.application_id || ' '''||
k.id_flex_code || ''' ' ||

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 32
k.id_flex_num || ' ''' ||
k.structure_view_name || '''' "FNDFFVGN-1 Command"
FROM fnd_id_flex_structures k
WHERE k.freeze_flex_definition_flag = 'Y'
AND k.structure_view_name IS NOT NULL;

Mode 2 : For Key Flexfields :

SELECT 'FNDFFVGN apps/apps 0 Y 2 ' ||


k.application_id || ' '''||
k.id_flex_code ||''' ''' ||
k.application_table_name || '_KFV'' ' ||
DECODE(k.application_id || '/' || k.id_flex_code,
'401/MSTK', '''Y''',
'401/MTLL', '''Y''',
'401/MICG', '''Y''',
'401/MDSP', '''Y''',
'''N''') "FNDFFVGN-2 Command"
FROM fnd_id_flexs k
WHERE EXISTS
(SELECT null
FROM fnd_id_flex_structures_vl kvl
WHERE kvl.application_id = k.application_id
AND kvl.id_flex_code = k.id_flex_code
AND kvl.freeze_flex_definition_flag = 'Y');

Mode 3 : For Descriptive Flexfields:

SELECT 'FNDFFVGN apps/apps 0 Y 3 ' ||


d.application_id ||' '''||
d.descriptive_flexfield_name || '''' "FNDFFVGN-3 Command"
FROM fnd_descriptive_flexs_vl d
WHERE d.freeze_flex_definition_flag = 'Y'
AND d.descriptive_flexfield_name NOT LIKE '$SRS$.%';

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 33
Flexfield Hierarchy Compiler

The Hierarchy Compiler is used only by the Accounting Flexfield, owned


by General Ledger. It allows value hierchies of parent to children or
parent to parents to be defined.

The Hierarchy Compiler is based on the values defined for a given value
sets. The compiler does have some rules and restrictions.

1. You can only use Independent or Table-validated value sets.


2. Values must be listed low to high.

Given that, not every change to values will require the Hierarchy Compiler
to re-run. There are 4 types of updates that will cause the Hierarchy
Compiler to be submitted.

1. You update a parent value row.


2. You remove the parent flag from a row.
3. You define a new hierarchy.
4. You move an existing hierarchy.

The Hierarchy Compiler IS NOT submitted when the changes only occur
to child values, including new child values.

The flexfield hierarchy compiler, FNDFFCHY, is called whenever any of


the above 4 conditions is met. Additionally, the flexfield hierarchy compiler
can be called from the command line as follows:

Syntax:

FNDFFCHY <concurrent program arguments> <val set id>

Compile value set hierarchy.


FNDFFCHY <oracleid>/<password> 0 Y <value set id>

Arguments:

Value Description Example


username/password apps account name and apps/apps
password

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 34
<VALUE SET ID> Flexfield Value Set Id. 1234

How to get these arguments:

username/password : Please contact to your System Administrator to get


apps account name and password.

For other arguments, follow these steps.

Note: You will use Examine window to get some of the internal data. DO
NOT CHANGE ANYTHING IN EXAMINE WINDOW. IF YOU DO SO, YOU
WILL CORRUPT INTERNAL FLEX DATA. Please, let System
Administrators do these steps for you.

1. Log in to Oracle Applications, and choose the Application


Developer responsibility.
2. Navigate to … Application -> Validation -> Set.
3. Query the value set.
4. Cursor should be in Name field.
5. From the menu … Do Help -> Tools -> Examine.
6. Select Block : SET, Field : FLEX_VALUE_SET_ID. The value in
the Value field is the id of the value set. This value will be used
for <VALUE SET ID>.
7. Click on the Cancel button to close Examine window.
8. Close the form.
9. Exit from Oracle Applications.

Now you have all arguments that is going to be used in FNDFFCHY call.

Examples:

Assume username/password is apps/apps.

Compile the hierarchy for value set id 1234.


FNDFFCHY apps/apps 0 Y 1234

Is there a quick way to get these arguments through SQL*Plus?

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 35
Following SQL statements will dump the FNDFFCHY command with
correct arguments. Save the output of these select statements to a file and
use it as a shell script.

Note: This method will compile value set hierarchies one-by-one.


<oracleid>/<password> is assumed to be apps/apps. You can
change it if your apps account login/passwd is different.

SELECT 'FNDFFCHY apps/apps 0 Y ' ||


v.flex_value_set_id "FNDFFCHY Command"
FROM fnd_flex_value_sets v
WHERE EXISTS
(SELECT null
FROM fnd_flex_value_norm_hierarchy h
WHERE h.flex_value_set_id = v.flex_value_set_id);

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 36
Summary

Summary
Summary

You
You should
should feel
feel comfortable
comfortable with
with the
the following
following
statements
statements about
about your
your knowledge
knowledge of of flexfields:
flexfields:
•• II can
can define
define and
and discuss
discuss the
the flexfield
flexfield memory
memory
model.
model.
•• II can
can define
define and
and discuss
discuss flexfield
flexfield client
client validation
validation
vs.
vs. server
server validation.
validation.
•• II can
can discuss
discuss flexfield's
flexfield's programmatic
programmatic flow.flow.
•• II can
can discuss
discuss the
the flexfield
flexfield compiler.
compiler.
•• II can
can discuss the flexfield view generator
discuss the flexfield view generator
•• II can
can discuss
discuss the
the flexfield
flexfield hierarchy
hierarchy compiler
compiler

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 37
Practice Overview

Practice
Practice Overview
Overview

This
This practice
practice covers
covers the
the following
following topics:
topics:
•• Skills
Skills building
building
•• Flexfield
Flexfield compiler
compiler
•• Flexfield
Flexfield view
view generator
generator

Copyright  Oracle Corporation, 2000. All rights reserved.

1. You get an error message that points to the flexfield module,


popid(). Which file is that kept in, and how would you go about
finding a solution?

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 38
2. You get an error message that points to the flexfield module,
valdesc(). Which file is that kept in, and how would you go about
finding a solution?

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

______________________________________________________

3. Run the flexfield compiler, from the command line, on a Key


Flexfield of your choice.

4. Run the flexfield compiler, from inside the Application, on a Key


Flexfield of your choice.

5. Run the flexfield view generator, from the command line, on a


Descriptive Flexfield of of your choice.

6. Run the flexfield compiler, from the command line, on a Range


Flexfield of your choice.

Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 39
Copyright © Oracle Corporation, 2000. All rights reserved.

Flexfield Programs
Chapter 4 - Page 40
Additional Topics
Chapter 5

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 1
Additional Topics

Additional
Additional Topics
Topics

Copyright  Oracle Corporation, 2000. All rights reserved.

ILT Schedule: Timing Topic


120 minutes Lecture
60 minutes Practice
180 minutes Total

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson,
lesson, you
you should
should be
be able
able to:
to:
•• Understand
Understand and
and discuss
discuss code
code combinations
combinations
•• Understand
Understand and
and discuss
discuss dynamic
dynamic insertion
insertion
•• Understand
Understand and
and discuss
discuss Account
Account Generator
Generator
•• Understand
Understand and
and discuss
discuss value
value set
set security
security
•• Understand
Understand and
and discuss
discuss shorthand
shorthand aliases
aliases
•• Understand
Understand and
and discuss
discuss cross-validation
cross-validation rules
rules
•• Understand
Understand and
and discuss
discuss flexfield
flexfield data
data loaders
loaders

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 3
Additional Topics

Additional
Additional Topics
Topics

•• Code
Code Combinations
Combinations
•• Dynamic
Dynamic Insertion
Insertion
•• Account
Account Generator
Generator
•• Value
Value Set
Set Security
Security
•• Shorthand
Shorthand Aliases
Aliases
•• Cross-validations
Cross-validations Rules
Rules
•• Flexfield
Flexfield Data
Data Loaders
Loaders

Copyright  Oracle Corporation, 2000. All rights reserved.

Code Combinations

A combination is a particular complete code, or combination of segment


values that makes up the code, that uniquely identifies an object. For
example, each part number would be a single combination, and if you had
ten parts you would define ten combinations. A valid combination is simply
a combination that may currently be used (that is, it is not out of date or
disabled).

Note that many of the Oracle Applications products (and their


documentation) do not necessarily refer to key flexfield combinations as
”combinations”. They may refer to combinations using the name of the
entity or the key flexfield itself. For example, Oracle Assets uses a key
flexfield called the ”Asset Key Flexfield” and refers to one of its
combinations as ”an asset key” or ”an asset key flexfield”. In another
example, Oracle General Ledger and other Oracle Applications products
generally use the term ”account” or ”GL account” to refer to combinations
of the Accounting Flexfield.

Each key flexfield has one corresponding table, known as the


combinations table, where the flexfield stores a list of the complete codes,
with one column for each segment of the code, together with the

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 4
corresponding unique ID number (a code combination ID number or
CCID) for that code. Then, other tables in the application have a column
that stores just the unique ID for the code. For example, if you have a part
number code, such as PAD–YEL–11x14, the ”Parts” combinations table
stores that code along with its ID, 57494. If your application allows you to
take orders for parts, you might then have an ”Orders” table that stores
orders for parts. That ”Orders” table would contain a single column that
contains the part ID, 57494, instead of several columns for the complete
code PAD–YEL–11x14.

Combinations are used only by key flexfields, and are created in one of 3
ways.

1. Through the key flexfield maintenance form (if this form exists
for this key flexfield).
2. Through dynamic insertion of new combinations (if possible).
3. Through generation and validation of new combinations through
the Account Generator.

Why create combinations?

1. Many forms reference multiple key flexfields. It would be


difficult, if not impossible, to store each of those key flexfield’s
data in that particular form’s table.

2. By storing only the code combination ID, you significantly


reduce storage requirements.

3. By storing only the code combination ID, you simplify and


improve data integrity (i.e., redundant data is not kept in
multiple places.)

Code combination IDs are generated from a sequence associated with the
combination table.

Additionally, here is a pair of scripts that you can use to list all of the tables
that have your Key Flexfield referenced in them.

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 5
Script 1: Determine the TABLE_ID of the combinations table

select table_name, table_id


from fnd_tables
where table_name like ‘<COMBINATION TABLE NAME>’;

Script 2: Using that TABLE_ID, list all the tables that contain code
combination id for that table, and list the name of the columns where that
code combination is kept.

select ft.table_name, fc.column_name


from fnd_tables ft, fnd_columns fc, fnd_foreign_keys ffk,
fnd_foreign_key_columns ffkc
where ffk.primary_key_table_id = <TABLE_ID#>
AND ft.table_id = ffk.table_id
AND ffk.foreign_key_id = ffkc.foreign_key_id
AND ffkc.column_id = fc.column_id
AND fc.column_name not like 'ATTRIBUTE%';

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 6
Dynamic Insertion

Generally there is only one, if any, maintenance form for a given key
flexfield. In some applications, there may not be a maintenance form. In
these cases, you would use dynamic inserts (or Account Generator) to
create new combinations.

In order for Dynamic Insertion to be possible, it must meet ALL of the


following criteria:

1. It must be feasible for the Key Flexfield (i.e., check the flexfield
registration)
2. It must be allowed for the Key Flexfield Structure (i.e., check
the segment info)
3. It must be called by the form (i.e., form must make a
DINSERT() call)

Starting with release 11.5 (i.e. Oracle 8i database) we are using


autonomous transaction feature to commit dynamic inserts without
affecting the main transaction. This replaces the need for the table or row-
level locking that had to be done in Release 10.7/11.0 to prevent
duplicates.

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 7
Account Generator

The Account Generator is the 3rd way in which combinations can be


inserted into a combinations table. The Account Generator uses Workflow
to automatically generate combinations, and is a replacement for the 10.7
Flexbuilder functionality. This automatic generation of combinations has
several distinct advantages.

1. It speed data entry.


2. It improves data accuracy.
3. It can be configured to meet the customer’s needs.
4. It provides much greater flexibility in its configurability than
Flexbuilder did.

There are some terms that are used in both Workflow and Account
Generator that you should be able to use.

Item Type: An item type represents a grouping of a particular set of


processes and components. Within an item type there can be up to six
types of components: Attributes, Processes, Notifications, Functions,
Messages, and Lookup Types. In an Account Generator, the most
relevant components are Attributes, Processes, and Functions.

Attribute: In general, an attribute is a feature of an item type. For an


Account Generator item type, these attributes include features of the
Accounting Flexfield structure. For example, one attribute stores the
structure number of the flexfield for which the combination is being built.
Other attributes may be input values to the Account Generator process.

Function: A function is a PL/SQL stored procedure which accepts


standard arguments and returns a completion result. For example, a
function can retrieve a value for a particular segment for a code
combination.

Process: A process is a set of activities in a specific relationship. In the


Account Generator, the process specifies the sequence of activities that
are performed to create a code combination. A process activity can be
part of a larger process, in which case it is called a sub–process. For
example, the Oracle Assets FA Account Generator item type could contain
a Generate Default Account process, which in turn contains three sub–
processes: Generate Book Level Accounts, Generate Category Level
Accounts, and Generate Asset Level Accounts.

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 8
Lookup Type: A lookup type is a static list of values. This list can be
referenced by activities and by item type, message or activity attributes.
For example, an activity can reference a lookup type for its possible result
values.

Notifications: A notification activity sends a message to a user or role.


The message may prompt for a response or may simply provide
information.

Messages: A message is what a notification activity sends to a role in a


workflow process. A message can prompt a user for a reply or an action to
take that determines what the next activity in the process should be. The
recipient of a workflow message is called the performer.

By default Account Generator workflow processes run in "synchronous"


mode. This means that no status information about the process is saved
to workflow tables, which dramatically improves performance. However,
there are several restrictions on processes that can be run synchronously.
Most notably, each process must run through to completion in a single
shot (no notifications or deferred activities, no background processing, and
only very limited blocking is allowed), and only one process can be active
at a time. A complete list of synchronous process restrictions can be
found below.

Another disadvantage of synchronous processes is that they are difficult to


debug, since no status information is saved.

Setting the "Account Generator:Debug Mode" profile to "Yes" causes


account generator processes to be run as normal workflow processes,
instead of running in synchronous mode. This has 3 effects:

1. Any errors caused by violations of synchronous processing


restrictions will be masked, because you are no longer running
in sychronous mode.
2. Performance will suffer, and workflow runtime tables will rapidly
become clogged with obsolete data. This is why it is not
recommended to run in Debug Mode in production.
3. Process status information is saved, meaning you can inspect
the results to debug your process using the Workflow Monitor,
status scripts, etc.

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 9
Debugging Steps:

1. Required Patches
Insure the latest synchronous processing patch has been applied.
Currently this is: bug 1116513. This patch includes substantial changes in
synch processing, and must be applied before any problems can be
investigated.

2. ACCOUNT_GENERATOR:DEBUG_MODE Profile
Is there an error or exception causing the calling form to rollback? If not,
you can use the ACCOUNT_GENERATOR:DEBUG_MODE profile to
inspect the results of your process.

a. Set the profile "Account Generator: Debug Mode" to "Yes".


b. Run your account generator process again, and commit the
result. It will now be run as a normal workflow process with a
unique key (returned as the result of fnd_flex_workflow.initialize
call).
c. Retrieve the process key. Depending on how the call to
fnd_flex_workflow was embedded in the calling form this key
may or may not be exposed. If it is not exposed, you may be
able to use the wf_monitor.find_instance web page to deduce
which process you just ran (see Workflow documentation for
details).
d. Armed with the process itemtype and key, you can inspect the
process results, using either
- Workflow Monitor web page
- $FND_TOP/sql/wfstat.sql status script
Either of these should show you exactly what happened in each
step of the workflow process, allowing you to locate the source
of the error. See the Oracle Workflow documentation for full
details on these.

3. Error Handling

Is there an error or exception causing the calling form to rollback? If yes,


ACCOUNT_GENERATOR:DEBUG_MODE will not work, but you can use
the the error messages to decipher where the error occurred.

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 10
a. Retrieve full details of the error from the flex error buffers.
You can make use of the Message Dictionary History feature to
make error details available in the "History" window without
overly frightening users with technical details. For example:

begin
id := fnd_flex_workflow.initialize(...);
wf_engine.SetItemAttrText(...);
if (not fnd_flex_workflow.generate
(..., error_message)) then
fnd_message.set_string(error_message);
fnd_message.set_name('PROD',
'MY_FRIENDLY_ERROR_MESSAGE');
fnd_message.history;
end if;
exception
when others then
fnd_message.set_string(
fnd_flex_workflow.get_message);
fnd_message.set_name('PROD',
'MY_FRIENDLY_ERROR_MESSAGE');
fnd_message.history;
end;

MY_FRIENDLY_ERROR_MESSAGE will be displayed directly in the


message window, with a "History" button that displays any other
messages left on the stack for debugging.

b. Trace the source of your error. If an exception was raised while


executing the workflow process, the error message retrieved
should include a stack trace. The trace goes through all the
internal details of workflow processing, but the top item on the
stack should give you an idea of which activity in the process is
causing the error. Some common errors and their causes:

Common Errors

WFENG_SYNCH_DISABLED: '&OPERATION' is not permitted in


synchronous processes.
- Your process attempted to perform one of the operations listed
below that are not allowed in synchronous mode.

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 11
WFENG_SYNCH_ITEM: Item '&ITEMTYPE/&ITEMKEY' cannot be
accessed while synchronous process in progress.
- A previous call to the Account Generator either did not complete
or errored out, and the error was ignored.

WFENG_ITEM_UNIQUE: Duplicate item '&TYPE/#SYNCH' could not be


created.
- A previous call to the Account Generator either did not complete
or errored out, and the error was ignored.

ORA-01086: savepoint 'do_execute' never established


- A function being called by the process contains a commit or
rollback. Commits and rollbacks are not allowed in any workflow
process.

4. Flex API Debugging Log

If all else fails, you can call the flex apis directly in sqlplus with debug
logging enabled. This produces a detailed log of every step taken by the
Account Generator (using dbms_out.put_line for output). Example:

set serveroutput on
exec dbms_output.enable(1000000);
begin
fnd_flex_workflow.debug_on;
id := fnd_flex_workflow.initialize(...);
wf_engine.SetItemAttrText(...);
if (not fnd_flex_workflow.generate(..., error_message))
then
dbms_output.put_line(error_message);
end if;
exception
when others then
dbms_output.put_line(fnd_flex_workflow.get_message);
end;

Forced Synchronous Processes

A workflow process is executed synchronously when it includes


consecutive function activities in a single thread that are not deferred to
the background engine. The Workflow Engine passes control back to the

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 12
calling application when it completes those activities and reaches a
notification, block, wait, deferred or end activity.

The Workflow Engine also supports a special class of synchronous


processes called forced synchronous processes. A forced synchronous
process completes in a single SQL session from start to finish and never
inserts into or updates any database tables. As a result, the execution
speed of a forced synchronous process is significantly faster than a typical
synchronous process.

There may be cases when your application requires a forced synchronous


process to generate a specific result quickly and recording an audit trail is
not a concern. For example, in Oracle Applications, several products
require Account Generator workflows to generate a meaningful flexfield
code derived from a series of concatenated segments pulled from various
tables. The Account Generator workflows are forced synchronous
processes that compute and pass back completed flexfield codes to the
calling applications instantaneously.

To create a forced synchronous process, you need to set the itemkey of


your process to #SYNCH or wf_engine.eng_synch, which returns the
#SYNCH constant when you call the necessary WF_ENGINE APIs. Since
a forced synchronous process never writes to the database, using a non-
unique itemkey such as #SYNCH is not an issue. Your process definition,
however, must adhere to the following set of restrictions:

1. No notification activities are allowed.


2. Limited blocking-type activities are allowed. A process can
block and restart with a call to WF_ENGINE.CompleteActivity
only if the blocking and restarting activities:
3. Occur in the same database session.
4. Contain no intervening calls to Oracle Workflow.
5. Contain no intervening commits.
6. No Error Processes can be assigned to the process or the
process' activities.
7. Each function activity behaves as if On Revisit is set to Loop,
and is run in non-cancelling mode, regardless of its actual On
Revisit setting. Loops are allowed in the process.
8. No Master/Detail coordination activities are allowed.
9. No parallel flows are allowed in the process, as transitions from
each activity must have a distinct result. This also means that
no <Any> transitions are allowed since they cause parallel flows.

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 13
10. None of the following Standard activities are allowed:
A. And
B. Block (restricted by the conditions stated in the Limited
Blocking bullet point above.)
C. Defer Thread
D. Wait
E. Continue Flow/Wait for Flow
F. Role Resolution
G. Voting
H. Compare Execution Time
I. Notify
11. No use of the background engine, that is, activities are never
deferred.
12. No data is ever written to the Oracle Workflow tables and as a
result:
A. The process cannot be viewed from the Workflow Monitor.
B. No auditing is available for the process.
13. Only the following WF_ENGINE API calls are allowed to be
made, and in all cases, the itemkey supplied to these APIs must
be specified as #SYNCH or wf_engine.eng_synch:
A. WF_ENGINE.CreateProcess
B. WF_ENGINE.StartProcess
C. WF_ENGINE.GetItemAttribute
D. WF_ENGINE.SetItemAttribute
E. WF_ENGINE.GetActivityAttribute
F. WF_ENGINE.CompleteActivity (for the limited usage of
blocking-type activities)
14. WF_ENGINE API calls for any item besides the item for the
current synchronous item are not allowed.

Attention: If you encounter an error from an forced synchronous process,


you should rerun the process with a unique item key in asynchronous
mode and check the error stack using the Workflow Monitor or the script
wfstat.sql. If the synchronous process completes successfully, the error
you encountered in the forced synchronous process is probably due to a
violation of one of the above listed restrictions.

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 14
Value Set Security

Flexfield value set security allows you to restrict the values accessible in a
given value set by responsibility. Value set security applies to any value
set. So, you can restrict values for descriptive and key flexfields, and you
can use it to restrict parameter values on reports and programs.

In order to implement or change value set security, you must take the
following steps:

1. You must define your security rule.


2. You must assign your security rule to a responsibility.
3. You must enable security on your value set.
4. You must enable security on the segment of the flexfield or
parameter where your value set is being used.
5. You must change responsibility or logout/logon to flush the
cache.

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 15
Shorthand Aliases

Shorthand aliases allow for quicker data entry and improved accuracy of
key flexfields.

You cannot enter invalid values into a single segment of a shorthand alias,
but the Shorthand Aliases window does not identify invalid combinations
of segment values in an alias. If you define aliases that contain values that
become invalid later, your flexfield detects these invalid values at the time
you use your alias in your flexfield window. Your flexfield then does not
allow you to enter the invalid values. Your flexfield also checks your alias
against your security and cross–validation rules when you use your alias
to enter data in your flexfield window.

Note that if the alias contains a value that you are restricted from using (by
flexfield value security), that value disappears immediately and you must
enter a different value in that segment. After you enter an alias that
represents a complete flexfield combination, the flexfield validates your
combination using the criteria you define in the Cross–Validation Rules
window.

If you change your key flexfield structure after you define your aliases, you
must change your existing aliases to match your new structure. Changes
that make your existing aliases invalid include:

1. changing the order of segments


2. adding a new segment
3. disabling a segment
4. changing segment lengths
5. changing the segment separator

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 16
Cross-Validation Rules

Cross-validation rules control the combinations of values you can create


when you enter values for key flexfields. Cross-validation is different from
segment validation, which controls the values you can enter for a
particular segment. You use cross–validation rules to prevent the creation
of combinations that should never exist.

Example 1: Your organization manufactures both computer equipment


and vehicles such as trucks, you might want to prevent the creation of
”hybrid” part numbers for objects such as ”truck keyboards” or ”CPU
headlights”.

Example 2: You decide that all revenue accounts must have a


department. Therefore, all your ”revenue” account values (such as all
values between 4000 and 5999) must have a corresponding department
value other than 000 (which means ”non–specific”).

Some items to remember about cross-validations rules are as follows:


1. Cross–validation rules have no effect on combinations that
already exist when you define your cross–validation rules.
2. If you change your key flexfield structure after you define your
aliases, you must change your existing aliases to match your
new structure. Changes that make your existing aliases invalid
include:
A. changing the order of segments
B. adding a new segment
C. disabling a segment
D. changing segment lengths
3. Each cross–validation rule contains one or more rule elements,
where each element is a key flexfield range that specifies low
and high values for each segment.
4. You identify a rule element as either Include or Exclude. Include
means include all values in the specified segment ranges, and
Exclude means exclude all values in the specified segment
ranges.
5. Every cross–validation rule must contain at least one Include
rule element. Exclude rule elements override Include rule
elements.
6. Combinations must pass all cross–validation rules.

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 17
7. Accomplish your control objectives primarily with include ranges
when you have a stricter structure for your key flexfield
structure. With include ranges, you list valid combinations
instead of invalid combinations.
8. Accomplish your control objectives primarily with exclude ranges
when your key flexfield structure is less structured and your key
flexfield segments do not have a lot of interdependencies. In this
situation, you generally want to accept most combinations. You
just want some exceptions to this general rule.
9. Blank segment values in your rules make the rules easier to
define and maintain. A blank segment value means you want to
include or exclude ”all the way to the end” of the range (either
minimum or maximum).
10. You should use several simple validation rules instead of using
one complex rule. Simple validation rules let you provide a more
specific error message and return your cursor to the most
appropriate key flexfield segment. Simple rules are also easier
to maintain over time.

A cross-validation rule creates its combinations by ensuring the validity of


those combinations. A combination is valid if and only if it satisfies at
least 1 include line … AND … and exactly 0 exclude lines. Satisfy means
that for each segment, the segment-low value ≤ segment value ≤
segment-high value. If segment-low value is null = -∞, and if segment-
high is null = +∞.

Examples:

Low High
Rule 1: Include _.5.6 9.7.8

Value = 3 . 6 . 7

Compare segment by segment. 3 is between -∞ and 9, YES. 6 is


between 5 and 7, YES. 7 is between 6 and 8, YES.

Result = Valid Combination

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 18
Low High
Rule 1: Include 6.3 8.5
Exclude 7.2 9.4

Value = 7 . 5

Compare segment by segment. 7 is between 6 and 8, YES. 5 is between


3 and 5, YES. Include rule satisfied. 7 is not between 7 and 9, NO. 5 is
not between 2 and 4, YES. Exclude rule is not satisfied. Overall, 1
include rule is satisfied, and no exclude rule is satisfied.

Result = Valid Combination

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 19
Flexfield Data Loaders

As of Release 11i, the Development Teams have been forced to change


their tactics for creating seed data. In the past, the Development Team
simply seeded their own tables with data. While OK for that Team, it could
possibly have created problems for other Teams. After all, the
Applications data is very interrelated.

So, beginning in Release 11i, the Development Teams must use the forms
to create seed data. While this removes data integrity problems, it does
create another issue. Do they have to use the forms to create seed data
in EVERY database? The answer is NO.

The process for creating/updating seed data is as follows:


1. Create the data in SEED database by using Flexfield forms.
2. Download the data from SEED database.
3. Create a patch to send this data to customer.

Flexfields Loader Configuration File:


$FND_TOP/patch/115/import/afffload.lct

Flexfield Entitites:

VALUE_SET : Flexfield Value Sets.

Includes table details of table validated value sets, and user exit details of
special/pair validated value sets. Does not include the values, security
rules, rollup groups, or value hierarchies for the value set. These entities
should be down/up loaded seperately.

KEY : FLEX_VALUE_SET_NAME

Usage Example :

>FNDLOAD apps/apps 0 Y DOWNLOAD


@FND:admin/import/afffload.lct out.ldt
VALUE_SET FLEX_VALUE_SET_NAME="Loader_Test"

>FNDLOAD apps/apps 0 Y UPLOAD


@FND:admin/import/afffload.lct out.ldt -

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 20
DESC_FLEX : Descriptive Flexfields.

Includes Context Column, Attribute Columns, Context, and Segment


details. References VALUE_SET for the value set used by Segment.

KEY : APPLICATION_SHORT_NAME,
DESCRIPTIVE_FLEXFIELD_NAME

Usage Example :

>FNDLOAD apps/apps 0 Y DOWNLOAD


@FND:admin/import/afffload.lct out.ldt
DESC_FLEX APPLICATION_SHORT_NAME="FND"
DESCRIPTIVE_FLEXFIELD_NAME="FND_FLEX_TEST"

>FNDLOAD apps/apps 0 Y UPLOAD


@FND:admin/import/afffload.lct out.ldt -

KEY_FLEX : Key Flexfields.

Includes Unique ID Columns, Structure Columns, Segment Columns,


Flexfield Qualifiers, Segment Qualifiers, Structures, Account Generator
Workflow Processes, Shorthand Aliases, Cross Validation Rules, Cross
Validation Rule Lines, Segments, Flex Qualifier Assignments, and
Segment Qualifier Assignments. References VALUE_SET for the value
set used by Segment.

KEY : APPLICATION_SHORT_NAME, ID_FLEX_CODE

Usage Example :

>FNDLOAD apps/apps 0 Y DOWNLOAD


@FND:admin/import/afffload.lct out.ldt
KEY_FLEX APPLICATION_SHORT_NAME="SQLGL"
ID_FLEX_CODE="GL#"

>FNDLOAD apps/apps 0 Y UPLOAD


@FND:admin/import/afffload.lct out.ldt -

VALUE_SECURITY_RULE : Flexfield Value Security Rules.

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 21
Includes Security Rules, Security Rule Lines, and Security Rule Usages.
References VALUE_SET.

KEY : FLEX_VALUE_SET_NAME, FLEX_VALUE_RULE_NAME,


PARENT_FLEX_VALUE_LOW

Usage Example :

>FNDLOAD apps/apps 0 Y DOWNLOAD


@FND:admin/import/afffload.lct out.ldt
VALUE_SECURITY_RULE FLEX_VALUE_SET_NAME="Loader_Test"
FLEX_VALUE_RULE_NAME="%"
PARENT_FLEX_VALUE_LOW="%"

>FNDLOAD apps/apps 0 Y UPLOAD


@FND:admin/import/afffload.lct out.ldt -

VALUE_ROLLUP_GROUP : Flexfields Value Hierarchies (Rollup


Groups).

KEY : FLEX_VALUE_SET_NAME, HIERARCHY_CODE

Usage Example :

>FNDLOAD apps/apps 0 Y DOWNLOAD


@FND:admin/import/afffload.lct out.ldt
VALUE_ROLLUP_GROUP FLEX_VALUE_SET_NAME="Loader_Test"
HIERARCHY_CODE="%"

>FNDLOAD apps/apps 0 Y UPLOAD


@FND:admin/import/afffload.lct out.ldt -

VALUE_SET_VALUE : Flexfields Values.

Includes Normalized Value Hierarchy, and Value Qualifier Value details.


References VALUE_SET for the value set. References
VALUE_ROLLUP_GROUP for the value hierarchy.

KEY : FLEX_VALUE_SET_NAME, PARENT_FLEX_VALUE_LOW,


FLEX_VALUE

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 22
Usage Example :

>FNDLOAD apps/apps 0 Y DOWNLOAD


@FND:admin/import/afffload.lct out.ldt
VALUE_SET_VALUE FLEX_VALUE_SET_NAME="Loader_Test"
PARENT_FLEX_VALUE_LOW="%"
FLEX_VALUE="%"

>FNDLOAD apps/apps 0 Y UPLOAD


@FND:admin/import/afffload.lct out.ldt -

The following shows the visual representation of the flexfield data


controlled and loaded by the Flexfield Data Loader.

# Entities -
#
# VALUE_SET -- Value set.
# | -- FND_FLEX_VALUE_SETS
# +--VSET_TABLE -- Table for 'F' value sets.
# | -- FND_FLEX_VALIDATION_TABLES
# +--VSET_EVENT -- User exit text for 'U/P' value sets.
# -- FND_FLEX_VALIDATION_EVENTS
#
# DESC_FLEX -- Descriptive Flexfield.
# | -- FND_DESCRIPTIVE_FLEXS
# | -- FND_DESCRIPTIVE_FLEXS_TL
# +--DFF_COLUMN -- Registered DFF Columns.
# | -- FND_COLUMNS
# +--DFF_REF_FIELD -- Context Reference Fields.
# | -- FND_DEFAULT_CONTEXT_FIELDS
# +--DFF_CONTEXT -- DFF Contexts.
# | -- FND_DESCR_FLEX_CONTEXS
# | -- FND_DESCR_FLEX_CONTEXS_TL
# +--DFF_SEGMENT -- DFF Segments.
# -- FND_DESCR_FLEX_COLUMN_USAGES
# -- FND_DESCR_FLEX_COL_USAGE_TL
#
# KEY_FLEX -- Key Flexfield.
# | -- FND_ID_FLEXS
# +--KFF_COLUMN -- Registered KFF Columns.
# | -- FND_COLUMNS
# +--KFF_FLEX_QUAL -- Flexfield Qualifiers.
# | | -- FND_SEGMENT_ATTRIBUTE_TYPES
# | +--KFF_SEGMENT_QUAL -- Segment Qualfiers.
# | -- FND_VALUE_ATTRIBUTE_TYPES
# | -- FND_VAL_ATTRIBUTE_TYPES_TL
# +--KFF_STRUCTURE -- Structures.
# | -- FND_ID_FLEX_STRUCTURES
# | -- FND_ID_FLEX_STRUCTURES_TL

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 23
# +--KFF_WF_PROCESS -- Account Generator Processes.
# | -- FND_FLEX_WORKFLOW_PROCESSES
# +--KFF_SH_ALIAS -- Shorthand Aliases.
# | -- FND_SHORTHAND_FLEX_ALIASES
# +--KFF_CVR_RULE -- Cross Validation Rules
# | | -- FND_FLEX_VALIDATION_RULES
# | | -- FND_FLEX_VDATION_RULES_TL
# | | -- FND_FLEX_VALIDATION_RULE_STATS
# | +--KFF_CVR_LINE -- Cross Validation Rule Lines
# | -- FND_FLEX_VALIDATION_RULE_LINES
# | -- FND_FLEX_INCLUDE_RULE_LINES
# | -- FND_FLEX_EXCLUDE_RULE_LINES
# | -- FND_FLEX_VALIDATION_RULE_STATS
# +--KFF_SEGMENT -- Segments.
# | -- FND_ID_FLEX_SEGMENTS
# | -- FND_ID_FLEX_SEGMENTS_TL
# +--KFF_FLEXQ_ASSIGN -- Flexfield Qualifier Assignments
# | -- FND_SEGMENT_ATTRIBUTE_VALUES
# | -- FND_FLEX_VALIDATION_QUALIFIERS
# +--KFF_SEGQ_ASSIGN -- Segment Qualifier Assignments (Value
# set dynamic attributes.)
# -- FND_FLEX_VALIDATION_QUALIFIERS
#
#
# VALUE_SECURITY_RULE -- Flexfield Value Security Rules
# | -- FND_FLEX_VALUE_RULES
# | -- FND_FLEX_VALUE_RULES_TL
# +--VSEC_LINE -- Flexfield Value Security Rule Lines.
# | -- FND_FLEX_VALUE_RULE_LINES
# +--VSEC_USAGE -- Security Rule Assignments to
# Responsibilities.
# -- FND_FLEX_VALUE_RULE_USAGES
#
#
# VALUE_ROLLUP_GROUP -- Flexfield Value Hierarchies. (Rollup
# Groups)
# -- FND_FLEX_HIERARCHIES
# -- FND_FLEX_HIERARCHIES_TL
#
#
# VALUE_SET_VALUE -- Flexfield Value.
# | -- FND_FLEX_VALUES
# | -- FND_FLEX_VALUES_TL
# +--VAL_NORM_HIERARCHY -- Flexfield Value Normalized
# | Hierarchies.
# | -- FND_FLEX_VALUE_NORM_HIERARCHY
# | -- FND_FLEX_VALUE_HIERARCHIES
# | (Populated by FNDFFCHY)
# +--VAL_QUAL_VALUE -- Compiled Value Attributes. (Dynamic
# Attributes)
# -- FND_FLEX_VALUES

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 24
Summary

Summary
Summary

You
You should
should feel
feel comfortable
comfortable with
with the
the following
following
statements
statements about
about your
your knowledge
knowledge of
of flexfields:
flexfields:
•• II understand
understand and
and can
can discuss
discuss code
code combinations.
combinations.
•• II understand
understand and
and can
can discuss
discuss dynamic
dynamic insertion.
insertion.
•• II understand
understand and
and can
can discuss
discuss Account
Account Generator.
Generator.
•• II understand
understand and
and can
can discuss
discuss value
value set
set security.
security.
•• II understand
understand and
and can
can discuss
discuss shorthand
shorthand aliases.
aliases.
•• II understand
understand and
and can
can discuss
discuss cross-validation
cross-validation
rules.
rules.
•• II understand
understand and
and can
can discuss
discuss flexfield
flexfield data
data
loaders.
loaders.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 25
Practice Overview

Practice
Practice Overview
Overview

This
This practice
practice covers
covers the
the following
following topics:
topics:
•• Skills
Skills practice
practice
•• Cross-validation
Cross-validation Rules
Rules
•• Code
Code Combinations
Combinations
•• Shorthand
Shorthand Aliases
Aliases

Copyright  Oracle Corporation, 2000. All rights reserved.

1. Cross-valid Rules
You have a 5 segment Accounting Flexfield. Defined as follows:

Segment 1: Company Length: 2


Segment 2: Group Length: 3
Segment 3: Account Length: 4
Segment 4: Sub-Acct Length: 4
Segment 5: Product Length: 3

What you want to do is create a cross-validation rule that applies


to your deposits. Deposits are noted in the Account segment,
and are in the range 2100 to 2299. If the customer enters a
deposit account, you require a value in the Product segment in
the range of 200 to 299.

You have created the following cross-validation rule.

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 26
LOW VALUE HIGH VALUE
Include 00.000.0000.0000.000 ZZ.ZZZ.ZZZZ.ZZZZ.ZZZ
Exclude 00.000.2100.0000.000 ZZ.ZZZ.2299.ZZZZ.199
Exclude 00.000.2100.0000.300 ZZ.ZZZ.2299.ZZZZ.ZZZ

You have a customer enter the following values.

Valid/Invalid

00.000.2100.0000.199 ________________

00.000.2100.0000.250 ________________

00.000.2100.0000.400 ________________

00.000.3000.0000.200 ________________

00.000.2299.0000.210 ________________

00.000.2299.0000.600 ________________

Note whether each value is valid or invalid.

2. Create a new key flexfield combination, of your choice, using


that key flexfield’s maintenance form. Describe what you did?

___________________________________________________

___________________________________________________

___________________________________________________

___________________________________________________

3. Cause a new key flexfield combination to be created, any


method, what is that flexfield’s code combination ID?

___________________________________________________

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 27
What table is its combinations table?

___________________________________________________

Look at the record that was created for that combination. How
did you do this?

___________________________________________________

___________________________________________________

___________________________________________________

___________________________________________________

___________________________________________________

4. Create and test 3 shorthand aliases. What aliases did you


create?

___________________________________________________

___________________________________________________

___________________________________________________

Where were the records for the aliases created?

___________________________________________________

Look at those records. How did you do it?

___________________________________________________

___________________________________________________

___________________________________________________

Copyright © Oracle Corporation, 2000. All rights reserved.

Additional Topics
Chapter 5 - Page 28
Custom Flexfields
Chapter 6

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 1
Custom Flexfields

Custom
Custom Flexfields
Flexfields

Copyright  Oracle Corporation, 2000. All rights reserved.

ILT Schedule: Timing Topic


30 minutes Lecture
150 minutes Practice
180 minutes Total

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson,
lesson, you
you should
should bebe able
able to:
to:
•• Define
Define aa Descriptive
Descriptive flexfield
flexfield in
in the
the database
database
•• Register
Register the
the Descriptive
Descriptive flexfield
flexfield in
in the
the Application
Application
•• Add
Add that
that Descriptive
Descriptive flexfield
flexfield to
to aa form
form
•• Define
Define aa Key
Key flexfield
flexfield in
in the
the database
database
•• Register
Register the
the Key
Key flexfield
flexfield in
in the
the Application
Application
•• Add
Add that
that Key
Key flexfield
flexfield to
to aa form
form
•• Add
Add aa Descriptive
Descriptive flexfield
flexfield to
to aa report
report
•• Add
Add aa Key
Key flexfield
flexfield to
to aa report
report

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 3
Overview

Overview
Overview

Important
Important links
links for
for this
this chapter
chapter
(base
(base URL:
URL: http://pkm.us.oracle.com/%7Egseiden/11idoc/)
http://pkm.us.oracle.com/%7Egseiden/11idoc/)
•• Oracle
Oracle Applications
Applications Developer's
Developer's Guide:
Guide:

… acrobat/115devg.pdf
acrobat/115devg.pdf
•• Oracle
Oracle Applications
Applications User
User Interface
Interface Standards:
Standards:

… acrobat/115uistan.pdf
acrobat/115uistan.pdf
•• Oracle
Oracle Applications
Applications Flexfield
Flexfield Guide:
Guide:

… acrobat/115flexug.pdf
acrobat/115flexug.pdf
•• Oracle
Oracle Workflow
Workflow Guide:
Guide:

… acrobat/115wfug.pdf
acrobat/115wfug.pdf
•• Oracle
Oracle Applications
Applications AOL
AOL Tech.
Tech. Reference
Reference Manual:
Manual:

… acrobat/aoltrm.pdf
acrobat/aoltrm.pdf
®

Copyright  Oracle Corporation, 2000. All rights reserved.

This lesson is about customizations. With little reservation, this is the


most difficult lesson of the course. However, it will bring your
understanding of flexfields to its logical and complete understanding.
While difficult, your investment in understanding these concepts will pay
huge dividends.

More importantly, this information can not stand independently. In order to


successfully complete the exercises listed in this chapter, you will need
the following resources.

1. Oracle Applications Developer’s Guide, Release 11i


http://pkm.us.oracle.com/%7Egseiden/11idoc/acrobat/115devg.pdf

2. Oracle Applications User Interface Stds for Forms-Based Prods


http://pkm.us.oracle.com/%7Egseiden/11idoc/acrobat/115uistan.pdf

3. Oracle Applications Flexfield Guide


http://pkm.us.oracle.com/%7Egseiden/11idoc/acrobat/115flexug.pdf

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 4
4. Oracle Workflow Guide
http://pkm.us.oracle.com/%7Egseiden/11idoc/acrobat/115wfug.pdf

5. Oracle Application Object Library/Workflow Tech Ref Manual


http://pkm.us.oracle.com/%7Egseiden/11idoc/acrobat/aoltrm.pdf

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 5
Customizing a Descriptive Flexfield

Customizing
Customizing a Descriptive
Descriptive Flexfield
Flexfield

•• Define
Define the
the Descriptive
Descriptive flexfield
flexfield in
in the
the database
database
•• Register
Register the
the Descriptive
Descriptive flexfield
flexfield in
in the
the Application
Application
•• Add
Add the
the Descriptive
Descriptive flexfield
flexfield to
to aa form
form

Copyright  Oracle Corporation, 2000. All rights reserved.

Define a Descriptive Flexfield in the Database

The first part of creating a new descriptive flexfield is to define that flexfield
to your database. The rules for doing this are as follows:

1. Pick/create a table where your descriptive flexfield will be stored.

2. The table name can not include the string “_SRS_”. This
naming scheme is reserved for the Standard Request
Submission feature.

3. Define a column for each descriptive segments, ATTRIBUTE1


… ATTRIBUTEn. The columns must be of type VARCHAR2,
length from 1 to 150, all columns having the same length, and
NULL allowed.

4. Define a structure defining column, ATTRIBUTE_CATEGORY


(suggested) (context column). It should be of type VARCHAR2,
length 30, and NULL allowed.

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 6
5. Ensure that you initially add enough segments to cover future
uses, since you can not add extra segments later. As a good
rule, pick twice as many columns as you think the users might
ever need.

6. Your table can have a maximum of 200 ATTRIBUTEn columns.

Register a Descriptive Flexfield in the Application

Registering your flexfield in the Application is a two-part process. Part


One involves registering the table you created that contains your
descriptive flexfield. Part Two involves registering your new descriptive
flexfield in the Application.

Step 1: Registering Your Descriptive Flexfield Table

(This process is documented in the Oracle Applications Developer’s


Guide, Release 11i, beginning on page 3-11.)

You register your custom tables using a PL/SQL routine in the AD_DD
package.

Here is a sample of the code you might use:

EXECUTE
ad_dd.register_table(‘APPL_SHORT_NAME’,’TABLE_NAME’,’TABLE
_TYPE’, NEXT_EXTENT’, PCT_FREE, PCT_USED);

EXECUTE
ad_dd.register_column(‘APPL_SHORT_NAME’,’TABLE_NAME’,’COLU
MN_NAME’,COLUMN_SEQUENCE, ‘COLUMN_TYPE’, COLUMN_WIDTH,
‘NULLABLE’, ‘TRANSLATE’, PRECISION, SCALE);

APPL_SHORT_NAME is the short name of the application which owns


your table.

TABLE_NAME is the name of your table in uppercase.

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 7
TABLE_TYPE is ‘T’ for Transaction Table. There are also ‘S’ types, but
those are used for “seed data” and only used by Oracle Applications.

NEXT_EXTENT is the size, in kilobytes. Do not include the ‘K’. Default is


512.

PCT_FREE is the percentage of space in each of the table’s block that is


reserved for future growth. Default is 10.

PCT_USED is the minimum percentage of used space in each data block


of the table. Default is 70.

COLUMN_NAME is the name of the column in uppercase.

COLUMN_SEQUENCE is the order in which the column appears in the


table definition.

COLUMN_TYPE is ‘NUMBER’, ’VARCHAR2’, ’DATE’, etc..

COLUMN_WIDTH is the column size. Use 9 for a DATE column and 38


for a NUMBER column (unless it has a specific width).

NULLABLE is ‘N’ or ‘Y’. Use ‘N’ if column is mandatory.

TRANSLATE is ‘N’ or ‘Y’. Use ‘Y’ is the column values will be translated.
Translated values are only used by Oracle Applications products.

PRECISION is the total number of digits in a number. Default is NULL.

SCALE is the number of digits to the right of the decimal point. Default is
NULL.

Step 2: Registering Your Flexfield in the Application

The steps for this are as follows:

1. Logon to Oracle Applications, and choose the Application


Developer responsibility.

2. Navigate to … Flexfield -> Descriptive -> Register

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 8
3. Fill out the form

4. Pick your Application from the list

5. Name is the name flexfield routines will use to call your


descriptive flexfield.

6. Title displays a unique title at the top of the Flexfield Window.

7. Pick the name of the table that contains your descriptive


flexfield.

8. Enter the name of the structure column in your table (e.g.,


ATTRIBUTE_CATEGORY).

9. Enter a default context prompt.

CLICK the REFERENCE FIELDS button where you can designate


possible reference fields.

CLICK on the COLUMNS button to enable table columns for your


descriptive flexfield. The form that opens here should have all of your
registered columns pre-populated in the form. If not, you must delete your
table’s registration, and re-register it into your Application. Columns with
names like ATTRIBUTE1 … ATTRIBUTEn are automatically enabled.
Other columns must be explicitly enabled.

Add a Descriptive Flexfield to a Form

Finally, to add a descriptive flexfield into your form, you must do the
following:

1. Create your hidden fields.


Your structure field and attribute fields must be text items on the
null canvas. They should be text items not display items, and
will use the TEXT_ITEM property class. Set the field query
lengths to 255.

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 9
While possible, it is not recommended that your form’s base
table is not the base table for your descriptive flexfield columns.

2. Create your displayed fields.

Create your concatenated segments field as a 2000 character


displayed, non-database text item. Use the
TEXT_ITEM_DESC_FLEX property class, and name the field
DESC_FLEX. You must attach the dummy LOV from the
TEMPLATE form, ENABLE_LIST_LAMP, to the field. Make
sure the “Validate from List” property is set to NO.

3. Create your flexfield definition.

Call a flexfield definition procedure from your


WHEN-NEW-FORM-INSTANCE trigger to set up your flexfield.
(See page 14-35 of the Oracle Applications Developer’s Guide,
Release 11i.)

You may also need to enable, disable, or modify your flexfield


definition depending upon conditions in the form. You should
call an UPDATE_DEFINITION procedure after calling the
appropriate DEFINE procedure. (See page 14-64 of the Oracle
Applications Developer’s Guide, Release 11i.)

4. Invoke your flexfield definition from trigger events

Call your flexfield from form level triggers using the


FND_FLEX.EVENT(EVENT) procedure from the following
events:

PRE-QUERY FND_FLEX.EVENT(‘PRE-QUERY’);
POST-QUERY FND_FLEX.EVENT(‘POST-QUERY’);
PRE-INSERT FND_FLEX.EVENT(‘PRE-INSERT’);
PRE-UPDATE FND_FLEX.EVENT(‘PRE-UPDATE’);
WHEN-VALIDATE-RECORD FND_FLEX.EVENT(‘WHEN-VALIDATE-RECORD’);
WHEN-NEW-ITEM-INSTANCE FND_FLEX.EVENT(‘WHEN-NEW-ITEM-INSTANCE’);
WHEN-VALIDATE-ITEM FND_FLEX.EVENT(‘WHEN-VALIDATE-ITEM’);

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 10
If you define any of these triggers at the block or field level, your
need to make sure the block or field level triggers have
execution style set to “Before”.

It is recommended that all the flexfield triggers be at the form


level. But, for large or complicate forms, you may code PRE-
QUERY, POST-QUERY, PRE-INSERY, PRE-UPDATE, and
WHEN-VALIDATE-RECORD at the block level on all blocks with
flexfields. You then code the WHEN-NEW-ITEM-INSTANCE
and WHEN-VALIDATE-ITEM at the item level for items on which
the flexfields are defined.

If you have a block or item level POST-QUERY trigger that


resets the query status of a record, you must set the execution
style to “After”.

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 11
Customizing a Key Flexfield

Customizing
Customizing aa Key
Key Flexfield
Flexfield

•• Define
Define the
the Key
Key flexfield
flexfield in
in the
the database
database
•• Register
Register the
the Key
Key flexfield
flexfield in
in the
the Application
Application
•• Add
Add the
the Key
Key flexfield
flexfield to
to aa form
form

Copyright  Oracle Corporation, 2000. All rights reserved.

Define a Key Flexfield in the Database

Creating key flexfields is a bit more complicated than creating descriptive


flexfields. First, it depends upon what type of form you are creating, a
Maintenance Form, a Form with a Foreign Key Reference, or a Form with
a Range Flexfield.

For each key flexfield, you must create a combinations table. You can
build a special form to allow combinations to be defined (a Maintenance
Form), or you can let Oracle Applications create sequences dynamically
for you. In addition to the combinations table, you may also have 1 or
more tables for forms with foreign key references or range flexfields.

The rules for key flexfield tables are as follows:

1. There is a maximum of 70 segment columns in a table.

2. You must define an ID column to unique identify a row of type


NUMBER, length 38, and NOT NULL. You should name this
column XXX_ID, where XXX is the name of your key flexfield

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 12
entity. Although it is a NUMBER(38) column, Oracle
Applications supports code combination IDs up to two billion.

3. Define a column for each key segment, SEGMENT1 to


SEGMENTn of type VARCHAR2, length 1 to 60, all columns the
same length, and NULL allowed.

4. While there is a maximum of 70 segments, you are also limited


to a maximum concatenated length of 2000 characters.

5. Define SUMMARY_FLAG and ENABLED_FLAG fields of type


VARCHAR2, length 1, and NOT NULL.

6. Define START_DATE_ACTIVE and END_DATE_ACTIVE fields


of type DATE, and NULL allowed.

7. Define a structure defining column to allow multiple structures of


type NUMBER, length 38, and NOT NULL. This column should
be named XXX_STRUCTURE_ID. While optional, this column
is highly recommended.

8. Define a unique index on the unique ID column.

9. Create an ORACLE sequence for your column with the same


grants and synonyms as your combinations table. Name your
sequence YOUR_TABLE_NAME_S.

10. Define the WHO columns, LAST_UPDATE_DATE (type DATE,


NOT NULL) and LAST_UPDATED_BY (type NUMBER, length
15, NOT NULL). All other WHO columns should have NULL
ALLOWED.

11. If you want dynamic insertion to be possible, you must not


include any mandatory application-specific columns in your
combinations table.

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 13
For Table with Foreign Key Reference

1. Define a column with the same name as the unique ID column


(step 2, above). It should be a type NUMBER, length 38, and
NULL or NOT NULL depending upon your needs.

2. If you have a structure column (step 7, above), you also need a


structure column in your foreign key table.

For Table with a Range Flexfield

1. Define SEGMENTn_LOW and SEGMENTn_HIGH columns.


One pair for each SEGMENTn column in your combinations
table.

2. If you have a structure column (step 7, above), you also need a


structure column in your foreign key table.

Register a Key Flexfield in the Application

Registering your key flexfield in the Application is a three-part process.


Part One involves registering the combinations table you created that
contains your key flexfield. Part Two involved registering the foreign key
reference or range flexfield table(s) you created. Part Three involves
registering your new key flexfield in the Application.

Step 1 and 2: Registering Your Key Flexfield CombinationsTable and


Your Foreign Key Reference

(This process is documented in the Oracle Applications Developer’s


Guide, Release 11i, beginning on page 3-11.)

You register your custom tables using a PL/SQL routine in the AD_DD
package.

Here is a sample of the code you might use:

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 14
EXECUTE
ad_dd.register_table(‘APPL_SHORT_NAME’,’TABLE_NAME’,’TABLE
_TYPE’, NEXT_EXTENT’,PCT_FREE,PCT_USED);

EXECUTE
ad_dd.register_column(‘APPL_SHORT_NAME’,’TABLE_NAME’,’COLU
MN_NAME’, COLUMN_SEQUENCE, ‘COLUMN_TYPE’, COLUMN_WIDTH,
‘NULLABLE’, ‘TRANSLATE’, PRECISION, SCALE);

APPL_SHORT_NAME is the short name of the application which owns


your table.

TABLE_NAME is the name of your table in uppercase.

TABLE_TYPE is ‘T’ for Transaction Table. There are also ‘S’ types, but
those are used for “seed data” and only used by Oracle Applications.

NEXT_EXTENT is the size, in kilobytes. Do not include the ‘K’. Default is


512.

PCT_FREE is the percentage of space in each of the table’s block that is


reserved for future growth. Default is 10.

PCT_USED is the minimum percentage of used space in each data block


of the table. Default is 70.

COLUMN_NAME is the name of the column in uppercase.

COLUMN_SEQUENCE is the order in which the column appears in the


table definition.

COLUMN_TYPE is ‘NUMBER’, ’VARCHAR2’, ’DATE’, etc..

COLUMN_WIDTH is the column size. Use 9 for a DATE column and 38


for a NUMBER column (unless it has a specific width).

NULLABLE is ‘N’ or ‘Y’. Use ‘N’ if column is mandatory.

TRANSLATE is ‘N’ or ‘Y’. Use ‘Y’ is the column values will be translated.
Translated values are only used by Oracle Applications products.

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 15
PRECISION is the total number of digits in a number. Default is NULL.

SCALE is the number of digits to the right of the decimal point. Default is
NULL.

Step 3: Registering Your Key Flexfield in the Application

The steps for this are as follows:

1. Logon to Oracle Applications, and choose the Application


Developer responsibility.

2. Navigate to … Flexfield -> Key -> Register

3. Fill out the form

4. Pick your Application from the list

5. Code is the short, unique code that invokes your flexfield from a
form trigger

6. Title displays a unique title at the top of the Flexfield Window.

7. Pick the name of the table that contains your key flexfield
combinations table.

8. Enter the name of the unique ID column.

9. Enter the name of the structure column in your table (e.g.,


ATTRIBUTE_CATEGORY).

10. Indicate whether dynamic inserts are feasible.

11. Indicate whether to allow value sets that use a hidden ID in your
flexfield.

CLICK on the COLUMNS button to enable table columns for your key
flexfield. The form that opens here should have all of your registered
columns pre-populated in the form. If not, you must delete your table’s

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 16
registration, and re-register it into your Application. Columns with names
like SEGMENT1 … SEGMENTn are automatically enabled. Other
columns must be explicitly enabled.

CLICK the QUALIFIERS button to define Flexfield and Segment


Qualifiers. (see page 14-74 in the Oracle Applications Developer’s Guide,
Release 11i for more information)

Add a Key Flexfield to a Form

Finally, to add a key flexfield into your form, you must do the following:

1. Create your hidden fields.

Your hidden ID, structure field and segment fields must be text
items on the null canvas. They should be text items not display
items, and will use the TEXT_ITEM property class. Set the field
query lengths to 255.

In some foreign key forms, you may need to create extra non-
atabase fields that represent the columns in your combinations
table. Put your SEGMENT1 to SEGMENTn fields on the null
canvas. These fields are used by dynamic insertion on the
chance that the concatenated field size is over 2000 characters.
If you do not do this, your key flexfield data may be truncated.
You should also create one set of these for each key flexfield.

2. Create your displayed fields.

Create your concatenated segments field as a 2000 character


displayed, non-database text item. Use the TEXT_ITEM
property class. For a range flexfield, create two non-database
fields with the same name with _LOW and _HIGH as suffixes.
You must attach the dummy LOV from the TEMPLATE form,
ENABLE_LIST_LAMP, to the field. Make sure the “Validate
from List” property is set to NO.

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 17
3. Create your flexfield definition.

Call a flexfield definition procedure from your WHEN-NEW-


FORM-INSTANCE trigger to set up your flexfield. (See page
14-30 of the Oracle Applications Developer’s Guide, Release
11i.)

You may also need to enable, disable, or modify your flexfield


definition depending upon conditions in the form. You should
call an UPDATE_DEFINITION procedure after calling the
appropriate DEFINE procedure. (See page 14-59 of the Oracle
Applications Developer’s Guide, Release 11i.)

4. Invoke your flexfield definition from trigger events

Call your flexfield from form level triggers using the


FND_FLEX.EVENT(EVENT) procedure:

PRE-QUERY FND_FLEX.EVENT(‘PRE-QUERY’);
POST-QUERY FND_FLEX.EVENT(‘POST-QUERY’);
PRE-INSERT FND_FLEX.EVENT(‘PRE-INSERT’);
PRE-UPDATE FND_FLEX.EVENT(‘PRE-UPDATE’);
WHEN-VALIDATE-RECORD FND_FLEX.EVENT(‘WHEN-VALIDATE-RECORD’);
WHEN-NEW-ITEM-INSTANCE FND_FLEX.EVENT(‘WHEN-NEW-ITEM-INSTANCE’);
WHEN-VALIDATE-ITEM FND_FLEX.EVENT(‘WHEN-VALIDATE-ITEM’);

If you define any of these triggers at the block or field level, your
need to make sure the block or field level triggers have
execution style set to “Before”. It is recommended that all the
flexfield triggers be at the form level. But, for large or complicate
forms, you may code PRE-QUERY, POST-QUERY, PRE-
NSERY, PRE-UPDATE, and WHEN-VALIDATE-RECORD at
the block level on all blocks with flexfields. You then code the
WHEN-NEW-ITEM-INSTANCE and WHEN-VALIDATE-ITEM at
the item level for items on which the flexfields are defined.

If you have a block or item level POST-QUERY trigger that


resets the query status of a record, you must set the execution
style to “After”.

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 18
Customizing a Flexfield on a Report

Customizing
Customizing aa Flexfield
Flexfield on
on aa Report
Report

•• Construction
Construction
•• Display
Display

Copyright  Oracle Corporation, 2000. All rights reserved.

Add a Flexfield to a Report

You use a two step method to report on flexfield values. The first step
creates the appropriate SQL statement dynamically based upon the user’s
flexfield. The output of the first step is used as input to the
second step. The second step formats this raw data for display.

Step 1 (Construction): The first step requires you to include one or more
lexical parameters (Oracle Reports variables that can be changed at
runtime) in your SQL statement. You call the user exit FND FLEXSQL with
different arguments to specify that part of the query you would like to build.
The user exit retrieves the appropriate column names (SQL fragment) and
inserts it into the lexical parameter at runtime before the SQL query is
executed. The query then returns site– and runtime–specific flexfield
information.

Step 2 (Display): The second step requires you to call another user exit,
FND FLEXIDVAL, on a ”post–record” basis. You create a new formula
column to contain the flexfield information and include the user exit call in
this column. This user exit determines the exact information required for
display and populates the column appropriately. By using the flexfield
routines the user exit can access any flexfield information. Use this step

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 19
for getting descriptions, prompts, or values. This step derives the flexfield
information from the already selected concatenated values and populates
the formula column on a row by row basis.

You call FND FLEXIDVAL once for each record of flexfield segments. The
flexfield user exits for Oracle Reports are similar to their Oracle
Application Object Library (using SQL*Forms) counterparts LOADID(R) or
LOADDESC and POPID(R) or POPDESC; one to construct or load the
values (FLEXSQL), the other to display them (FLEXIDVAL). The token
names and meanings are similar.

Basic Implementation Steps


1. Call FND SRWINIT from your Before Report Trigger
2. Call FND SRWEXIT from your After Report Trigger
3. Call FND FLEXSQL from the Before Report Trigger
4. Restrict report data based upon flexfield values
5. Order by flexfield columns
6. Display flexfield segment values, descriptions, and prompts

FND FLEXSQL
Call this user exit to create a SQL fragment usable by your report to tailor
your SELECT statement that retrieves flexfield values. This fragment
allows you to SELECT flexfield values or to create a WHERE, ORDER
BY, GROUP BY, or HAVING clause to limit or sort the flexfield values
returned by your SELECT statement. You call this user exit once for each
fragment you need for your select statement. You define all flexfield
columns in your report as type CHARACTER even though your table may
use NUMBER or DATE or some other datatype.

FND FLEXIDVAL
Call this user exit to populate fields for display. You pass the key flexfields
data retrieved by the query into this exit from the formula column. With this
exit you display values, descriptions and prompts by passing appropriate
token (any one of VALUE, DESCRIPTION, APROMPT or LPROMPT).

Oracle Reports and Flexfields Report–Writing Steps

These are the basic steps you use every time you write an Oracle Reports
report that accesses flexfields data.

1. Define your Before Report Trigger


2. Define your After Report Trigger

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 20
3. Define your required parameters
4. Define your other parameters
5. Call FND FLEXSQL from your Before Report Trigger to populate
P_FLEXDATA
6. Call FND FLEXSQL from your Before Report Trigger to populate
other parameters
7. Define your report query or queries
8. Create formula columns
9. Populate segment values formula column
10. Populate segment descriptions
11. Create your default report layout
12. Finish your report

For more information on creating reports containing flexfields, see Oracle


Applications Flexfields Guide, Release 11i, page 8-36.

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 21
Summary

Summary
Summary

You
You should
should feel
feel comfortable
comfortable with
with the
the following
following
statements
statements about
about your
your knowledge
knowledge of of flexfields:
flexfields:
•• II can
can define
define aa Descriptive
Descriptive flexfield
flexfield in
in the
the database.
database.
•• II can
can register
register aa Descriptive
Descriptive flexfield.
flexfield.
•• II can
can add
add aa Descriptive
Descriptive flexfield
flexfield to
to aa form.
form.
•• II can
can define
define aa Key
Key flexfield
flexfield in
in the
the database.
database.
•• II can
can register
register aa Key
Key flexfield.
flexfield.
•• II can
can add
add aa Key
Key flexfield
flexfield to
to aa form.
form.
•• II can
can add
add aa flexfield
flexfield to
to aa report.
report.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 22
Practice Overview

Practice
Practice Overview
Overview

This
This practice
practice covers
covers the
the following
following topics:
topics:
•• Skills
Skills practice
practice
•• Descriptive
Descriptive flexfields
flexfields
•• Key
Key flexfields
flexfields

Copyright  Oracle Corporation, 2000. All rights reserved.

Exercises:

1. Define a descriptive flexfield in the database.


2. Define a key flexfield in the database.
3. Register the descriptive flexfield, defined in Exercise 1, to the
Application.
4. Register the key flexfield, defined in Exercise 2, to the
Application.
5. Add the descriptive flexfield, defined and registered, to the form,
FLEXCLASS.fmb.
6. Add the key flexfield, defined and registered, to the form,
FLEXCLASS.fmb.
7. Add the descriptive flexfield, defined and registered, to the
report, FLEXCLASS.rdf.
8. Add the key flexfield, defined and registered, to the report,
FLEXCLASS.rdf.

Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 23
Copyright © Oracle Corporation, 2000. All rights reserved.

Custom Flexfields
Chapter 6 - Page 24
Appendix A
Chapter 7

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix A
Chapter 7 - Page 1
Appendix A

Appendix
Appendix A
A -- Useful
Useful Websites
Websites

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix A
Chapter 7 - Page 2
Links

Links
Links
•• Flexfield
Flexfield Development
Development Team:
Team:
http://www-apps.us.oracle.com/atg/flex/static/
http://www-apps.us.oracle.com/atg/flex/static/
•• Release
Release 11i
11i ATG
ATG Documentation:
Documentation:
http://pkm.us.oracle.com/%7Egseiden/11idoc/html/technology
http://pkm.us.oracle.com/%7Egseiden/11idoc/html/technology
set.html
set.html
•• Oracle
Oracle Applications
Applications Flexfields
Flexfields Guide:
Guide:
http://pkm.us.oracle.com/%7Egseiden/11idoc/acrobat/
http://pkm.us.oracle.com/%7Egseiden/11idoc/acrobat/
115flexug.pdf
115flexug.pdf
•• Oracle
Oracle Workflow
Workflow Guide:
Guide:
http://pkm.us.oracle.com/%7Egseiden/11idoc/acrobat/
http://pkm.us.oracle.com/%7Egseiden/11idoc/acrobat/
115wfug.pdf
115wfug.pdf
•• Oracle
Oracle Applications
Applications Developer's
Developer's Guide:
Guide:
http://pkm.us.oracle.com/%7Egseiden/11idoc/acrobat/
http://pkm.us.oracle.com/%7Egseiden/11idoc/acrobat/
115devg.pdf
115devg.pdf
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix A
Chapter 7 - Page 3
Links

Links
Links
•• Oracle
Oracle Applications
Applications User
User Interface
Interface Standards:
Standards:
http://pkm.us.oracle.com/%7Egseiden/11idoc/acrobat/
http://pkm.us.oracle.com/%7Egseiden/11idoc/acrobat/
115uistan.pdf
115uistan.pdf
•• Customizing
Customizing and
and Extending
Extending Oracle
Oracle Applications:
Applications:
http://www-apps.us.oracle.com/atg/standards/codestan.html
http://www-apps.us.oracle.com/atg/standards/codestan.html
•• Sara
Sara Woodhull's
Woodhull's Page:
Page:
http://www-apps.us.oracle.com/~swoodhul/
http://www-apps.us.oracle.com/~swoodhul/
•• User
User Interface
Interface Standards
Standards Team:
Team:
http://www-apps.us.oracle.com/atg/standards/uistan.html
http://www-apps.us.oracle.com/atg/standards/uistan.html

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix A
Chapter 7 - Page 4
Appendix B
Chapter 8

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix B
Chapter 8 - Page 1
Appendix B

Appendix
Appendix B
B -- Useful
Useful Scripts
Scripts

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix B
Chapter 8 - Page 2
Scripts Library

Scripts
Scripts Library
Library

•• Scripts
Scripts Library:
Library:
http://atgorl.us.oracle.com/wsawyer/Oracle_Scripts/
http://atgorl.us.oracle.com/wsawyer/Oracle_Scripts/

Copyright  Oracle Corporation, 2000. All rights reserved.

Scripts

There are all kinds of scripts that you can use to probe, explore, diagnose,
and tinker with Oracle, both the Database and Applications. Currently,
these scripts are available at the following URL:

http://atg.us.oracle.com/wsawyer/Oracle_Scripts/

Currently, these scripts have only been staged for your use. There is no
web page listing them. At this point, we are simply making them available.
In the future, a web page describing them may be available.

Why no web page? Well, one, it takes a lot of work to create one. Two,
you are learning advanced diagnostic skills. Part of those skills is learning
to take scripts, and discover what they do. These scripts are all good.
They will help. So, you are already ahead of the curve. You know that
each one of these scripts was written for a reason. It is your job to figure
out the why and what. Good luck.

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix B
Chapter 8 - Page 3
Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix B
Chapter 8 - Page 4
Appendix C
Chapter 9

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix C
Chapter 9 - Page 1
Appendix C

Appendix
Appendix C
C -- Useful
Useful WebIV
WebIV Entries
Entries

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix C
Chapter 9 - Page 2
WebIV

WebIV
WebIV

•• WebIV
WebIV Sites:
Sites:
http://webiv.us.oracle.com/
http://webiv.us.oracle.com/
http://webiv.uk.oracle.com/
http://webiv.uk.oracle.com/
http://webiv.au.oracle.com/
http://webiv.au.oracle.com/

Copyright  Oracle Corporation, 2000. All rights reserved.

WebIV Entries

There are numerous WebIV entries concerning flexfields. You may find
some of the following helpful.

Article Status Title


Note.69060.1 Lim/Pub fdfcmp Gets APP-1564: Oracle Error
1008 In FDFAVS
Note.1010891.6 Ext/Pub How To Determine Which Modules Use
A Desc FF?
Note.1044093.6 Ext/Pub APP-0981 Oracle Error 20000 In
BEGIN_AD_DDL.DO_DDL
Note.1066455.6 Ext/Pub FNDFFMIS Defined Values But Not
Showing Up In Quickpick
Note.1069797.6 Ext/Pub DFF: Distinct Clause Does Not Work In
Validation
Note.1075175.6 Ext/Pub How To Identify Descr FFs Name From
SQLPlus
Note.94225.1 Ext/Pub Can the Table name of an existing

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix C
Chapter 9 - Page 3
Table value set in use be changed?
Note.104536.1 Int/R.R Trouble Shooting FFs
Note.111979.1 Ext/R.R APP-00668 APP-00874 APP-00992
Compiling Key FF 11I

NOTE: Caution must be used in referring to WebIV for flexfield issues.


The sad truth is that upon inspection many, if not most, of the articles were
in error, out of date, or both. Of the remaining articles, many were nothing
more than instructions to apply certain patches. While technically
accurate at the time, articles of this type have short shelf lifes in terms of
their accuracy. Examine the article closely, and compare it to what is
shared in this course. Where there are differences, I’d strongly suggest
trusting this course. However, you should err on the side of conservation,
trust neither, prove both.

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix C
Chapter 9 - Page 4
Appendix D
Chapter 10

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 1
Appendix D

Appendix
Appendix D - Collected
Collected Emails
Emails

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 2
Email List

Email
Email List
List

•• FLEXREP
FLEXREP is
is the
the email
email list
list for
for asking
asking questions
questions
concerning
concerning flexfields.
flexfields.
•• INFOAOL
INFOAOL is
is the
the email
email list
list for
for asking
asking questions
questions
about
about ATG
ATG issues.
issues.

Copyright  Oracle Corporation, 2000. All rights reserved.

Collected Emails

The Flexfield Development Team monitors an email ID called, FLEXREP.


If you have a question or suggestion, you can send questions there.

What follows is a collection of FLEXREP emails that may prove helpful.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
KEY FLEXFIELDS

QUESTION:

I am trying to validate a CCID on the server side and seem to come


across the following problem. If I disable the entire CCID in GL the
fnd_flex_keyval.validate_ccid does not seem to catch this. On the form it
does not let me enter this value in the flex field. It comes up the error ‘This
combination is disabled’.

I am using fnd_flex_keyval.validate_ccid on the server in this manner:

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 3
If (( fnd_flex_keyval.validate_ccid(
APPL_SHORT_NAME =>’SQLGL’,
KEY_FLEX_CODE => ‘GL#’,
STRUCTURE_NUMBER =>p_chart_of_accounts_id,
COMBINATION_ID =>p_ccid,
DISPLAYABLE => ‘ALL’,
DATA_SET => NULL,
VRULE => NULL,
SECURITY => ‘ENFORCE’,
GET_COLUMNS => NULL,
RESP_APPL_ID => FND_GLOBAL.resp_appl_id,
RESP_ID => FND_GLOBAL.resp_id,
USER_ID => FND_GLOBAL.user_id))) then

If ( NOT( fnd_flex_keyval.is_valid ) OR
( fnd_flex_keyval.is_secured) )
then
return(FALSE);
else
return(TRUE);
end if;
Else
return(FALSE);
End if;

Could anyone point out what I could be doing wrong in using this function
or if there is any other way in which I could trap this error on the server
side?

ANSWER:

The fnd_flex_keyval.validate_ccid() function does not check whether a


combination is disabled or expired. It only checks if it exists. This function
is the same as “LOADID”. When you query an existing combination it
should be seen even if it has been disabled or is expired.

If you need to check those properties you can select the enabled flag from
the combinations table directly (by CCID) after validate_ccid() has
completed.

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 4
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
KEY FLEXFIELDS

QUESTION:

One of our customers need the ability to do QBE on individual segments


of a key flexfield (on a form where its a foreign key. ie. i am not talking
about the combinations form). I found some documentation at www-
apps.us.oracle.com/doclib/16.1/comus/us/index.htm that said that QBE is
possible on individual segments but it wasn’t clear whether it was talking
about a foreign key form or the combinations form. Anyway, in order to
have QBE working this way is it a simple matter of placing SEGMENT1...N
columns in the block as DB fields after including them in the base view?
Or any other suggestion?

ANSWER:

QBE is supported for flexfields on both foreign key forms and combination
forms. WIth foreign key forms you don’t need the SEGMENTn columns in
your forms. After you enter the query conditions for the flexfield in ENTER-
QUERY mode, flex will create a sub-query and place it in the code
combination id field in your form. As documented, you should make sure
that your code combination id field, is a text item (not a display item) with a
query length of 2000.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
VALUE SETS

QUESTION:

Does anybody know APIs to validate flexfields which have value sets?

ANSWER:

Flexfields has PLSQL APIs to validate both key and descriptive flexfields.
You can find the documentation at: http://www-
apps.us.oracle.com:80/atg/flex/static/server_validation/index.html

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
VIEW GENERATOR

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 5
QUESTION:

I have a client who is getting ORA-20000 with view generation while


compiling Accounting flexfield as Application Developer. I got him to
execute FNDFFVGN as APPS user to isolate the problem. FNDFFVGN
gives him the same error ORA-20000 but when he executes the sql
statement as APPS user, the view is generated successfully. What is
wrong/missing?

ANSWER:

Make sure you are using correct syntax for FNDFFVGN call. Before
running FNDFFVGN, please set FDVGNLOG environment variable to a
file name that will be created and FNDFFVGN will dump the sql statement
to this file.

setenv FDVGNLOG myfile.sql

If this file is succesfully created and contains the correct sql statement
then it means this is not Flex problem, you should contact to AD team,
since we are calling ad_ddl functionality to execute the sql statement.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
VALUE SETS

QUESTION:

When folks incorrectly define a value set with a width narrower than the
underlying database column, GPFs such as the one reported in bug
663123 can occur. Is there a script to check for these value sets?

ANSWER:

This problem was happening when developer uses a SQL statement


instead of a column name. This is happening only in table_validated value
sets and 3 column names can be defined, id, value, and description. If
they use pure column names we get the width of the column from
fnd_columns table, and everything will be fine. However if they use a SQL
statement then we can’t figure out how much space is needed to store the
value. To do this we have to parse the statement find all the column
names in it, and find the one with maximum width and use this maximum

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 6
value as a column size. Right now we don’t have a script to check these
conditions, and it is difficult to check it out. However following script lists all
value sets that uses SQL statements instead of pure column names (It is
looking whether there is a space in the expression or not). Someone
should look at the list and check all column sizes and then decide whether
the size of column is enough or not, and this person should be the one
who created this value set. The best way to solve this problem is to create
a view on the table names and move SQL statements to this view, then
register it by using ad_dd.register_table and ad_dd.register_column
functions, and then use this view and its columns as underlying table and
columns for the value set.

SELECT fvs.flex_value_set_name VALUE_SET,


fvt.application_table_name TABLES,
fvt.value_column_name VALUE_COLUMN_NAME,
fvt.value_column_type || ‘-‘ ||
fvt.value_column_size VALUE_TYPE_SIZE,

fvt.id_column_name ID_COLUMN_NAME,
fvt.id_column_type || ‘-‘ ||
fvt.id_column_size ID_TYPE_SIZE,

fvt.meaning_column_name MEANING_COLUMN_NAME,
fvt.meaning_column_type || ‘-‘ ||
fvt.meaning_column_size MEANING_TYPE_SIZE

FROM fnd_flex_value_sets fvs,


fnd_flex_validation_tables fvt
WHERE fvs.validation_type = ‘F’
AND fvt.flex_value_set_id = fvs.flex_value_set_id
AND ( fvt.value_column_name LIKE ‘% %’
OR fvt.id_column_name LIKE ‘% %’
OR fvt.meaning_column_name LIKE ‘% %’)

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
KEY FLEXFIELDS

QUESTION:

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 7
In BOM/ENG, we are facing an issue with the FF values not being
populated when the form function is called from the special menu. It works
fine if called directly from the menu under the responsibility. When the
Resources form is called from the special menu in the Departments form,
the FF values for the Absorption and Variance accounts are not
populated. But this works fine if the Resources form is called directly from
the BOM responsibility. The FND_FLEX.EVENT() procedures calls have
all been coded correctly into the form triggers. The post-query
fnd_flex.event(‘POST-QUERY’) is firing in both cases but the the FF
values are populated only when the form is called directly and not from the
special menu. Please refer to bug# 696908 for more details.

ANSWER:

Flex doesn’t check which navigation path was used. Are you passing any
parameter to the form which depends on navigation path? (For example
chart_of_accounts_id, set_of_books, responsibility_id, user_id, etc.) If so,
do they effect any flex parameter in fnd_key_flex.define(...) function call?
Are you calling fnd_key_flex.update_definition(...) to change flex
parameters? Are you coded your triggers according to Coding
Standards? Is there a security rule for this key flexfield? What is the value
of QUERY_SECURITY argument in fnd_key_flex.define(...) call? If you set
this argument to ‘Y’ please set it to ‘N’ and see if you can see the
combination. If there is a security rule we do not show the combination.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
DESCRIPTIVE FLEXFIELDS

QUESTION:

For an SRS definition for a new executable, I want to create a valueset


(through the API) that is a static LOV of three char items. Is this possible?
If so, how?

ANSWER:

There are several things needed to accomplish this....


1) To create the value set, use FND_FLEX_VAL_API
2) To attach the value set to the report parameter, use
FND_PROGRAM.PARAMETER
3) After this, the flexfield must be compiled...use fdfcmp

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 8
4) To load the value set with the 3 values you want, use
SETUP_DESCR_VSETS (part of the fdfdds module)

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
VALUE SETS

QUESTION:

There is a customer who is wanting to enter over 2000 values to a value


set and they want to know if there is a way to do this without entering them
one at a time on the form. Is there an API for this?

ANSWER:

There is no API to create new values. They have to use the form. I was
working to code an API for this purpose but it is not very easy to do so,
due to segment qualifiers and descriptive flexfields attached to value sets.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
KEY FLEXFIELDS

QUESTION:

We are looking into using “Table validation” value sets for the “Accounting
Flexfields” (instead of Independant). I‘ve read somewhere in the
documentation recommending against this setup.
Here are my questions:
1. Does Oracle Applications support using “table validation” value sets
for Key Accounting Flexfield?
2. If not, please outline in details the reason why and the effects upon
implementing this way.

ANSWER:

Yes, flex supports table validated value sets in Accounting Flexfield.


However we do not suggest table validated value sets in Accounting
flexfield. Also you cannot use none/special/pair validated value sets for
Acct. FF. These are the reasons that I know;
1. Segment Qualifiers. Maintainance of segment qualifiers are done by
flex if you use ind/dep value sets. If you use table validated value sets you

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 9
have to maintain them yourself and since it is not very well known by other
developers it is not done and flex team will not support segment qualifiers
stored in other tables.
2. Hierarchies. Again flex maintains hierarchies in flex tables if you use
ind/dep value sets. If you use table validated value sets we only maintain
parent value hierarchy not child values. So you will loose most of the
hierarchy and roll-up functionality.
3. You cannot use WHERE clause in table validated value sets used in
Accounting Flexfield. If you cannot use WHERE clause you loose your
power over segment values.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
ACCOUNT GENERATOR

QUESTION:

The client site I am at presently will be importing purchase orders into the
Purchasing tables so that these same PO’s can be matched in Payables
and the costs transferred to Projects. In order to populate the account
CCID’s correctly in PO_DISTRIBUTIONS_ALL, I need to be able to
access FlexBuilder logic. The import procedure is being written in
PL/SQL. The client will not be using WorkFlow at this time. Are there any
other packages available to convert the FlexBuilder logic to PL/SQL?

I’m not sure what you mean by “client will not be using WorkFlow at this
time”. Workflow comes bundled with Apps, and is part of the technology
stack in Apps R11. You _can’t_ not use it. In the FlexBuilder case, the
customer uses workflow only as a GUI to customzing the FlexBuilder
logic.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
DESCRIPTIVE FLEXFIELDS

QUESTION:

I have a ct. who is establishing an English DB. The primary application


will be H.R. They want to use French and German localizations in
separate business groups in the very near future. They are concerned (or
have heard) that descriptive flexfields are established across business
groups. Is this true? If they have one database and multiple localizations

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 10
and they establish a business group per localization - will the data in the
descriptive flexfields be correct for the localization of the business group?

ANSWER:

I don’t know what you mean by ‘business groups’. Let’s assume you are
talking about multi-org. installation. Descriptive Flexfields are installed in
AOL, this means they are available to all org’s. If you want to have
descriptive flexfield dependent on org-id, you can set up your flexfield
such as, it uses org-id as context and you can create context sensitive
segments for different org’s. You just need to use org-id field as a context
reference field for your descriptive flexfield. Please see Flexfield Manual
for details about how to set up descriptive flexfields, and reference fields.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
DESCRIPTIVE FLEXFIELDS

QUESTION:

I have and analyst that has asked me about the ATTRIBUTE columns in
FND_FLEX_VALUES and FND_FLEX_VALUES_VL. There are
ATTRIBUTE1-50 columns in FND_FLEX_VALUES, but only
ATTRIBUTE1-44 in FND_FLEX_VALUES_VL. I have tried setting up a
descriptive flexfield using attribute 45, and it compiled successfully, and I
was able to enter data into that segment and save it. Do you know what
would be affected by not having columns ATTRIBUTE45-50 in the VL
table?

ANSWER:

FND_FLEX_VALUES_VL is not a table, it is a view and joins


fnd_flex_values, and fnd_flex_values_tl tables together with current
language. This view is used in all flex validation and it is very important
that it should not be corrupted. Those attribute columns are used for
‘Flexfield Segment Values’ Descriptive flexfield. This DFF is used in MSV
form, (in values block, just after the qualifiers.) There is already a defined
and seeded DFF on FND_FLEX_VALUES table.

If only 44 of 50 attributes are in _VL view, it means _VL view is corrupted,


it must be recreated. If ATTRIBUTE45-50 are missing there might be
some other columns missing, or join condition might be wrong. ATG does
not provide scripts to create multi language views for release 10.7 and
prior ones. We only provide it for R11 and future releases. Multi Lang.

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 11
customers used consulting solution, and customer should contact to
consulting to get view creation scripts.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
KEY FLEXFIELDS

QUESTION:

Is there an AOL API which can be used for seeding “Cross Validation
Rules”?

ANSWER:

We don’t have an API to seed cross validation rules. It is not an easy thing
to do with simple SQL statements. The only way to create CVRs is to use
the FNDFFMCV form.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
KEY FLEXFIELDS

ANSWER:

Here is the details about how to control which locking mode will be used
while inserting new code combinations.

If client side validation is used, flex will check


FLEXFIELDS:SHARED_TABLE_LOCK profile option to determine
whether share mode, or exclusive mode lock will be used.
If this profile option is set to ‘Y’ flex will lock the combination table
in ‘ROW SHARE MODE’, and flex will also lock a hash value in
fnd_flex_hash table by using Server Side Validation Utilities. fnd_flex_has
table has only 1000 values.
If this profile option is set to ‘N’ or if it is not defined flex will lock the
table in ‘EXCLUSIVE MODE’.
If fnd_flex_keyval server side validation package is used, flex will
always use ‘ROW SHARE MODE’ locking and it will lock a hash value. i.e.
it will behave as if profile option is set to ‘Y’.
I am not sure but if collision happens in hash table it may cause
dead lock.

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 12
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
DESCRIPTIVE FLEXFIELDS

QUESTION:

The form has three different blocks making reference to the same flexfield.
I don’t see a feasible way to change to the form to accomodate the current
block:item reference in the flexfield definition. Could three different blocks
use the same name LINES? Is there some way to resolve this flexfield
block:item reference conflict?

ANSWER:

Rule of thumb : If you are using a :B.F in any part of flex definition this :B.F
must exist in the form that holds the flexfield. So if you are using same
flexfield in two different forms, and :B.F doesn’t exist in one of them, flex
will fail in the form that doesn’t have the :B.F

Solution : Product team should create common :B.F’s in both forms and
populate them properly before flex takes control (i.e. before
fnd_flex.event(...) calls), and customer should use these :B.F’s. (example:
:GLOBAL.MY_FIELD).

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■

VALUE SETS

QUESTION:

We have a need to create a independent valueset and create values for it


inside a patch since we are doing off-cycle release for R11. There is no
api for creating values and also it is multi-lingual now. What is the best
ways to achieve this? can FNDXLOAD do this? should we use it? is there
a template for how to use it?

ANSWER:

To create a value set you can use fnd_flex_val_api.

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 13
We DO NOT have any api to create a value for value sets. If you want to
seed values you have to create a table validated value set and create
those values in your table, otherwise you cannot seed values. If customer
really nedds independent/dependent value set, then, those values MUST
be created manually by using Flex Value Define Form by the customer.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
KEY FLEXFIELDS

ANSWER:

This is a known problem in cross validation and security rules. (if there is a
range you may have this problem.) Problem is, if you use numbers and
characters in your value set at the same time, and if your range has mixed
boundaries, depending on character set, flex may behave different. We
suggest customers to divide these ranges into smaller ranges (as
numbers only and characters only) and do not use mixed boundaries.

For example do not use:

From: To:
----- ----
Include 0000 ZZZZ
Exclude 8888 BBBB

Seperate these ranges as:

From: To:
----- ----
Include 0000 9999
Include AAAA ZZZZ
Exclude 8888 9999
Exclude AAAA BBBB

I think there is no solution other than that. Different character sets have
different ordering. In code we just use SQL BETWEEN statement. If
BETWEEN handler is fixed such that it works independent of char set then
we won’t have this problem.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 14
FLEXFIELDS

QUESTION:

We have a requirement to retrieve the default value of a flexfield segment.


What is AOL’s recommended approach of retrieving that information?

ANSWER:

For descriptive flexfields use fnd_dflex, and for key flexfields use
fnd_flex_key_api.
Please see http://www-apps.us.oracle.com/atg/flex/static/flexapi.html for
further details.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
FLEXFIELDS

ANSWER:

We have internal $FLEX$.KEY_FLEXFIELD,


$FLEX$.DESCRIPTIVE_FLEXFIELD, and $FLEX$.RANGE_FLEXFIELD
value sets (all of them are user exit validated.) to handle form flexfields.
Their maximum size used to be 240 for 10.7 and previous releases.
Starting with R11 their maximum sizes increased to 700, and C code was
fixed to handle this increase. Customers may not see any problem in key
flexfields, however if they have huge descriptive flexfields where
concatenated segments size is larger than 240, they will see strange
behavior in flex. You cannot see these value sets in Flex Value Set Form,
you have to use sqlplus to see their details. Let me give some details
about these $FLEX$ value sets. These are:

ID FLEX_VALUE_SET_NAME
-- -------------------------------------------
1 $FLEX$.DF_CONTEXTS : to handle desc. flex contexts.
2 $FLEX$.INDEPENDENT : to handle independent value sets.
3 $FLEX$.DEPENDENT : to handle dependent value sets.
4 $FLEX$.SHORTHAND : to handle key flex shorthand
aliases.
5 $FLEX$.QUALIFIERS : to handle qualifiers.
6 $FLEX$.IND_STD_DATE : to handle independent standard

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 15
date value sets.
7 $FLEX$.DEP_STD_DATE : to handle dependent standard
date value sets.
8 $FLEX$.KEY_FLEXFIELD : to handle key flexfields.
9 $FLEX$.DESCRIPTIVE_FLEXFIELD : to handle desc.
flexfields.
10 $FLEX$.RANGE_FLEXFIELD : to handle range flexfield.

First 7 of them are table validated, 8th and 9th ones are special and last
one is pair validated. This may surprise you, but all flexfield functionalities
are handled by these 10 value sets. Customers should not know anything
about these value sets, any little change in these value sets will make a
big change in flexfield functionality.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■

VALUE SETS

QUESTION:

In the same flexfield where we had the bug, we are using some value sets
of special validation type to store code combination ids in our global
attributes. Reading the flex field manual, it’s very clear that the
parameter DINSERT should always be equal to ‘N’. However, some
consulting guys doing testing for us reported the inability to dynamically
create accounts as a bug. So, I tried to set the flag to ‘Y’ to see what
happened... Apparently it worked fine, but I closed the bug with status 92
(not a bug)... Is documentation accurate and we must not use dynamic
insertion in a value set? Can we set DINSERT to ‘Y’ without risking data
integrity problems?

ANSWER:

Please follow the coding standards, and do not turn DINSERT on in a


special validated value set.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
KEY FLEXFIELDS

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 16
ANSWER:

Cross Validation Rule:


I : 00.000000.000000.0000 - ZZ.ZZZZZZ.ZZZZZZ.ZZZZ
E : 60.700000.200000.0001 - 99.999999.900000.ZZZZ

By looking at this rule, combination should not fail. However it depends on


what kind of char set customer is using. In ASCII we have numbers,
uppercase letters, lowercase letters ordering. However this may not be
true for other char sets. In general we suggest customers not to mix
numbers and letters in Accounting flexfields value sets. But here is the
solution: (Assuming only uppercase letters are used.)

I : 00.000000.000000.0000 - 99.999999.999999.9999
I : AA.AAAAAA.AAAAAA.AAAA - ZZ.ZZZZZZ.ZZZZZZ.ZZZZ
E : 60.700000.200000.0001 - 99.999999.900000.9999
E : 60.700000.200000.AAAA - 99.999999.900000.ZZZZ

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
DESCRIPTIVE FLEXFIELDS

QUESTION:

We have several requirements for check digit validation of flexfield


segments in key and descriptive flexfields. Our current method of
implementing this is to define a hidden segment, which has a default value
of ‘SQL Statement’, that calls a server-side PL/SQL package procedure to
perform additional validation on the segment required, and the hidden
segment contains a flag indicating an error. For key flexfields we include
a cross-validation routine which validates the hidden segment with the
user-entered segment. (This is very nice since we can include any error
message we require). There doesn’t seem to be the equivalent of cross
validation in descriptive flexfields. We can include additional validation
outside the flexfield, and check the segment values inside the form, but
this is not a nice solution. We’d like to include this PL/SQL check in a
segment value set, and raise an appropriate error message if the
validation fails. Is there an easy way to do this? Could we use special
validation somehow with validate event? If so, how? Is PL/SQL an
appropriate language for a user_exit? If we use a ‘C’ user exit instead,
how should this be specified in the special validation ‘validate’ event?
Could you give an example? (The manuals only show FND events, and
don’t describe how the user_exit_string is constructed) (This assumes any

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 17
user_exit can be called from these value sets, not just predefined FND).
Would we also be able to raise an error message using this technique?

ANSWER:

DFFs are not validated at all. Only individual segments against their value
sets and may be dependencies between them. The reason is, DFFs are
only to collect optional information. We don’t plan about adding extra
validation to any of the flexfields. Also we plan to drop USER_EXIT
validation in flexfields in R12. We are planning to add PL/SQL function
validated value sets. Then you will be able to validate individual segments
by calling PL/SQL functions. We never thought someone will call a
PL/SQL function by using SQL defaulting mechanism. Please do not push
flex limits. Flex is not a design engine for your customized forms. I think,
you are using Developer DFFs. We are also thinking not to support
Developer DFFs in R12, we will make all flexfields fully customizable by
customers. Once again, Flexfields do not have the same functionality as
Forms do. If you want to have full trigger, and PL/SQL validation please
create another block in your form, and maintain it by yourself.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
VIEW GENERATOR

QUESTION:

Any input on this? I think AD is calling FNDFFVGN for these _KFV views
because it’s important for them to be set up correctly after AutoInstall
finishes. I think the versions created by the Inventory ODF files are just
stubs that allow all of the packages/views to compile correctly. Should we
continue to create the corresponding renamed views in Rel 11.5? Or is
this no longer required?

ANSWER:

Here is the solution.


1. Flex will create <table_name>_KFV by default. This means you will
have MTL_CATEGORIES_B_KFV
2. AD will create MTL_CATEGORIES_KFV as synonym to
MTL_CATEGORIES_B_KFV.
3. Never call FNDFFVGN apps/apps 0 Y 2 401 MCAT
MTL_CATEGORIES_KFV if you do so, you will overwrite the synonym.
(this means create concatenated view as MTL_CATEGORIES_KFV,
which is not what we want.)

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 18
One side note:
For every table name change we cannot spend this much time fixing
databases and creating synonyms. We already told product teams not to
write any code that depends on _KFV views. These views can easily be
changed by customer and can easily become invalid. Since combinations
are selected from these views without validating or checking security,
using these views over code combinations table has a big security and
validation hole. Flex team has all kind of validation APIs (both in C and
PL/SQL) and whenever a combination is needed these APIs should be
used to get it. Product teams should clean-up their code and make it
independent of _KFV views. We create these views only to be used by
customers not to be used by developers in their code.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
VALUE SETS

QUESTION:

I have noticed that when defining a Value Set for date validation, I have, in
R11, 2 options:
Format Type = ‘Date’
Format Type = ‘Standard Date’.
What is the difference between these two?

I noticed, that when we “played” with the NLS_DATE_FORMAT parameter


and set up as DD/MM/YYYY, the DATE value set didn’t work, and the
STANDARD DATE did. When we changed the NLS_DATE_FORMAT
back to DD-MON-RR, the STANDARD DATE seem to be still working.
Currently, we are setting up a system on a customer site with
NLS_DATE_FORMAT=DD-MON-RR and we have value sets for dates of
both kinds - and I am worried...

ANSWER:

http://www-spps.us.oracle.com/atg/flex/static/datevsetmasks.html

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
VIEW GENERATOR

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 19
QUESTION:

If you can take the create view statement created by the FNDFFVGN
executable and run it successfully in SQL Plus, but it fails when used in
FNDFFVGN with errors in ad_ddl, doesn’t this indicate that this is a
problem with ad_ddl and not flexfield code? Then the INV developer is
stating that the create view statement itself is wrong because it includes
ORGANIZATION_ID in it, but this view is created based upon the flexfield
definition, so I do not see how this is our issue either.

ANSWER:

If customer is calling command line view generator FNDFFVGN for one of


these key flexfields, they need to pass set_usage_flag as ‘Y’. If they use
our form to compile their flexfield, our form will automatically handle this
set_usage_flag. One more thing, 401/MSTK and 170/SERV key flexfields
are defined on MTL_SYSTEM_ITEMS table. (This is totally wrong but
they did it.) Everytime customer compiles these 2 flexfields view definition
will be different (view definition depends on the flexfield, not on table).
This may also be causing problem. (ORGANIZATION_ID may not be part
of MSTK but may be part of SERV and may be last compiled flex is
SERV.)

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
KEY FLEXFIELDS

QUESTION:

I’m on an Apps implementation where they are planning on creating some


cross validation rules that will be so large, that it we will be creating an
interface for them to update their rules. They want to make sure that
Oracle applications can support the amount of cross validation rule lines
they are planning to implement without any performance problems.

1. Is there a limit on the number of include/exclude statements one can


have in cross validation rules?
2. Are there any performance concerns we should be aware of in
Oracle applications if there are too many include/exclude statements?

ANSWER:

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 20
Only limitation is hardware. As long as they have enough memory cross
validation should work fine. However we do not suggest going beyond
100s, to be safe let’s say at most 1000. Adding each cross validation will
decrease the performance. If they have many CVRs (let’s say more than
10,000) they should expect poor performance. In fact we do not check
CVR’s for existing combinations, we only check it while creating new
combinations. So validation performance will be good for existing
combinations but, it will take some time to validate new combinations. If
they are worried about CVRs to be checked for existing combinations then
they can run FDFRXR and this program will mark invalid existing
combinations as disabled.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
FLEXFIELDS

ANSWER:

Here some important URLs.


Main page http://www-apps.us.oracle.com/atg/flex/static/flex.html
Flex APIs http://www-apps.us.oracle.com/atg/flex/static/flexapi.html
Flex Patches http://www-apps.us.oracle.com/atg/flex/static/patches.html
Server Val http://www-apps.us.oracle.com/atg/flex/static/server_validation/
index.html
fdfcmp http://www-apps.us.oracle.com/atg/flex/static/howtofdfcmp.html
FNDFFVGN http://www-apps.us.oracle.com/atg/flex/static/
howtoFNDFFVGN.html
Check Scripts http://www-apps.us.oracle.com/atg/flex/static/checkkff.txt
http://www-apps.us.oracle.com/atg/flex/static/checkdff.txt
http://www-apps.us.oracle.com/atg/flex/static/checkfb.txt

Please use http://www-apps.us.oracle.com/atg/flex/static/patches.html


web page to find out the latest patches. These APIs are simple and you
should be able to make fixes.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
FLEXFIELDS

ANSWER:

Autonomous Transactions feature is implemented in Flex Server Side


Validation Engine. If SSV engine is called directly this feature will be

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 21
available. (this is the case in Account Generator.) If client side code is
used then Flexfields:Validate On Server profile option should be set to “Y”.
(this happens when flex window pops-up, and flex C apis are called from
concurrent programs.) If this profile option is set to Y then in all cases flex
will end up calling SSV engine. I tried to call AT functions from client side,
but it is not straight forward, and it wasn’t very easy on the server side
also, there are too many variables to control the behavior of DINSERT
feature. Since same code is used by both Maintenance Forms, and
Foreign Key Forms, depending on Form and validation, things are getting
complicated.

Please see http://www-apps/atg/flex/static/autotrans.html for details.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
FLEXFIELDS

QUESTION:

Basically we need to use the query api for both key and descriptive
flexfield in our sql statement for a 11I project. In order to use these apis in
sql, they have to be defined as pragma WNDS, and WNPS. You said you
were going to change these apis to meet the requirement. Also we have
the same requirement for value set api, do you know who I can contact for
value set api?

ANSWER:

I didn’t know WNPS was required for this purpose and it seems our APIs
cannot have WNPS pragma, because of fnd_message functions and
some debug utilities we have. Because of that, you cannot use Flex APIs
in SQL statements. You guys should find another way to implement your
new functionality. I am not sure what exactly you are trying to do in your
new functionality, but Flex Setup Data or Setup APIs should not be used
at run time, and Flex Data should be accessed only through Flex Setup
Forms.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
VALUE SETS

QUESTION:

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 22
1. If a value set without any precision is attached to say Quantity GDF
(global flex field) and user wants to see the value like say 50,000 (without
any decimal component) and similarly in other countries as 50.000, then
what should be the value set to be attached ? Should that value set be
with precision value 0 ?
2. What should be max size to be attached to a number value set
without any precision. Should it be 38 or 41.

ANSWER:

If you don’t specify a precision, you’ll still be able to use a real value which
will be stores in canonical and displayed in native format. Basically, the
AOL F routine will work exactly like the routines now, except that if a real
number is stored, it will use canonical format.
1. Flex does not use G(roup) separator in Number values. So
customers cannot see 50,000 in US or 50.000 in Europe. They will always
see 50000. We cannot provide this functionality because of buffer size
problems. (I guess we discussed this and you said Group separator is not
important.)
2. Maximum length is the total string length (in bytes not in chars) of
the number. (decimal separator and decimal part of the number is
included in maximum length.)

Here are examples:


maximum universal
length precision minimum maximum format
------- ---------- ------- ------- -------
5 NULL or <= 0 -9999 99999 99990
5 1 -99.9 999.9 990D9
5 2 -9.99 99.99 90D99
5 3 -.999 9.999 0D999
5 4 0 .9999 D9999
5 else bad precision.

Maximum value for the maximum size is 38.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
VALUE SETS

QUESTION:

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 23
I need to have distinct in the select clause of a table-validated set.

ANSWER:

Create a view based on your select statement, and define your value set
based on this view.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
VALUE SETS

QUESTION:

We tried to create a value set with validation type "Table". While


associating the table name, i tried to pick from the list available. But the list
shows only the tablenames & not views. However when i enter a view
name, it accepts without giving any error. Is it correct to create a value set
based on a view eventhough the list doesn't show up these?

ANSWER:

This is probably a sign that your view isn't listed in the AD tables as it
should be.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
KEY FLEXFIELDS

QUESTION:

I have a situation where I defined 5 segments for an Accounting Flexfield.


Segments 3 & 4 use the same independent valueset
(Test_Independent_VSet). The 5th segment is a dependent valueset that
depends on segment 4 only (which uses valueset
Test_Independent_Vset).

The problem comes when I run this select and expect only one row to
return. Instead I get two rows, segment 3 & segment 4:

SELECT I.SEGMENT_NUM
FROM

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 24
FND_ID_FLEX_SEGMENTS I,FND_ID_FLEX_SEGMENTS
D,FND_FLEX_VALUE_SETS VI,
FND_FLEX_VALUE_SETS VD
WHERE I.FLEX_VALUE_SET_ID = VI.FLEX_VALUE_SET_ID
AND D.FLEX_VALUE_SET_ID = VD.FLEX_VALUE_SET_ID
AND VI.FLEX_VALUE_SET_ID =
VD.PARENT_FLEX_VALUE_SET_ID
AND I.ID_FLEX_CODE = 'GL#'
AND I.ID_FLEX_CODE = D.ID_FLEX_CODE
AND I.ID_FLEX_NUM = D.ID_FLEX_NUM
AND I.ID_FLEX_NUM = 1000045
AND D.SEGMENT_NUM = 5;

Is there a way to get only the segment the segment5 depends on.

ANSWER:

When you create a dependent value set based on an independent value


set, there is no way that I know to specify the actual segment for which the
dependent value set is based....it only relys on the associated
independent value set. In your case, there are TWO segments using the
independent value set, therefore confusing the issue. If you want the
dependent based on the 4th segment only, then the 3rd segment should
use a different value set.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
DESCRIPTIVE FLEXFIELDS

QUESTION:

Is there a PL/SQL API for finding the number and type of a descriptive
flexfield segments given the flexfield name? I have a flexfield name like
$SRS$.FNDSCARU, and I need to find the number of segments, and
whether they are dates. I am selecting this right now from
fnd_descr_flex_column_usages and fnd_flex_value_sets, but I was
wondering if there was an API to do this.

ANSWER:

http://www-apps.us.oracle.com/atg/flex/static/flexapi.html

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 25
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
VALUE SETS

QUESTION:

The issue is with Flexfields where value sets are independently validated
and where the value is a word (varchar). Existing values are in American
English, but we'd like to translate these. The proposal is to change them
from independent to table valdation in which we'd provide language
support on the values which appear on screens and in LOV's. One
question is can one take an existing value set that is independently
validated and make it table validated? We'd also like advice on this
general approach to translation of these flexfield values.

ANSWER:

Indep./Dependent Value set values are not translatable, only descriptions


are translatable. I/D value sets can be converted to table validated value
sets, but they won't become translatable since value is stored in base
table.

Here is an example how to get translatable values in a table validated


value set.

MY_TABLE_B
id_col
------
1
2
3

MY_TABLE_TL
language id_col value_col desc_col
-------- ------ --------- --------
US 1 A desc A.
US 2 B desc B.
US 3 C desc C.
FR 1 {A} {desc A.}
FR 2 {B} {desc B.}
FR 3 {C} {desc C.}

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 26
MY_TABLE_VL is the usual join view based on above two tables and
current language.

In your value set:


Table : MY_TABLE_VL
id column : id_col (id column must be defined.)
value column : value_col
meaning column : desc_col

Then flex will store id's internally and will display translated value to user.

In general we suggest creating lookups in fnd_lookups and create a value


set by using this lookup.

In this case
Table : FND_LOOKUPS
id column : LOOKUP_CODE
value column : MEANING
meaning column : DESCRIPTION
where clause : where lookup_type = '<MY_LOOKUP>'

There is no way to extract existing values in a value set and create a


lookup by using them.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
CROSS-VALIDATION REPORT

This report does not take into account different org_ids for multi-org, does
it? I think it only lists every combination which will violate your cross
validation rules without regards to which org_id the code combination was
created for.

The syntax for FNDFFRXR is:


FNDFFRXR <apps>/<passwd>@<db> 0 Y <APP_ID>
<ID_FLEX_CODE> <STRUCT_NUM>
<UPDATE_FLAG>
ex. FNDFFRXR apps/apps@visr11p 0 Y 101 GL# 101 N

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 27
The 3rd argument is structure number, and this corresponds to
chart_of_accounts_id in Accounting flex case, and I think there should be
only one chart_of_accounts_id per organization. The one-to-one mapping
between structure_numbers and chart_of_accounts_ids is handled by GL.

FNDFFRXR will run following SELECT statement in code combination


table, and will check returned combinations against Cross Validation
Rules. If <UPDATE_FLAG> is set to 'Y' flex will disable the failing
combinations.

SELECT {segments} , <ccid_column>


FROM <code_combination_table>
WHERE <set_defining_column> = <STRUCT_NUM>
AND enabled_flag = 'Y'

FNDFFRXR is not a usual Oracle Report, it is a C program, and we do not


suggest/support any kind of customization in our executables. (I think
customers do not have the source code)

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
ACCOUNT GENERATOR

QUESTION:

Can you turn off workflow from generating an account in a FF? If I


remember correctly the product team attaches workflow (ie flexbuilder) to
generate the account and the product dev team is the only means of
turning it off. If a customer does not want WF to generate an account for
then can you turn it off some how ?

ANSWER:

First of all this customer should contact to PA team. I think they can create
a dummy WF process which does nothing, and assign this process to their
structure by using FNDFFMWP form. (Accounts Form). Or they can
customize the PA form, and comment out Acct.Gen. call.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
FLEXFIELDS

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 28
QUESTION:

Once a ff structure has been created for a key ff and saved, it can be
renamed and modified, but can it be deleted from the Key Flexfields
window?

ANSWER:

It can be deleted by using fnd_flex_key_api.delete_structure() api.


Please see, http://www-apps.us.oracle.com/atg/flex/static/flexapi.html

There is also an API to delete DFF contexts. They don't want to delete
whole flexfield, just some of the contexts.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
VALUE SETS

QUESTION:

The customer wants case insensitive recognition of data entered in value


segments. The example given is 'RISK ANALYSIS' should be recognized
as 'Risk Analysis' when doing value segment validation.

ANSWER:

If the value set is uppercase-only then segment validation is case


insensitive. (While user types, flex converts the letters to uppercase.)
However when they are doing query, the values in database should match
exactly.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
VALUE SETS

QUESTION:

Is the DESCRIPTION column in FND_FLEX_VALUES table supposed to


be there for all R11 releases? The vision database has the description
column in fnd_flex_values; however, the R11 Technical Reference manual
does not show the description column in fnd_flex_values.

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 29
ANSWER:

DESCRIPTION column is moved to FND_FLEX_VALUES_TL table. TRM


is printed from CASE, and
CASE has the correct definition. Since we do not have DROP COLUMN
feature in Oracle 7, we didn't drop this column from existing customers'
databases. DESCRIPTION column in FND_FLEX_VALUES table is
obsolete and should not be used. New customers will not get this column.
You can connect to fshr11p and check it out.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
FLEXFIELDS

QUESTION:

I am working on a foreign key form referencing two key flex fields:


inventory_item and locator. Since this form has summary items and detail
mirror items, there are 4 FND_KEY_FLEX.DEFINE calls {regular, mirror}
X {inventory_item, locator}.

The problem happens with insert and update. For inventory_item key flex
field, the list of value does bring up the right key flex field windows but
does not populate the concatinated_segments_field once a inventory item
is selected. Only one item works, either the regular item or mirror item,
depends on the order of FND_KEY_FLEX.DEFINE calls. The one
specified in later FND_KEY_FLEX.DEFINE call works.

Same thing happens to locator key flex fields.

Note that DATA_SET information is added later using


FND_KEY_FLEX.UPDATE_DEFINITION(), since at the time 'WHEN-
NEW-FORM-INSTANCE' trigger fired, DATA_SET is unknown.

ANSWER:

Please see
http://www-apps.us.oracle.com/atg/flex/static/flexonmirror.html
for details about flexfields on mirrored fields.

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 30
In 11.5 environment you can set GLOBAL.FND_FLEX_FNDSQF_DEBUG
to 'DEBUG' before opening-up your form and follow the flex calls and find
out what is happening and when it is happening. See AOL release notes
about Flexfield FNDSQF debugger. http://www-
apps.us.oracle.com/atg/atgrel/aol11.5.29.txt

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
FLEXFIELDS

ANSWER:

Here is the order of calls in report user exits.


FND FLEXSQL
src/srw/xirfnd.oc: FND()
src/util/fduxit.lc: fdaxit() function searches the
global structure and finds
out FLEXSQL is mapped to
fdpsqk(), and this
function is externdef for
fdxsqr() in fdxsqr.lc
src/util/fdxsqk.lc: fdxsqk()
src/flex/fdfsrw.lc: fdfsrw()

FND FLEXIDVAL
src/srw/xirfnd.oc: FND()
src/util/fduxit.lc: fdaxit() function searches the
global structure and finds
out FLEXSQL is mapped to
fdpidk(), and this
function is externdef for
fdxidk() in fdxidk.lc
src/util/fdxidk.lc: fdxidk()
src/util/fdxidk.lc: fdslfx()
src/flex/fdfsrw.lc: fdfsrw()

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
FLEXFIELDS

QUESTION:

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 31
There is the subject of value set defaulting, why or why not do defaults
work in FF and there is a diagnostic flag that will tell you why the FF did
not default.

ANSWER:

FF do not run defaulting in query mode or if the record is a database


record (post-query). FF only run defaulting when record status is either
NEW or INSERT. If you are in query mode it means that you want to
query a record therefore it does not make sense to do defaulting. Also if
there is an existing record that is queried and a FF is opened we do not
run defaulting either. In this case you do not want defaulting to overwrite
data pulled from the DB. You can do a help examine and click on first field
and enter SYSTEM and then click on second field and enter
RECORD_STATUS. You will see the value in the third field. We also do
not do defaulting if before a FF window is opened a FF field is touched
(updated) behind the scenes by code or thru some other means. In that
case flex knows something has changed and will not default.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
HIERARCHY COMPILER

QUESTION:

We get some bugs because some people don't know when and when it
should not compile when changing or adding values in the values form.

ANSWER:

See bug 966851 for more detail

FDFCHY program will be called only if


1. A new hierarchy range is defined or an existing hierarchy range is
updated,or deleted. This operation requires clicking (Define Child
Ranges) button, and making changes in the Child Ranges Block.
2. A hierarchy range is moved to another value. This operation
requires clicking (Move Child Ranges).
3. If something is updated in value definition for non-parent values.
Parent flag is not checked.) For example update description. Actually this
should be changed and we should call hierarchy compiler only if parent

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 32
flag is changed from checked (Y) to unchecked (N). But running the
compiler is harmless.

Creating a new value which falls in one the hierarchy ranges does not
require running the hierarchy compiler.

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
VALUE SETS

QUESTION:

Sometimes value sets do not appear in the quckpick of a segment when


trying to attach a value set to a segment.

ANSWER:

When you define a value set and then try to attatch it to a segment by
doing a quick pick but you do not see the value set you defined, the
reason is because if you defined a value set where the maximum value is
greater than the underlying table column (used by the segment) then flex
will not allow you to attach this value set. Also if you define a table
validated value set with a hidden id and the KFF does not use a hidden ID
then flex will not allow attachment.

Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 33
Copyright © Oracle Corporation, 2000. All rights reserved.

Appendix D
Chapter 10 - Page 34