Tuesday, November 10, 2009

Enabling/disabling DATE parameters of a concurrent program

Question: How to enable/disable date parameters of a concurrent program  based on certain condition.?
Answer: Handling number and text parameters had been discussed in the following blogs.
http://apps2fusion.com/at/ar/241-enablingdisabling-concurrent-program-parameters
and one more at http://sureshvaishya.blogspot.com/.

My requirement was different. I wanted to enable/disable DATE parameters based on user input.

Refer to the screenshots to understand what the intended functionality is ..

As shown in the screen, If the value for "Include Manual Invoices" parameter is "Yes", then enable and accept values for  parameters "Invoice Txn Date From" and "Invoice Txn Date To".


If the value for "Include Manual Invoices" parameter is "No", then disable parameters "Invoice Txn Date From" and "Invoice Txn Date To".

Let's get to details, how we can implement the functionality discussed above.

I am not going to discuss other parameters, which are not related to Enabling/disabling - functionality.

Note: As you might have noticed, I intentionally removed/masked custom names while taking screenshots.
Ex: Conc. Program Name, Application Name etc.

Steps:
1. Define controlling parameter, which can be based on any "Yes_or_No" valueset.
In my example - I used valueset called "CST_SRS_SYS_YES_NO".


2. Define parameter - P_HIDDEN_PARAM. As it's name suggests, this is a hidden parameter, which will not be visible when we submit the conc. program.
This parameter is directly dependant on the previous parameter - "Include Manual Invoices"

Set it's Default Type as  "SQL Statement " and
Default value as - "select decode(:$FLEX$.CST_SRS_SYS_YES_NO,'Y','Y',null) from dual".


3. Define custom valueset, which will used for the date parameters - "Invoice Txn Date From" and "Invoice Txn Date To".

- Enter valueset name , Select Format Type as Standard Date. Refer to the screenshot below for other details.

a) Click on Edit Information and enter forllowing query in Table Name field.
(SELECT (TO_DATE (SYSDATE - 200 + LEVEL, 'DD-MON-RRRR')) date_range FROM DUAL CONNECT BY LEVEL <= 1000)temp_tab

I am using "CONNECT BY LEVEL" concept to produce dates with the range of 1000 days.
You can modify 1000 to any other figure as per your requirement.
b) Set Value Name as date_range, which is nothing but the alias name in the query above.
c) Eter following WHERE clause in Where/Order By field.

 WHERE :$FLEX$.AMS_SRS_CHAR1='Y'




4. Attach newly created Value Set for the date parameters - "Invoice Txn Date From" and Invoice "Txn Date To" as shown below.


Save your changes and test it. If you have done all the setups correctly, you will see "Enabling/disabling" functionality something like this..



Write to me if you have any questions.

7 comments:

Kamlesh Nikhade said...

Thanks !

Very useful article..

Regards,
Kamlesh Nikhade.

Anonymous said...

hi ,

Thanks for posting the useful article.

Can u plz help me on below requirement

I have requirement where i have to disable /enable certain case

Case1 ..
I have parameter1
step1:based on paramter1 i have to enable/disable the paramter2 ..for that defined hiddenparameter1 to enable the paramter2 ..

Step2 :BASED ON THE PARAMTER2 I HAVE TO ENABLE /DISABLE PARAMTER3 FOR THAT DEFINED ANOTHER HIDEN PARAMETER ..NOW MY REQUIREMNT IS THAT ..

I HAVE TO DISABLE FROM DATE AND TO DATE WHEN PARAMETER 3 IS ENABLED .. PLZ HELP ME HOW TO ACHIVE THIS SCENARIO ..


THANKS

Paramater3
Paramater4
Paramter5

Chandra R Matta said...

Hi Sree, This scenario covered right.
This post is to enable and disable the Txn Date parameters conditionally.

You may need to use this post as baseline and do further reaserch in the same lines.

Anonymous said...

Hi,

I have a requirement where param 2 has to be disabled based on the value of Param 1.

If Param1 = 'True' then param 2 should be enabled and user can enter free text.

If Param1 = 'False' then param2 should be disabled.

I am having difficulty achieveing this functionality since param2 is a free text. Can anyone please advise?

oraclefusion said...

Very useful article and really good points were stated in the blog which are very useful to all i n order of that i have been searching for this kind of stuff from past few days finally got it for more information visit
CALFRE

oracleR12 said...

Hi,
Thanks for your Informative article on Enabling/disabling DATE parameters of a concurrent program,It is useful to so many users.
Thank you
oracle R12 training

oraclefusion SCM said...

Hi,

this is very valuable post. thanks for sharing such a valuable post.
oracle fusion SCM on line training