You are on page 1of 14

Based on a request, here is the details on how parameter can be enabled/disabled based another parameter value.

Below is the requirement


There are 2 valuesets parameter. If for parameter 1 user selects Yes then the other paramter should be enabled whereas if No is
selected then the parameter should remain disabled. This can be achieved by using a hidden parameter as explained below.

Step1: Need 3 value sets for 3 parameter.
Value set1 = BOM_SRS_YES_NO (Oracle Defined)
Value Set2 = AMS_SRS_CHAR1 (Oracle Defined)
Value Set3 = SV_DEPENDENT_VS (User Defined)




Step2: Create Concurrent program as displayed in the screenshot below
Parameter1: Main Parameter

Parameter2: Hidden PArameter

Parameter3: Dependent Parameter

Step3: Assign concurrent program to a request group and test your program.


P OS T E D B Y S URE S H VA I S HYA A T 9 : 2 7 A M
L A B E L S : GE NE RA L , S Y S T E M A DMI NI S T RA T OR


Enable/Disable Concurrent Program Parameters
Requirement - Business need is to have multiple parameters but end user will be allowed to use one at a time.
selection of any parameter, should disable others.

Solution - Below is one possible option which provides the same behavior in other way.
This requires one additional parameter as Selection/Choice which will decide the enabled parameter.

There will be as many dummy (non displayed) parameters as required parameters in program. actual parameters
will be dependent on respective dummy parameters.

Dummy parameters will be dependent on selection parameters and hold values based on selection.

Example - User requires 2 parameters supplier number and name to be available on one report and only one
should be selected at time. So the requirement was to make other disable. dependent parameters has limitations
and it cannot flow bottom to top. we can achieve this by introducing one selection parameter, which can hold 2
values -
1) Name Supplier Name
2) Number Supplier Number

Initially both Supplier Number and Name range parameter will be disabled.



Selection = Name , will enable supplier Name parameter range.




Selection = Number , will enable supplier Number parameter range.




Implementation Create 3 dummy parameter (1 displayable and 2 non displayable).

Parameter Value Set Enable Display
Test1 VS0 Y Y
Test2 VS1 Y N
Test3 VS2 Y N


Value Set - VS0, will hold below values


Parameter Test2 and Test3 :


Default Value select decode(:$FLEX$.VS0,'NUMBER','Y',NULL) from dual

Test3 will have similar definition.
Value Set = VS2
Default Value select decode(:$FLEX$.VS0,'NAME','Y',NULL) from dual

Now include the below condition for Number and Supplier Value set definition
Supplier Number Value set - :$FLEX$.VS1='Y'
Supplier Name Value set - :$FLEX$.VS2='Y'










In one of my programs I had multiple functionalities built in. Users could enter the parameters and based on the values entered in the proper
parameter the program will behave in different ways. It was important for me that the users are restricted to enter the right values in the right
parameter.
For example, parameter 1 had to be selected first. Based on the value selected Oracle will enable either the 2
nd
or the 3
rd
parameter for user entry. This
way we will be sure that the user unknowingly never enters the wrong parameter expecting some other kind of output
I have shown below the behavior of the SRS parameter form
SRS form behavior
Select the concurrent program and enter the parameters

Select program
At the beginning the first parameter is enabled whereas the 2
nd
to 5
th
are disabled. Select the 1
st
parameter.
The first parameter has 3 values,

Parameters of the program
1. EMP
2. HR
3. ORG
Each value decides which parameters to enable.
1. EMP enables Employee and Direction parameters

EMP selected
2. HR enables Direction and Department parameters

HR selected
3. ORG enables only the Department parameter

ORG selected
The parameters are handled at the concurrent program parameter registration form. Go to the concurrent program registration form
Concurrent program registration
Responsibility: System Administrator
Navigation: Concurrent > Program > Define
Query the concurrent program. Then select the Parameter button to view the parameters.

Concurrent program
There are 2 parameters, p_check1 and p_check2, which control the other parameters enable property. These parameters are not displayed to the
user.
The settings of these parameters are the following,
Parameter: P_check1
Value Set: EY_CHK_PARAM1
Default Type: SQL Statement
Description: LOV to enable or disable Employee number parameter
Default Value: select 1 from dual where :$FLEX$.EY_HIER_TYPE = EMP
Required: Unchecked
Display: Unchecked
This parameter checks the value of EY_HIER_TYPE parameter. If the value is set to EMP then it returns a value 1.
Parameter: P_check2
Value Set: EY_CHK_PARAM2
Default Type: SQL Statement
Description: LOV to enable or disable department parameter
Default Value: select 2 from dual where :$FLEX$.EY_HIER_TYPE = HR
Required: Unchecked
Display: Unchecked
This parameter checks the value of EY_HIER_TYPE parameter. If the value is set to EMP then it returns a value 1.
Parameter: p_emp_num
Value Set: EY_EMP_NUMBER
Default Type:
Description: EY Employee Number
Default Value:
Required: Checked
Display: Checked
This parameter is enabled when parameter p_check1 returns a value
Parameter: p_emp_num
Value Set: EY_HR_DEPT
Default Type:
Description: List of the HR organizations
Default Value:
Required: Unchecked
Display: Unchecked
This parameter is enabled when parameter p_check2 returns a value
Let us see the value sets, EY_CHK_PARAM1 and EY_CHK_PARAM2, that are used by these 2 parameters.
Navigation: Application > Validation > Set
Query for EY_CHK_PARAM1

Value Set EY_CHK_PARAM1
Query for EY_CHK_PARAM2

Value set EY_CHK_PARAM2
As you can see both the parameters are of type Independent. Let us see the values set in the value sets.
Navigation: Application > Validation > Values
Query for EY_CHK_PARAM1

EY_CHK_PARAM1 values
Query for EY_CHK_PARAM2

EY_CHK_PARAM2 values
The values in the value sets correspond to the default value set in the concurrent program default values.
Now let us check the value sets of the other 2 parameters, EY_EMP_NUMBER and EY_HR_DEPT.
Going back to the Value Set form we first query for the EY_EMP_NUMBER value set.

EY_EMP_NUMBER value set
Click on Edit Information button

Value set clause
The most important point is the WHERE clause,
1
2
3
where 1 = 1
and current_employee_flag = 'Y'
and :$FLEX$.EY_CHK_PARAM1 = 1
The value set is actually dependent on the EY_CHK_PARAM1 value set. This means is EY_CHK_PARAM parameter is not set to 1 this value set will
not only be null but it will also be disabled.
Check the value set EY_HR_DEPT

EY_HR_DEPT value set
Click Edit Information button.

Value set WHERE clause
This value set has the same logic as before, except that the logic is on the other value set, i.e. EY_CHK_PARAM2.
The logic of this development is that when a value set is dependent on another value set then the dependent value set is disabled until the independent value set
has at least 1 value that can be selected.
You will get the LDT file of the concurrent program at this URL, XXGENHIER
Cheers!
Related articles
Develop a custom form to allow auto-query functionality (oraclemaniac.com)
SQL to get the request sets that can execute the required concurrent program (oraclemaniac.com)
Change Viewer Options to view concurrent request output in web browser (oraclemaniac.com)
How to invoke Flexfield form to enter GL accounts as parameters in a report (oraclemaniac.com)
How to create a multilingual report in Oracle (oraclemaniac.com)

You might also like