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

Value Sets In Oracle Apps

What is value set?


Value Set is a collection of values. It validates the values entered by the user for a flex-field, report
parameters or a concurrent.

Why do we need value set?


You do not always want a user to enter junk free text into all the fields. Hence, oracle apps uses value
set to validate that correct data is being entered in the fields in screen.

When to defining values for value set?


After you register your flexfields or report parameters, if you are using independent or dependent
value sets, you can enter values into each corresponding value set using the segment values form.
Values for the value sets, we are defining will be kept in the oracle application object library tables.

How many types of value sets we have?


1. None
2. Independent
3. Dependent
4. Table
5. Pair
6. Special
7. Translatable independent
8. Translatable Dependent
None: This type allows users to enter any value as long as the value meets value set formatting rules.
As this value set is not validated, a segment using this value set does not provide list of values. Ex: If
the value set does not allow alphabetic characters, we cannot enter ABC but can enter 123.
Independent: This type provides a predefined list of values associated with descriptions. Ex: The
meaning of value in this value set does not depend on any other value of any other segment.
Dependent: This type is similar to independent value set except that the available values and their
meanings depend on the independent value that was selected in the prior segment of the flex field.
Ex: The Item type depends on what type is chosen in the Item Code field.
Table: This type provides a predefined list of values like an independent set but its values are stored
in an application table. We define which table to use along with a where clause to limit the values
to be used.
Special and Pair Value sets: These provide a mechanism to allow Flex field within a Flex Field
structure. These value sets are primarily used for Standard Request Submission (SRS) parameters,
and are not used for normal flex fields. For a Pair value set, two flex fields provide a range of valid
values.
Translatable Dependent and Translatable Independent: These value types are similar to Dependent
and Independent value sets except that they provide a predefined list of values for the segment, also
these values can be translated into different languages
http://oracleapps88.blogspot.in/2014/10/oracle-value-sets.html
select ffvs.flex_value_set_id ,
ffvs.flex_value_set_name ,
ffvs.description set_description ,
ffvs.validation_type,
ffvt.value_column_name ,
ffvt.meaning_column_name ,
ffvt.id_column_name ,
ffvt.application_table_name ,
FFVT.ADDITIONAL_WHERE_CLAUSE
FROM APPS.fND_FLEX_VALUE_SETS FFVS ,
apps.FND_FLEX_VALIDATION_TABLES FFVT
WHERE FFVS.FLEX_VALUE_SET_ID = FFVT.FLEX_VALUE_SET_ID;
1. Use of Special type of value set.

>> Special type is used for flexifields. Below are some examples for reference:

NOTE: Validate type of Pair will also have similar structure.

Value Set Name: AR_ARZACS_VAL_GLDATE_STANDARD


Validation Type: Special
Click on Edit Information button.
Event = Validate
Funtion =
AR VAL_GLDATE
GL_DATE=:!VALUE
SET_OF_BOOKS_ID=:$PROFILES$.GL_SET_OF_BKS_ID
VGL_DATE_FORMAT="DD-MON-YYYY"

Value Set Name: AP_GL_SRS_FLEXFIELD


Validation Type: Special
Click on Edit Information button.
Event = Edit
Funtion =
FND POPID
APPL_SHORT_NAME=SQLGL
CODE="GL#"
NUM=:$FLEX$.GL_SRS_CHART_OF_ACCOUNTS_ID
REQUIRED=Y
VALIDATE=FULL
ID=:!ID
SEG=:!VALUE
DESC=:!MEANING
NAVIGATE=!DIR
DINSERT=N

Event = Load
Funtion =
FND LOADID
APPL_SHORT_NAME=SQLGL
CODE="GL#"
NUM=:$FLEX$.GL_SRS_CHART_OF_ACCOUNTS_ID
REQUIRED=Y
VALIDATE=FULL
ID=:!ID
SEG=:!VALUE
DESC=:!MEANING
NAVIGATE=!DIR
DINSERT=N

Value Set Name: AP_SRS_APXINREV_COMPANY_SEGMENT


Validation Type: Special
Click on Edit Information button.
Event = Edit
Funtion =
FND POPID
APPL_SHORT_NAME=SQLGL
CODE="GL#"
NUM=:$FLEX$.AP_APXINREV_CHART_OF_ACCOUNTS_NO_VALIDATION
REQUIRED=Y
VALIDATE=NONE
ID=:!VALUE
SEG=:!VALUE
DESC=:!MEANING
DINSERT=N
DISPLAY=GL_BALANCING
ALLOWNULLS="Y"
BOX=Y

Event = Validate
Funtion =
FND VALID
APPL_SHORT_NAME=SQLGL
CODE="GL#"
NUM=:$FLEX$.AP_APXINREV_CHART_OF_ACCOUNTS_NO_VALIDATION
REQUIRED=N
VALIDATE=NONE
ID=:!VALUE
SEG=:!VALUE
DESC=:!MEANING
DINSERT=N
BOX=Y
DISPLAY=GL_BALANCING

2. Use of $FLEX$ in value set

>> :$FLEX$ is used for dependent condition of the parent value set which is of type table.

This example is from flexfield user guide.

Example of $FLEX$ Syntax


Here is an example of using :$FLEX$.Value_Set_Name to set up value sets where one segment depends on a
prior segment that itself depends on a prior segment ("Cascading Dependencies")

Assume you have a three-segment flexfield where the first segment is car manufacturer, the second segment
is car model, and the third segment is car color. You could limit your third segments values to only include car
colors that are available for the car specified in the first two segments. Your three value sets might be defined
as follows:

Segment Name Manufacturer


Value Set Name Car_Maker_Name_Value_Set
Validation Table CAR_MAKERS
Value Column MANUFACTURER_NAME
Description Column MANUFACTURER_DESCRIPTION
Hidden ID Column MANUFACTURER_ID
SQL Where Clause (none)

Segment Name Model


Value Set Name Car_Model_Name_Value_Set
Validation Table CAR_MODELS
Value Column MODEL_NAME
Description Column MODEL_DESCRIPTION
Hidden ID Column MODEL_ID
SQL Where Clause WHERE MANUFACTURER_ID =
:$FLEX$.Car_Maker_Name_Value_Set

Segment Name Color


Value Set Name Car_Color_Name_Value_Set
Validation Table CAR_COLORS
Value Column COLOR_NAME
Description Column COLOR_DESCRIPTION
Hidden ID Column COLOR_ID
SQL Where Clause WHERE MANUFACTURER_ID =
:$FLEX$.Car_Maker_Name_Value_Set AND
MODEL_ID = :$FLEX$.Car_Model_Name_Value_Set

In this example, MANUFACTURER_ID is the hidden ID column and MANUFACTURER_NAME is the value
column of the car_Maker_Name_Value_Set value set. The Model segment uses the hidden ID column of the
previous value set, Car_Maker_Name_Value_Set, to compare against its WHERE clause. The end user never
sees the hidden ID value for this example.

Another example found on the internet, which talks about using PL/SQL code or calling database
functions:

Oracle Special Value Set

Special value set configuration and uses.

I have observed that many times we need to restrict users to a limited, conditional value entries either in DFF
or when submitting concurrent request. Normally we can use dependent value set, but when dynamic or some
specific check is required, then special value set is better and only choice. Below I have described all the steps
for configuring value set. Assign this value set to DFF or concurrent req. parameter as required.

1. Go to Application Developer --> Application --> Validation --> Set.


2. Create a new value set - Enter value set name, description, List type = List of values.
3. Select Validation Type = Special from left bottom of the screen.
4. Click on Edit information.
5. Select Event = Validate.
6. Now in function, you can write pl/sql code or call any function from database.
7. The logic of validation will be as per requirement.
8. The code syntax will be FND PLSQL " entire function "
9. To read the value which user has entered in DFF or as conc. request parameter, use lc_in := :!value;
10. To raise error if the enter value is not correct, use fnd_message.raise_error;
11. Use Application message. Display appropriate message.
12. Raising error makes sure that user cannot continue with the invalid value and he will be forced to correct
entry.
13. The character size is limited, but by calling database function, one can put complex validation.

-- Below is the code to validate that user can select a date which is 3 months before sysdate. This is a
parementer in report in which user should be allowed to see data for 3 months or before, but he cannot see
recent quater data.

FND PLSQL "declare


l_value varchar2( 20 ) := :!value ;
l_valid NUMBER := 0 ;
BEGIN
SELECT (sysdate - to_date(l_value,'dd-mon-yyyy'))
INTO l_valid
FROM dual;
IF (l_valid <= 91) THEN
fnd_message.set_name( 'FND', 'FND_GENERIC_MESSAGE' ) ;
fnd_message.set_token( 'MESSAGE', 'Date must be atleast 3 calendar months prior to current date' );
fnd_message.raise_error ;
END IF ;
END;
"

3. How to create a value set which is dependent of another value set. (let us consider a value set which
displays me the country name, state, in this the country value set is the parent and state value set is
child . pls do explain me how to create these two value sets.)

>> You can create dependent value sets in 2 ways.


1) Create one independent then create one dependent and mention the independent one.
2) Create on table type, create another table type and specify the where clause as mentioned above.

4. How to create a value set using 3 tables?

>> You can create value set using multiple table. Give the table names seperated by , in the table name field.
Go through any seeded value set which is based on multiple tables.
Example:

Validation type 'Translatable Dependent' in Value sets in Oracle


Definition:- A Translatable Dependent value set is similar to Dependent value set in that the available values in the list and
the meaning of a given value depend on which independent value was selected in a prior segment of the flexfield structure.
However, a translated value can be used.

Flexfield Value Security cannot be used with Translatable Independent or Translatable Dependent value sets.

Note: The Accounting Flexfield does not support Translatable Independent and Translatable Dependent value sets.

Lets create a Translatable dependent value set based on parent value set we created in an earlier post.

Translatable Independent Value set

Lets create a Translatable dependent value set.


Select the parent value set. i.e. XX_INDEPENDENT_VALUE_SET

Enter values against each parent value of XX_INDEPENDENT_VALUE_SET which we selected as parent
for XX_DEPENDENT_VALUE_SET.

After attachment of value set to a form field, result was as below.


Please note that values saved for these value sets will be PAK for Pakistan and LHR for Lahore.

1.Overview

Value-set is a group of values. It can also be thought of as a container of values. The values could be of any
data type (Char, Number etc.) A value set is used in Oracle Applications to restrict the values entered by a
user. For example, when submitting a concurrent program, we would like user to enter only valid values in the
parameter. This is achieved by associating a value set to a concurrent program parameter.
A Value Set is characterized by value set name and validation. There are two kinds of validations, format
validation and Value validation. In the format validation, we decide the data type, length and range of the
values. In the value validation, we define the valid values.
The valid values could be defined explicitly, or could come implicitly from different source (like table, another
value-set etc.)

2. Uses
Value-set is an important component of Oracle Applications used in defining Concurrent program parameters,
Key Flex field and descriptive flex field set of values.
Some of the scenarios where value-set is used are given below:
a. In a concurrent program, we may want users to enter only number between 1 and 100 for a
particular parameter.
b. In a concurrent program, we may want users to enter only Yes or No for a particular parameter.
c. Suppose a concurrent program has two parameters. First parameter is department and second
parameter is employee name. On selecting a particular department, we want to show only those employee
names which belongs to the selected department.
d. In a descriptive flex field enabled on a particular screen, we want to show only a designated list of
values for selection by a user.
e. In case of accounting reports, we may want users to enter a range of key flex field values
(concatenated segments).
3. Steps To Create Value Set:

Navigation:
Value Set Form:

The various fields are explained below:

Value Set Name : Any user defined unique name

Description : Description of the value set

List type : Three choices are available for this field:


List of Values
Long List of Values
Pop-List

Security type : Three choices are available for this field:


No Security
Hierarchical Security
Non-Hierarchical Security

Format Validation

Format Type
Possible values for this field are:
Char
Date
Date Time
Number
Standard Date
Standard Date Time
Time

Maximum Size : Maximum size of the value


Precision : Applicable when format type is number
Numbers Only : When this is checked, only numbers are allowed
Upper Case Only : This is applicable when Format type is Char
Right Justify and Zero-Fill Numbers: Applicable only for Numbers
Min Value : Min Value allowed
Max Value : Max Value Allowed

Value Validation

Possible values of the value validations are as follows:


None You use a None type value set when you want to allow users to enter any value so long as that value
meets the value set formatting rules. That is, the value must not exceed the maximum length you define for
your value set, and it must meet any format requirements for that value set.
Independent:
When this is chosen, the individual values are defined using the navigation shown below
Values Screen Navigation:

Values Find Screen:


Dependent:

Same like Independent Value Set, except the List of Values shown to you will depend on which the
Independent value you have selected in the Prior Segment. Must define your independent value set before
you define the dependent value set that depends on it. Must create at least one dependent value for each
independent value

In the above Value set screen, if you choose type as DEPENDENT and clicked the Edit Information Button,
we get the below screen

Table:

The list of value is created based on database tables.


Allows to write simple queries, joins, order by etc
The value, meaning and ID can be used to display a value, description to the value but return ID to the calling
program or screen.
Additional columns can also be displayed.
Can also create dependent values to filter LOV data based on parameter value selected earlier. This can be
done using :$FLEX:.value_set_name in the where clause.
In the above Value set screen, if you choose type as TABLE and clicked the Edit Information Button, we
get the below screen
Special & Pair Value Sets:

Pair validation value set allows to select a range of concatenated Flex field segments as parameters to the
report. The special value set is used to perform special validation. This is used to enter the entire key flex field
segment in the single parameter of the report/calling entity.
Special and pair value sets provide a mechanism to allow a "flexfield-within-a-flexfield". These value sets are
primarily used for Standard Request Submission parameters. You do not generally use these value sets for
normal flex field segments.
Special and Pair value sets use special validation routines you define. For example, you can define validation
routines to provide another flexfield as a value set for a single segment or to provide a range flex field as a
value set for a pair of segments.
In the above Value set screen, if you choose type as SPECIAL and clicked the Edit Information
Button, we get the below screen

4. FNDLOAD & Value SETS:

FNDLOAD can be used to migrate the value set information from one instance to another and below is the
code sample

<-- Command to be executed -->

FNDLOAD $usrname/$Passwd
OY
DOWNLOAD
$FND_TOP/patch/115/import/afffload.lct
file_name.ldt
VALUE_SET FLEX_VALUE_SET_NAME=LEARN_VALUESET

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