Conditionally mandatory parameters of concurrent program

Conditionally mandatory parameters of concurrent program


Overview of Conditionally mandatory parameters:

Oracle Application does not support conditionally mandatory parameters. But sometime business requires conditionally mandatory parameters. So we need to achieve the same functionality using some workaround so that the program will be submitted with proper parameters.

Requirement of Conditionally mandatory parameters:

We have customized report wherein there is a mandatory parameter 'Print of New' can have either of two values 1) Yes, 2) No at the time of submission of concurrent program.
                        
If user has selected 'Yes' as a parameter and has not entered any value in the parameter Transaction number low or Transaction number High then parameters for the printing original date Low and printing original date High should be made mandatory.

In all other case parameters printing original date Low and printing original date High should be optional.
Concept of Conditionally mandatory parameters:
We would use two extra mandatory dummy parameters 1) Make Mandatory (when the filed would be mandatory), 2) Mandatory (User need to enter the value of date parameters) in addition to five regular parameter. The idea is simple and straight forward. Value of ‘Make Mandatory’ will be ‘Y’ when 'Print of New' is ‘Yes’ and value of both Transaction number low and Transaction number High parameters are null, in all other case cases, value of ‘Make Mandatory’ would be ‘N’.
By default the value of Mandatory would have a value (‘Y’) if value of ‘Make Mandatory’ is ‘N’. But user needs to enter some values for printing original date Low and printing original date High if value of ‘Make Mandatory’ is ‘Y’.

Step 1:  Create Value Sets
Understanding on creation of concurrent programs and concurrent program parameters and value sets for concurrent program parameters is expected.
Create five none validated Value sets SSMP_TRN_NO_FROM (format type Number), SSMP_TRN_NO_TO(format type Number), SSMP_CHAR(format type Char), SSMP_TRN_DATE_FROM (format type Standard Date), SSMP_TRN_DATE_TO (format type Standard Date)
a) Value Set: SSMP_TRN_NO_FROM
Conditionally mandatory parameters
b) Value Set: SSMP_TRN_NO_TO
Conditionally mandatory parameters
c) Value set: SSMP_CHAR
Conditionally mandatory parameters
d) Value Set: SSMP_TRN_DATE_FROM
e) Value Set:  SSMP_TRN_DATE_TO

 

Step2:  Define the concurrent program itself. And add parameters to it with default values

Create a concurrent program “SSMP Conditional Mandatory Parameter” with seven parameters as below
Define the concurrent program parameters:
  1. Create the parameter for Print of New and enter the Value Set as : Yes_No with default value: No
  2. Create the parameter Trx No From with value set SSMP_TRN_NO_FROM
  3. Create the parameter Trx No From with value set SSMP_TRN_NO_TO.
  4. Create a dummy parameter Make Mandatory Enable with value set SSMP_CHAR. Set the default type to SQLStatement and set the default value to 
select decode((select 'N' from dual where ((:$FLEX$.Yes_No='N') OR(:$FLEX$.Yes_No='Y' AND (:$FLEX$.SSMP_TRN_NO_TO:NULL is not null or :$FLEX$.SSMP_TRN_NO_FROM:NULL is not null)))),'N','N','Y') from dual. Set the displayed value to false by un checking the check box.
  1. Create a parameter for Print Date From and assign the value set SSMP_TRN_DATE_FROM
  2. Create a parameter for Print Date To and assign the value set SSMP_TRN_DATE_FROM.
  3. Create a dummy parameter Mandatory Enable with value set 10 Characters. Set the default type to SQLStatement and set the default value to 
select 'Y' from dual where ((:$FLEX$.SSMP_CHAR ='N') OR (:$FLEX$.SSMP_CHAR='Y' AND (:$FLEX$.SSMP_TRN_DATE_FROM:NULL is not null  AND :$FLEX$.SSMP_TRN_DATE_TO:NULL is not null)))
Set the displayed value to false by unchecking the check box and make this is as mandatory parameter

Step3: Test the concurrent program “SSMP Conditional Mandatory Parameter”

a)   Enter “Print of New” as ‘No’ and all other parameters as null you can submit the request

b)   Enter “Print of New” as ‘Yes’, Trx No From as 1, you can submit the program

 

c)    Enter “Print of New” as ‘Yes’ and all other parameters as null you can not submit the request
Conditionally mandatory parameters of concurrent program
d)   Enter “Print of New” as ‘Yes’, “Print Date From” as “10-FEB-2010” and “Print Date To” as “10-FEB-2010”  you can submit the request
Conditionally mandatory parameters of concurrent program


Comments

Popular posts from this blog

XML Publisher Request Fails Due to Output Post Processing Issue

Oracle Database Connection to TOAD