Step-by-Step: Enabling/disabling concurrent program parameters dyncamically
Find out how to enable/disable concurrent program parameters conditionally/dynamically.
by Arun Sista
This article is a simple step by step guide on controlling concurrent program parameters by enabling/disabling them based on values in other parameters. This article is for use of anyone who wishes to develop a new concurrent program/modify an existing one and wants to introduce new behavior to concurrent program parameters.
Background / Overview
I decided to write this based on some of my experience at Oracle where I had to research this fairly simple programming technique and given the lack of documentation ended up spending a fair bit of time on it initially.
This article contains a detailed explanation in text as well as an audio visual with a demo on the topic.
Scenario:
Let us assume that we are trying to create a concurrent program X_CUSTOM_TEST_CONC_PROGRAM that has 3 parameters.
The first parameter is called Requisition Type and the values are controlled by a pre-defined value set by the name PO_SRS_REQUISITION_TYPE. The values in this parameter can be INTERNAL/PURCHASE.
The second parameter is called Inventory Organization and is dependent on Requisition Type and would be enabled if the value in Requisition Type is ‘INTERNAL’
The third parameter is called Supplier and is dependent on Requisition Type and would be enabled if the value of the Requisition Type is ‘PURCHASE’
Step 1: Preliminary Setup/Knowledge
Understanding on creation of concurrent programs and concurrent program parameters and value sets for concurrent program parameters is expected.
Concept:
We would use dependent value sets to enable / disable parameters. The idea is simple and straight forward. You can have a value set “A” that drives a parameter. And another value set “B” that drives the second parameter. If I want to introduce a condition such that “B” does not get enabled till I enter a value in “A” I would have to make “B” as a dependent value set on “A”.
There are two ways to do this.
a.For table based value sets you need to put in a condition in the where clause that has a reference to the driving value set. i.e in our case if B is a table based value set it would need to reference A in the where clause in the following manner: and :$FLEX$.A = ‘<some value>’. This would ensure that the value set of B does not get initialized till the value set for A returns a value this in turn keeps the parameter for B disabled.
b.You can create a normal dependent value sets and define dependencies on other value sets.
So how would we approach our problem where we want to enable/disable values based on another parameter.
a.I would define a parameter that provides the driving value(this creates the dependency). This is driven by value set “A”
b.I would create a dummy parameter based on a value set that returns Y or Null. I would default the value in this dummy parameter such that it returns Y for the positive condition and null for the negative condition.
c.I would create the third parameter which is the dependent parameter and I would insert a clause such in it’s value set that it is dependent on the dummy parameter. What happens because of this is that the dummy parameter returns ‘Y’ when the condition matches thus enabling the value set associated with the dummy parameter and in turn enabling the value set for this dependent parameter. However if the condition fails the dummy parameter returns null thus disabling the value set and parameter for the dependent parameter
Step 2: Create value sets
Create value sets for all the parameters including the dummy parameters. In our case we would create the following value sets in this given order to take care of dependencies:
PO_SRS_REQUISITION_TYPE – Value set for the Requisition type
XX_CUSTOM_ENABLE_SUPPLIER - Value set to enable/disable the Supplier parameter.
Enter the possible values for the value set.
XX_CUSTOM_ENABLE_INV_ORG – Value set to control enabling/disabling the Inv org parameter
Enter the possible values for the value set.
XX_CUSTOM_INV_ORGANIZATIONS – Value set for the Inventory Organization parameter
XX_CUSTOM_VENDOR_LIST – Value set for Vendor parameter
Step 3: We would define the concurrent program itself. And add parameters to it with default values.
Create the concurrent program by the name XX_CUSTOM_TEST_CONC_PROGRAM
Define the concurrent program parameters:
- Creat the parameter for Requisition Type and enter the Value Set as : PO_SRS_REQUISITION_TYPE
- Create a dummy parameter Inv Org enable with value set XX_CUSTOM_ENABLE_INV_ORG. Set the default type to SQL Statement and set the default value to select decode(:$FLEX$. PO_SRS_REQUISITION_TYPE,'INTERNAL',’Y’,NULL) from dual. Set the displayed value to false by un checking the check box.
- Create a dummy parameter Supplier Enable with value set XX_CUSTOM_ENABLE_SUPPLIER. Set the default type to SQLStatement and set the default value to select decode(:$FLEX$. PO_SRS_REQUISITION_TYPE,'PURCHASE',’Y’,NULL) from dual. Set the displayed value to false by un checking the check box.
- Create a parameter for Inventory Organization and assign the value set XX_CUSTOM_INV_ORGANIZATIONS
- Create a parameter for Supplier and assign the value set XX_CUSTOM_ENABLE_SUPPLIER.
Add concurrent program to request group and run:
- Switch to the sysadmin responsibility and add your concurrent program to the All Reports request group for purchasing.
- Navigate to Purchasing Responsibility and run the concurrent program and see the results for yourself.
Video Demo
Click here to see video demo that explains the concepts for dynamically changing concurrent programs
Click here to see audio visual demo/example of how this can be done
Comments
Very well written article, well done
Cheers
An il
Very well written article , i was thinking do we need the translatable independant value set , instead of that a simple character value set , will it not suffice the purpose ?
Thanks
Prasad CP
Thanks for pointing this out. I agree with u 100%. I should have done it that way. I thought I had mentioned this point on the article. I suppose I missed it.
Thanks,
Ar un.
Very nice article. I have one point , we can also check :$FLEX$. PO_SRS_REQUISIT ION_TYPE='INTER NAL' in the where clause of value set XX_CUSTOM_INV_O RGANIZATIONS and check $FLEX$. PO_SRS_REQUISIT ION_TYPE='PURCH ASE' in the where clause of XX_CUSTOM_ENABL E_SUPPLIER, if we don't want to create dummy value sets.
Please correct me if I am wrong.
Thanks a lot for the article!
Regard s,
Shireen
In the above question, we have to check :$FLEX$. PARAMETER_NAME( for value set PO_SRS_REQUISIT ION_TYPE) instead of $FLEX$. PO_SRS_REQUISIT ION_TYPE.
Than ks and Regards,
Shiree n
As for your first question.. the method you suggested would not work. Once you enter a value for requisition type both the value sets that are dependent on it would get enabled. Just that one of them would return no rows. My idea is to enable/disable the value set. You can try it out and you would see the difference.
Se condly the demo works with the samples I have given. I have never tried $FLEX.PARAMETER _NAME. Can you please share details of this with us.
Thanks,
Ar un.
Yes, I tried it as u suggested. Once I enter the requisition type both parameters gets enabled and one of them returns no rows. So, for enabling disabling value set your solution will work.
Thanks a lot for your suggestion.
Re gards,
Shireen
Thanks for the wonderfull article.
Is it mandatory to use value sets of table type. Can't we achieve this without using them? I need to use date as a parameter in one of my programs. How can i do this?
Thanks in advance.
Wah.
As I mentioned in the article you don't have to make your validation set a table validation set. You can make it a dependent value set. You can do this by setting the ValidationType to Dependent. In the edit information section select the driving value set name which would enable ur dependent value set.
Hope this helps.
Thanks,
Arun.
I CAN'T SEE THE COMPLETE VISUAL DEMO....IT IS NOT DOWNLOADED PROPERLY.
SO, PL SUGGEST SOME WAY THAT I CAN SEE THE FULL DEMO.
I HAVE ALREADY IMPLEMENTED ALL THE VALUSET, BUT DUE TO SOME PROBLEM, I NEED TO SEE THE VISUAL DEMO.
THANKS
BIN
I am not sure why you are unable to download the whole audio visual. Can you explain the problem to me.. I can then try helping u debug the problem.
Thanks,
Arun.
Thanks,
Arun.
Lookin some solution for this type of requirement
I have 1 parmeter for my concurrent and at the run time I will get the alue of parameter through the form and after that i want user should not be able to make any hnage on that , means it should e disabled or greyed out.
Is this possblle if yes then can you guide me in doing that
This should possible. What you would need to do is introduce a new dummy parameter ahead of the concurrent program parameter that you populate. Populate it with a value of NULL when you are invoking it from the FORM and value of CONCURRENT when you invoke it from the concurrent program(default value). Make the other parameter dependent on this dummy field. It should solve your problem.
Pleas e do let me know the results/share the outcome.
Regar ds,
Arun.
Is it possible to delete am already created Valueset? If so, please mention how to do that.
Thanks in advance.
Thanks in advance.
Thanks for the wonderful article.I need help with my business requirement.Ins tead of disabling Input parameters,I should pass the Input of one parameter to the next one.Based on the value entered in Project LOV,I need to display only those tasks that are related to that Project.Would appreciate any help in this regard.Thanks again.
Harsha.
This is used in enabling/disabl ing as well.. U need to use :$FLEX$. .. This can be accessed in table based validations.. Please refer to the screenshots above ...
Thats an amazing article being covered on concurrent programs.
Thanks, keep up the good work
Manpreet
Howev er in my test paramter XX_ENABLE_PERIO DS I have the following sql statement select decode(:$FLEX$. XX_FROM_DATE,NU LL,'Y','N') from dual
If I enter a date into XX_FROM_DATE then XX_ENABLED_PERI ODS is set to 'N'. However if I leave XX_FROM_DATE empty (it is a none required field and I need to leave it as such). The the select decode (or even NVL )statement does not work. It does not enter a 'Y' into the parameter referenced by XX_ENABLED_PERI ODS . Do you know why the decode or NVL does not work in this circumstance?
I need to enable a date parameter based on the value of another parameter. How can I achieve this?
Thanks,
Sunil
I have a requirement wherein the parameter that I need to enable/disable dynamically is not a field with an LOV. I have a 'justification' parameter and it needs to be enabled for request type 'CAR' and disabled for request type 'RTS'.
I need to enable or disable the 'Justification' parameter based on the Request Type selected by the user.
In addition, I need the 'justification' parameter as a mandatory parameter if the request type is 'CAR'.
Please let me know how this can be acheived.
Than ks,
Krishna
What if i want the parameter to be enabled by default and needs to get disabled if the top parameter is selected.
I have a requirement to enable or disable( greyed out) concurrent parameter. The user enters some value in Concurrent Parameter 1 (CP1) and tabs out, then the Concurrent Parameter 2 (CP2) should get disabled. The moment he deletes this value in CP1 and tabs out, then CP2 should be enabled again and vice versa like if the user enters value in CP2 and tabs out, CP1 should become disabled and when he deletes the value from CP2, CP1 should become enable back.
Thanks for your help Anil in advance!
You told us how to enable/disable some parameters, but I would like to set some parameters as required or non-required depending of the value of another parameter.
For example: I have a filter-like LOV parameter with the values: "order number" and "order date". There are another 4 parameters: "order number low", "order number high", "order date low" and "order date high".
The required behaviour:
- if the filter like LOV has the value "order number" then the 2 order number parameters should be required, and the 2 order date parameters shoud be optional (not disabled).
- if the filter like LOV has the value "order date" then the 2 order date parameters should be required, and the 2 order number parameters shoud be optional (not disabled).
I would like to ask, if this is possible to realize?!
Than ks very much in advance!
My requirement is as follows: Based upon parameter A, Parameter B should enable. However, Parameter B is a free text. Please let me know how to handle in this scenario.
However, I followed the above one, but it didn't work.
Kamesh
Thanks for sharing and explaining such a valuable article on value set. Looking forward for such kind of more videos.
Thanks
Deepak
her ear and screamed. There was a hermit crab inside and it
pinched her ear. She never wants to go back!
LoL I know this is totally off topic but I had to tell someone!
due to it's good content
He always kept talking about this. I will forward
this post to him. Fairly certain he will
have a good read. Thank you for sharing!
and give you a shout out from New Caney Tx!
Just wanted to tell you keep up the great job!
I did however expertise some technical points using this website, since I experienced to reload the web site many times previous to I could get it to load correctly.
I had been wondering if your web hosting is OK?
Not that I am complaining, but slow loading instances times will often affect your placement
in google and can damage your high quality score if ads and marketing
with Adwords. Anyway I am adding this RSS to my e-mail and could look out for much more of your respective exciting content.
Ensure that you update this again soon.
If so how do you prevent it, any plugin or anything you can recommend?
I get so much lately it's driving me crazy so any assistance is very much
appreciated.
good to read this webpage, and I used to pay a visit this weblog every day.
our argument made at this place.
realized it's new to me. Nonetheless, I'm definitely glad I found it and
I'll be bookmarking and checking back frequently!
board and I find It truly useful & it helped me out much.
I hope to give something back and aid others like you helped me.
RSS feed for comments to this post