Enable or Disable Concurrent Prog Parameters Dynamically

Embed Size (px)

Citation preview

  • 8/10/2019 Enable or Disable Concurrent Prog Parameters Dynamically

    1/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 selectsYes 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

    http://1.bp.blogspot.com/_CWRCDagUe5A/SD61nEhAU_I/AAAAAAAAA4Q/aVeaechXXWc/s1600-h/3.jpghttp://2.bp.blogspot.com/_CWRCDagUe5A/SD61bUhAU-I/AAAAAAAAA4I/69CUePgbJvg/s1600-h/2.jpghttp://1.bp.blogspot.com/_CWRCDagUe5A/SD61YEhAU9I/AAAAAAAAA4A/GEUzHXSY6ys/s1600-h/1.jpghttp://1.bp.blogspot.com/_CWRCDagUe5A/SD61nEhAU_I/AAAAAAAAA4Q/aVeaechXXWc/s1600-h/3.jpghttp://2.bp.blogspot.com/_CWRCDagUe5A/SD61bUhAU-I/AAAAAAAAA4I/69CUePgbJvg/s1600-h/2.jpghttp://1.bp.blogspot.com/_CWRCDagUe5A/SD61YEhAU9I/AAAAAAAAA4A/GEUzHXSY6ys/s1600-h/1.jpghttp://1.bp.blogspot.com/_CWRCDagUe5A/SD61nEhAU_I/AAAAAAAAA4Q/aVeaechXXWc/s1600-h/3.jpghttp://2.bp.blogspot.com/_CWRCDagUe5A/SD61bUhAU-I/AAAAAAAAA4I/69CUePgbJvg/s1600-h/2.jpghttp://1.bp.blogspot.com/_CWRCDagUe5A/SD61YEhAU9I/AAAAAAAAA4A/GEUzHXSY6ys/s1600-h/1.jpg
  • 8/10/2019 Enable or Disable Concurrent Prog Parameters Dynamically

    2/14

    Parameter3: Dependent Parameter

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

    P O S T E D B Y S U R E S H V A I S H Y A A T 9 : 2 7 A M

    L A B E L S : G E N E R A L , S Y S T E M A D M I N I S T R A T O R

    http://sureshvaishya.blogspot.in/2008/05/disable-concurrent-program-parameter.htmlhttp://sureshvaishya.blogspot.in/2008/05/disable-concurrent-program-parameter.htmlhttp://www.blogger.com/email-post.g?blogID=4715885911366291269&postID=7343721125760147658http://sureshvaishya.blogspot.in/search/label/General?&max-results=5http://sureshvaishya.blogspot.in/search/label/General?&max-results=5http://sureshvaishya.blogspot.in/search/label/General?&max-results=5http://sureshvaishya.blogspot.in/search/label/System%20Administrator?&max-results=5http://sureshvaishya.blogspot.in/search/label/System%20Administrator?&max-results=5http://sureshvaishya.blogspot.in/search/label/System%20Administrator?&max-results=5http://4.bp.blogspot.com/_CWRCDagUe5A/SD6150hAVCI/AAAAAAAAA4o/QahgaE8EMXg/s1600-h/6.jpghttp://3.bp.blogspot.com/_CWRCDagUe5A/SD618khAVDI/AAAAAAAAA4w/XDhwuuMv5FA/s1600-h/7.jpghttp://4.bp.blogspot.com/_CWRCDagUe5A/SD61s0hAVBI/AAAAAAAAA4g/oVsG3Q-2bt8/s1600-h/5.jpghttp://1.bp.blogspot.com/_CWRCDagUe5A/SD61qEhAVAI/AAAAAAAAA4Y/1WvQ4YVy1QI/s1600-h/4.jpghttp://4.bp.blogspot.com/_CWRCDagUe5A/SD6150hAVCI/AAAAAAAAA4o/QahgaE8EMXg/s1600-h/6.jpghttp://3.bp.blogspot.com/_CWRCDagUe5A/SD618khAVDI/AAAAAAAAA4w/XDhwuuMv5FA/s1600-h/7.jpghttp://4.bp.blogspot.com/_CWRCDagUe5A/SD61s0hAVBI/AAAAAAAAA4g/oVsG3Q-2bt8/s1600-h/5.jpghttp://1.bp.blogspot.com/_CWRCDagUe5A/SD61qEhAVAI/AAAAAAAAA4Y/1WvQ4YVy1QI/s1600-h/4.jpghttp://4.bp.blogspot.com/_CWRCDagUe5A/SD6150hAVCI/AAAAAAAAA4o/QahgaE8EMXg/s1600-h/6.jpghttp://3.bp.blogspot.com/_CWRCDagUe5A/SD618khAVDI/AAAAAAAAA4w/XDhwuuMv5FA/s1600-h/7.jpghttp://4.bp.blogspot.com/_CWRCDagUe5A/SD61s0hAVBI/AAAAAAAAA4g/oVsG3Q-2bt8/s1600-h/5.jpghttp://1.bp.blogspot.com/_CWRCDagUe5A/SD61qEhAVAI/AAAAAAAAA4Y/1WvQ4YVy1QI/s1600-h/4.jpghttp://4.bp.blogspot.com/_CWRCDagUe5A/SD6150hAVCI/AAAAAAAAA4o/QahgaE8EMXg/s1600-h/6.jpghttp://3.bp.blogspot.com/_CWRCDagUe5A/SD618khAVDI/AAAAAAAAA4w/XDhwuuMv5FA/s1600-h/7.jpghttp://4.bp.blogspot.com/_CWRCDagUe5A/SD61s0hAVBI/AAAAAAAAA4g/oVsG3Q-2bt8/s1600-h/5.jpghttp://1.bp.blogspot.com/_CWRCDagUe5A/SD61qEhAVAI/AAAAAAAAA4Y/1WvQ4YVy1QI/s1600-h/4.jpghttp://sureshvaishya.blogspot.in/search/label/System%20Administrator?&max-results=5http://sureshvaishya.blogspot.in/search/label/General?&max-results=5http://www.blogger.com/email-post.g?blogID=4715885911366291269&postID=7343721125760147658http://sureshvaishya.blogspot.in/2008/05/disable-concurrent-program-parameter.html
  • 8/10/2019 Enable or Disable Concurrent Prog Parameters Dynamically

    3/14

    Enable/Disable Concurrent Program ParametersRequirement -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/Choicewhich 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).

    http://3.bp.blogspot.com/-F2ay6z45EAA/T3r5V9WDdTI/AAAAAAAAAM0/LOjQhUUF3AA/s1600/image005-787875.jpghttp://4.bp.blogspot.com/-P5DkaiO22s8/T3r5VlXpBsI/AAAAAAAAAMk/x4Qr40otMRY/s1600/image004-786783.jpghttp://2.bp.blogspot.com/-ymTbsEX7OwQ/T3r5VXKkqQI/AAAAAAAAAMc/Iistg1HgIBM/s1600/image008-784982.jpghttp://3.bp.blogspot.com/-F2ay6z45EAA/T3r5V9WDdTI/AAAAAAAAAM0/LOjQhUUF3AA/s1600/image005-787875.jpghttp://4.bp.blogspot.com/-P5DkaiO22s8/T3r5VlXpBsI/AAAAAAAAAMk/x4Qr40otMRY/s1600/image004-786783.jpghttp://2.bp.blogspot.com/-ymTbsEX7OwQ/T3r5VXKkqQI/AAAAAAAAAMc/Iistg1HgIBM/s1600/image008-784982.jpghttp://3.bp.blogspot.com/-F2ay6z45EAA/T3r5V9WDdTI/AAAAAAAAAM0/LOjQhUUF3AA/s1600/image005-787875.jpghttp://4.bp.blogspot.com/-P5DkaiO22s8/T3r5VlXpBsI/AAAAAAAAAMk/x4Qr40otMRY/s1600/image004-786783.jpghttp://2.bp.blogspot.com/-ymTbsEX7OwQ/T3r5VXKkqQI/AAAAAAAAAMc/Iistg1HgIBM/s1600/image008-784982.jpg
  • 8/10/2019 Enable or Disable Concurrent Prog Parameters Dynamically

    4/14

    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'

    http://4.bp.blogspot.com/-TrcPlcgOJ-E/T3r5WgLRqFI/AAAAAAAAANM/UB3Bi736Hlk/s1600/image010-790139.jpghttp://2.bp.blogspot.com/-rw3EI-83DeU/T3r5WczsCnI/AAAAAAAAAM8/_VkxH-sYvsI/s1600/image009-789081.jpghttp://4.bp.blogspot.com/-TrcPlcgOJ-E/T3r5WgLRqFI/AAAAAAAAANM/UB3Bi736Hlk/s1600/image010-790139.jpghttp://2.bp.blogspot.com/-rw3EI-83DeU/T3r5WczsCnI/AAAAAAAAAM8/_VkxH-sYvsI/s1600/image009-789081.jpg
  • 8/10/2019 Enable or Disable Concurrent Prog Parameters Dynamically

    5/14

    In one of myprogramsI 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 2ndor the 3rdparameter 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 2ndto 5thare disabled. Select the 1stparameter.

    The first parameter has 3 values,

    http://oraclemaniac.com/2011/08/06/google-with-oracle/http://oraclemaniac.com/2011/08/06/google-with-oracle/http://oraclemaniac.com/2011/08/06/google-with-oracle/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/srs-form-1/http://oraclemaniac.com/2011/08/06/google-with-oracle/
  • 8/10/2019 Enable or Disable Concurrent Prog Parameters Dynamically

    6/14

    Parameters of the program

    1. EMP

    2. HR3. 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

    http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/srs-form-4/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/srs-form-3/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/srs-form-2/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/srs-form-4/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/srs-form-3/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/srs-form-2/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/srs-form-4/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/srs-form-3/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/srs-form-2/
  • 8/10/2019 Enable or Disable Concurrent Prog Parameters Dynamically

    7/14

    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.

    http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/registration-1/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/srs-form-5/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/registration-1/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/srs-form-5/
  • 8/10/2019 Enable or Disable Concurrent Prog Parameters Dynamically

    8/14

    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:

  • 8/10/2019 Enable or Disable Concurrent Prog Parameters Dynamically

    9/14

    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

  • 8/10/2019 Enable or Disable Concurrent Prog Parameters Dynamically

    10/14

    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

    http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/value-set-2/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/value-set-1/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/value-set-2/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/value-set-1/
  • 8/10/2019 Enable or Disable Concurrent Prog Parameters Dynamically

    11/14

    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.

    http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/value-set-4/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/value-set-3/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/value-set-4/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/value-set-3/
  • 8/10/2019 Enable or Disable Concurrent Prog Parameters Dynamically

    12/14

    EY_EMP_NUMBER value set

    Click on Edit Information button

    Value set clause

    http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/value-set-6/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/value-set-5/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/value-set-6/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/value-set-5/
  • 8/10/2019 Enable or Disable Concurrent Prog Parameters Dynamically

    13/14

    The most important point is the WHEREclause,

    1

    2

    3

    where1 = 1

    andcurrent_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.

    http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/value-set-7/
  • 8/10/2019 Enable or Disable Concurrent Prog Parameters Dynamically

    14/14

    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 logi c of thi s development is that when a value set is dependent on an other val ue set then the dependent value set is disabled until the independent valu e set

    has at l east 1 val ue 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)

    http://oraclemaniac.com/2011/08/06/google-with-oracle/xxgenhier/http://oraclemaniac.com/2011/08/06/google-with-oracle/xxgenhier/http://oraclemaniac.com/2011/08/06/google-with-oracle/xxgenhier/http://oraclemaniac.com/2012/11/20/develop-a-custom-form-to-allow-auto-query-functionality/http://oraclemaniac.com/2012/11/20/develop-a-custom-form-to-allow-auto-query-functionality/http://oraclemaniac.com/2012/11/03/sql-to-get-the-request-sets-that-can-execute-the-required-concurrent-program/http://oraclemaniac.com/2012/11/03/sql-to-get-the-request-sets-that-can-execute-the-required-concurrent-program/http://oraclemaniac.com/2012/11/08/change-viewer-options-to-view-concurrent-request-output-in-web-browser/http://oraclemaniac.com/2012/11/08/change-viewer-options-to-view-concurrent-request-output-in-web-browser/http://oraclemaniac.com/2013/03/25/how-to-invoke-flexfield-form-to-enter-gl-accounts-as-parameters-in-a-report/http://oraclemaniac.com/2013/03/25/how-to-invoke-flexfield-form-to-enter-gl-accounts-as-parameters-in-a-report/http://oraclemaniac.com/2013/03/25/how-to-create-a-multilingual-report-in-oracle/http://oraclemaniac.com/2013/03/25/how-to-create-a-multilingual-report-in-oracle/http://oraclemaniac.com/2012/03/08/enabling-or-disabling-a-parameter-on-the-standard-srs-form/value-set-8/http://oraclemaniac.com/2013/03/25/how-to-create-a-multilingual-report-in-oracle/http://oraclemaniac.com/2013/03/25/how-to-invoke-flexfield-form-to-enter-gl-accounts-as-parameters-in-a-report/http://oraclemaniac.com/2012/11/08/change-viewer-options-to-view-concurrent-request-output-in-web-browser/http://oraclemaniac.com/2012/11/03/sql-to-get-the-request-sets-that-can-execute-the-required-concurrent-program/http://oraclemaniac.com/2012/11/20/develop-a-custom-form-to-allow-auto-query-functionality/http://oraclemaniac.com/2011/08/06/google-with-oracle/xxgenhier/