Selecting values dependant on criteria

Hi there,
DECLARE
@tmp TABLE
(Name
CHAR(30),balance
char
(6),
tpk INT
,Type
VARCHAR(10),Descr
CHAR(40),Field
CHAR
(50))
INSERT
@tmp SELECT 
'Leigh', 43.20,
12345    ,
'272'     
'Sales',   
INSERT
@tmp SELECT 
'Leigh', 43.20,
12345    ,
'289'     
'Mortgagee',   
'BANK' 
INSERT
@tmp SELECT 
'Logan', 54.87,
55322 ,'null'     
INSERT
@tmp SELECT 
'Simon', 28.67,
44433     ,'272'     
,'Sales',
INSERT
@tmp SELECT 
'Stew', 10.18,
44422     ,'null'     
INSERT
@tmp SELECT 
'Tim'  
, 24.30,
33322 , 
'272'    
'Sales',     
'BANK' 
INSERT
@tmp SELECT 
'Tim'  
, 24.30,
33322 , 
'289'    
'Mortgagee',     
'BANK' 
INSERT
@tmp SELECT 
'Chris' 
, 68.22,
34567,     
'289'    
'Mortgagee',    
'BANK'
gives me the answer
Leigh                          43.20  12345 272 Sales                                  
Leigh                          43.20  12345 289 Mortgagee                              
 BANK                                             
Logan                          54.87  55322 null                                        
Simon                          28.67  44433 272 Sales                                  
Stew                           10.18  44422 null                                        
Tim                            24.30  33322 272 Sales                                  
 BANK                                             
Tim                            24.30  33322 289 Mortgagee                              
 BANK                                             
Chris                          68.22  34567 289 Mortgagee                              
 BANK                                             
What I am trying to achieve here is this, if it is type 289, 272 or null seperately then it shows. 
However I have 2 rows which have got data types 272 and 289 and I only want to bring back 289.  How can I do this without not losing the null values.  As I know I could do a where statement to only seek '289' and null values, but there are some
records showing with 272 only.  So I am trying to get the to look like this
Leigh                          43.20  12345 289 Mortgagee                              
 BANK                                             
Logan                          54.87  55322 null                                        
Simon                          28.67  44433 272 Sales                                  
Stew                           10.18  44422 null                                        
Tim                            24.30  33322 289 Mortgagee                              
 BANK                                             
Chris                          68.22  34567 289 Mortgagee                              
 BANK                                             
Cheers

actually one more question if say one of the tpk is different so 34567 is now 76345.  Is there still a way of doing this ?
Here is a little clean up for your sample table and data:
DECLARE @tmp TABLE
Name VARCHAR(30),
balance DECIMAL(6, 2),
tpk INT,
Type VARCHAR(10),
Descr VARCHAR(40),
Field VARCHAR (50)
INSERT @tmp
VALUES ('Leigh',43.20,12345,272,'Sales',''),
( 'Leigh',43.20,12345,289,'Mortgagee','BANK'),
( 'Logan',54.87,55322,NULL,'','' ),
('Simon',28.67,44433,272,'Sales','' ),
( 'Stew',10.18,44422,NULL,'','' ),
('Tim',24.30,33322,272,'Sales','BANK' ),
( 'Tim',24.30,33322,289,'Mortgagee','BANK' ),
( 'Chris',68.22,76345,289,'Mortgagee','BANK' )
;With mycte as (
select *, row_number() Over(Partition by Name Order by tpk DESC) rn from @tmp)
Select Name, balance, tpk, Type, Descr, Field from mycte
Where rn=1
Leigh 43.20 12345 289 Mortgagee BANK
Logan 54.87 55322 null
Simon 28.67 44433 272 Sales
Stew 10.18 44422 null
Tim 24.30 33322 289 Mortgagee BANK
Chris 68.22 76345 289 Mortgagee BANK
It is almost the same as Jonathan Quek provided early.

Similar Messages

  • Select value depending to condition

    I need to assign a value to a query select field depending on a condition from another select field.  Please tell me that this could be posible to do within the Query Manager on SAP B1.  If so, could you help me with this?
    Thanks in advanced,

    Rodney,
    This can be achieved using the case function in SQL.  You can lookup CASE contruct in the SQL help files.  I will give you a small example below for your understanding.
    SELECT T0.DOCNUM, T0.DOCDATE, T0.CARDCODE, CASE WHEN T0.SLPCODE = -1 THEN NULL ELSE T1.SLPNAME END
    FROM ORDR T0 INNER JOIN OSLP T1 ON T0.SLPCODE = T1.SLPCODE
    In the above sample SQL, I am checking the value of the Sales Person code on the Sales Order and if it is -1 (-No Sales Employee-), I am printing blank. 
    Regards
    Suda

  • Automatically Selecting Values in Multiple Values Dropdown Parameters

    Hi,
    Is it possible to have parameter values automatically selected in a dropdown in an SSRS report?  I'm using SQL Server 2008 R2 Enterprise edition.  Basically what I have in mind is this:  The user wants to save his parameter selections in a
    table that will be available as a dropdown parameter of a report, call it
    ParamUserSelection.  ParamUserSelection is the first parameter of the report and other parameters depend on it.
    We have two other parameters called ParamCountry and
    ParamState.  These are dropdown text parameters that allow multiple values to be selected.  Populating the list is not a problem as I use a standard cascading parameter technique.  What I'm trying to do is the following:
    The user selects a value from ParamUserSelection, call it Selection1.  Selection1 is stored in a table and has all the values that should be selected in ParamCountry and ParamState.  In other words, it should tell these two subsequent parameters,
    what values should be selected in their respective dropdowns.  For example if the user selects Selection1 from ParamUserSelection, it reads the values in the database table and if it finds US and Canada for countries and CA, NY, ON for states, ParamCountry
    should be populated with all the countries available in the database but should have ONLY US and Canada as selected values and ParamState should be populated with all the states in the database but should have ONLY CA, NY and ON as selected values.
    If then I click on selection 2 and it has ParamCountry = US, ParamState = TX,OH in its database then again all countries and states should be in the dropdown but only US for ParamCountry and TX,OH for ParamState should be selected.
    Is this possible with SSRS?  I've tried using the Default Values tab with a dataset that returns all the selected values under Report Parameters Properties but this only works for the first time that I select ParamUserSelection.  It appears that
    if I change the value of ParamUserSelection again, the default values are not invoked.
    If this is possible, please tell me how to do this as I have been struggling for a day with it.

    Hi Comedian,
    According to your description, you have a report with three parameters (ParamUserSelection, ParamCountry, ParamState). The available value lists of ParamCountry and ParamState are based on the selection of a value for ParamUserSelection. Now you want to
    show all countries and states in their parameter dropdown list when selecting a user selection instead of only showing the cascading values. Right?
    In Reporting Service, when we want a parameter to show the cascading values, we only need to set the corresponding dataset and field for Default Values in this parameter. In this scenario, if we want to show all countries and states in their dropdown list,
    we just need to set another dataset for Available Values in those parameters so they can display all countries and states. We have tested your case in our local environment. Since you have done with the cascading parameters, we just give some part of steps
    and screenshots for your reference:
    We created two tables (dbo.Selection, dbo.states) based on your information.
    Create one more dataset (named dataset2) in your report, put text below into your query:
    select distinct Country from states
    Create another dataset (named dataset3), put text below into your query:
    select distinct State from states
    Go to your ParamCountry, in Available Values, select dataset2 and Country for dataset and field.
    Go to your ParamState, in Available Values, select dataset3 and State for dataset and field.
    Save and preview. It looks like below:
    Reference:
    Report Parameters (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou
      

  • Prompts visible on the basis of the selected value of initial prompt

    I have some reports in which multiple queries option is provided at UI by using no of prompts.. Now some of the prompts are visible on basis of the selected value of initial prompt. That means If value of prompt A is x than prompt B is displayed and if value of prompt A is y than Prompt C is displayed, which of the prompt(B or C) is displayed depends on value of prompt A.
    how can we achieve this.Kindly help
    prompts visible on basis of the selected value of initial prompt

    Hi,
    This isn't possible at report level. If you mounted your reports on a dashboard, your dashboard prompt could contain prompt a, b and c. Users can then choose to populate any of the prompts they require rather than having to hit "next prompt" all the time.
    Thanks
    Oli @ Innoveer

  • Prompts visible on basis of the selected value of initial prompt

    I have some reports in which multiple queries option is provided at UI by using no of prompts.. Now some of the prompts are visible on basis of the selected value of initial prompt. That means If value of prompt A is x than prompt B is displayed and if value of prompt A is y than Prompt C is displayed, which of the prompt(B or C) is displayed depends on value of prompt A.
    how can we achieve this.Kindly help!!

    Please post this question in the CRM On Demand Analytics and Reports forum. Thanks for your help.

  • How to get the index of selected values in SelectManyChoice...

    How to get the index of selected values in SelectManyChoice... the value which i get is coming when i submit the value second time

    By using the given code i get the value of the selected indices, but problem here is i get the value when it get submits at the second time... First time the length of that int array is 0.
    Second time it shows the value two times (i.e) First time submitted value and the second time submitted value. After that it works fine.. I have problem while clicking first time only..
    The Following error also raises.. One multiselect is dependent on other multiselect.
    DF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase PROCESS_VALIDATIONS 3
    java.lang.ArrayIndexOutOfBoundsException: 6
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlListBinding.findObjectFromIndex(FacesCtrlListBinding.java:334)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlListBinding.getInputValue(FacesCtrlListBinding.java:199)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.internalGet(JUCtrlValueBinding.java:2416)
         at oracle.jbo.uicli.binding.JUCtrlListBinding.internalGet(JUCtrlListBinding.java:3717)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlListBinding.internalGet(FacesCtrlListBinding.java:500)
         at oracle.adf.model.binding.DCControlBinding.get(DCControlBinding.java:749)
         at javax.el.MapELResolver.getValue(MapELResolver.java:164)
         at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
         at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
         at com.sun.el.parser.AstValue.getValue(Unknown Source)
         at com.sun.el.ValueExpressionImpl.getValue(Unknown Source)

  • Calling selection screen depends on radio buttion selection

    I need to call two selection screens (not radio buttons selection screens) depends on radio buttion selection
    Eg :
       R1-radio button
      R2- radio button
    if we select R1- we should get selection screen to enter input values like parameters, select options
       PARAMETERS:     p_abc TYPE    MARA-matnr OBLIGATORY
      SELECT-OPTIONS: s_mno  FOR   MARC- chngr OBLIGATORY.
      PARAMETERS:     p_xyz TYPE     MARA - amktxOBLIGATORY.  (just example)
    If we select R2, we should get selection screen to enter input values like parameters, select options
    PARAMETERS:         p_abcd TYPE    KNA1-matnr OBLIGATORY
      SELECT-OPTIONS:  s_mnop  FOR   VBAK- chngr OBLIGATORY.
      PARAMETERS:        p_xyza TYPE     VBAP - amktxOBLIGATORY  (just example)
    if we select 1 , other should be hide
    Madhu

    Hi,
    this is an example:
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    PARAMETER R1 RADIOBUTTON GROUP G1 DEFAULT 'X' USER-COMMAND SET1.
    PARAMETER R2 RADIOBUTTON GROUP G1 .
    SELECTION-SCREEN BEGIN OF BLOCK B21 WITH FRAME TITLE TEXT-004.
    PARAMETER: P1 LIKE IBIPPARMS-PATH MODIF ID FPA.
    SELECTION-SCREEN END OF BLOCK B21.
    SELECTION-SCREEN BEGIN OF BLOCK B22 WITH FRAME TITLE TEXT-004.
    PARAMETER: P2 LIKE IBIPPARMS-PATH MODIF ID FPB.
    SELECTION-SCREEN END OF BLOCK B22.
    SELECTION-SCREEN END OF BLOCK B2.
    DATA: P_CHECK.
    AT SELECTION-SCREEN OUTPUT.
      IF P_CHECK <> 'X'.
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'FPA' OR
             SCREEN-GROUP1 = 'FPB'.
            SCREEN-INPUT = '0'.
            SCREEN-INVISIBLE = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
        P_CHECK = 'X'.
      ENDIF.
      IF R1 = 'X'.
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'FPA'.
            SCREEN-INVISIBLE = '0'.
            SCREEN-INPUT = '1'.
            MODIFY SCREEN.
          ENDIF.
          IF SCREEN-GROUP1 = 'FPB'.
            SCREEN-INVISIBLE = '1'.
            SCREEN-INPUT = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
      IF R2 = 'X'.
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'FPB'.
            SCREEN-INVISIBLE = '0'.
            SCREEN-INPUT = '1'.
            MODIFY SCREEN.
          ENDIF.
          IF SCREEN-GROUP1 = 'FPA'.
            SCREEN-INVISIBLE = '1'.
            SCREEN-INPUT = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    Angelo.

  • Defining Selection-Screen Depending on Client

    Good Morning,
    I need to hide one parameter from my selection-screen depending on sy-mandt.
    Is it possible? If yes, can anyone show an example?
    Regards,
    Pedro Gaspar

    hi
    u can put ur fields in a block sepicific for a particular client.
    u check the mandt and display the corresponding block while hiding the others.
    check this sample code:
    TABLES: eban,
            SSCRFIELDS.
    SELECTION-SCREEN BEGIN OF SCREEN 100 TITLE title.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    PARAMETER:rad1 RADIOBUTTON GROUP rad USER-COMMAND frad1 DEFAULT 'X',
              rad2 RADIOBUTTON GROUP rad .
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.
    PARAMETER: mtr AS CHECKBOX MODIF ID g3 USER-COMMAND chk1,
               p_matnr TYPE eban-matnr MODIF ID g1,
               sloc AS CHECKBOX MODIF ID g3 USER-COMMAND chk2,
               str_loc TYPE eban-lgort MODIF ID g4.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.
    SELECT-OPTIONS: matnr1 FOR eban-matnr MODIF ID g2.
    SELECTION-SCREEN END OF BLOCK b3.
    SELECTION-SCREEN PUSHBUTTON /20(10) name USER-COMMAND UCOM.
    SELECTION-SCREEN END OF SCREEN 100.
    name = 'FETCH'.
    title = 'Test Report'.
    CALL SELECTION-SCREEN '100'.
    TYPE-POOLS slis.
    declaration of internal tables and work areas to be used
    DATA: BEGIN OF it_pr OCCURS 0,
          banfn TYPE eban-banfn,
          bnfpo TYPE eban-bnfpo,
          loekz TYPE eban-loekz,
          statu TYPE eban-statu,
          ekgrp TYPE eban-ekgrp,
          matnr TYPE eban-matnr,
          werks TYPE eban-werks,
          lgort TYPE eban-lgort,
          preis TYPE eban-preis,
          peinh TYPE eban-peinh,
          END OF it_pr.
    DATA: BEGIN OF it_mat OCCURS 0,
          matnr TYPE eban-matnr,
          END OF it_mat.
    *DATA:BEGIN OF ITAB1 OCCURS 0,
      DATA: l_answer.
    DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
          wa_fieldcat LIKE LINE OF it_fieldcat,
          it_event TYPE slis_t_event,
          wa_event TYPE slis_alv_event.
    declaration of variables to be used
    DATA: r_ucomm TYPE sy-ucomm,
          mat_no TYPE eban-matnr,
          len TYPE i VALUE 1,
          count TYPE i VALUE IS INITIAL,
          iflag TYPE i VALUE IS INITIAL,
          iflag1 TYPE i VALUE 0.
    DATA :pr_id TYPE sy-repid,
    rt_extab TYPE slis_t_extab.
    INITIALIZATION.
      pr_id = sy-repid.
    AT SELECTION-SCREEN OUTPUT.
    <b>  IF rad1 = 'X' AND SY-MANDT = <client 1></b>
        LOOP AT SCREEN.
          IF screen-group1 = 'G1' OR screen-group1 = 'G4'.
            screen-active = '1'.
            screen-input = 0.
          ELSEIF screen-group1 = 'G2'.
            screen-active = '0'.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      <b>ELSEIF rad2 = 'X'  and sy-mandt = <client 1></b>
        LOOP AT SCREEN.
          IF screen-group1 = 'G1'  OR screen-group1 = 'G4' OR screen-group1 = 'G3' OR screen-group1 = 'G5'.
            screen-active = '0'.
          ELSEIF screen-group1 = 'G2'.
            screen-active = '1'.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
      IF mtr = 'X'.
        LOOP AT SCREEN.
          IF screen-group1 = 'G1'.
            screen-input = 1 .
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
      IF sloc = 'X'.
        LOOP AT SCREEN.
          IF screen-group1 = 'G4'.
            screen-input = 1 .
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    clear sy-ucomm.
    iflag = 1.
    endif.
    regards
    ravish
    <b>plz dont forget to reward points if helpful</b>

  • How to bind a user selected value to a view object bind variable?

    Hi
    I have two pages in ADF BC application. In the first page ,i will give a drop down menu to user which displays all the table names in my databse.
    when the user selects a table and goes to the second page..he should be given a menu or a check list of all the columns in the user selected table....
    to display the columns i have used the query
    Select COLUMN_NAME from user_tab_columns where table_name = : table_name in the view object.
    now how to bind the user selected table value in the first page to the table_name bind variable in view object ?
    thanks
    swathi.

    Hi,
    depends on how the select box is implemented. With ADF and ADF Faces, the default value selection is the list index. In a value change listener you could look up the selected value from the underlying iterator. Store this value e.g. in a session attribute and point the NDValue of the ExecuteWithParams operation to #{sessionScope.your_attribute}
    Frank

  • Select Value Equal to Array

    I'm using Dreamweaver CS5 with PHP and a MySQL database.  I'm trying to read from an array (states[]) in the database that list all selected states a contractor might work in, i.e. WA,ID,OR... my insert record is savaing my array with the state abriviations with a coma in between with no space, which is fine with me.  My code for the insert record is:
    if (isset($_POST['states'])) {
                        $_POST['states'] = implode(',', $_POST['states']);
              } else {
                        $_POST['states'] = null;
    To test what my result needs to be, I have tried to hard code the Select Value Equal To box in the Dynamic List/Menu to WA which selects WA (Washington) fine. The Allow Multiple Selections checkbox is selected for this list/menu.  When I try to hard code more than one state like WA,ID, nothing is selected.  I have also tried to select WA ID and WAID.  What is the proper format of the Select Value Equal To in order to select multiple items. 
    Once the hardcoding is figured out I was going to try to figure out how to loop through in PHP and have it dynamically select from the record and echo (or otherwise print) in the proper format so multiple states from the array would be selected.  However, if someone out there has a sample, that would be great. 
    Thanks in advance for your help!
    Darren

    First, and maybe I'm reading this incorrectly, but shouldn't the "implode" in your example be "explode" because you have the array but you want to get the values out of it?
    Now I realize my next suggestion isn't what you want to hear but I used to think like you and store things in an array, loop an array, and then try to check the loop if certain values exist.  However, as time has taught me it's not necessarily the best way to store values that you will need for this type of instance.  Most of the time in instances like this, your user will be searching for contractors in a specific state.  So what I would recommend is creating another table with 2 columns:
    contractor_id (a way to identify the contractor, this will be a primary key, that will link to a key for the "contractor_id" in your original table)
    contractor_state (this will link an id to a state)
    One loop would be to query the contractor state, while the contractor ID is met and you could run a join to pull out the contractor states while the ID condition is met.  The other side is to pull out all the contractor IDs where the state criteria is met.  You would need to run a JOIN on the query to combine the original table with this new table if you wanted to pull out the contractor name along with the state just to name an example.
    A good article that you may want to read is the first answer from this StackOverflow question and the associated link in the response talking about normalization and about serializing data:
    http://stackoverflow.com/questions/1790481/php-mysql-storing-array-in-database

  • ADF  Get selected values from Dynamic Lists

    Hi,
    I have a created a dropdown list box where the list gets value through a managed bean. On commit I want the selected value to be saved into the CardiacV1EchoSched column of the Entity object (database). The source looks like this.
    <af:selectOneChoice value="#{bindings.CardiacV1EchoSched.inputValue}"
    label="#{bindings.CardiacV1EchoSched.label}"
    valuePassThru="true">
    <f:selectItems value="#{TTrack.carScheList}"/>
    </af:selectOneChoice>
    The problem is that getCardiacV1EchoSched() in the entity object class is null. The selected value does not get passed into #{bindings.CardiacV1EchoSched.inputValue} at all. If I bind the value to a variable in managed bean I get the selected value.
    Thanks in advance,

    Hi,
    not sure which business service you use to update the database, but if you use ADF Business Components then you need to call the commit operation
    Frank

  • Error while attaching document to report on Portal - Invalid selection valu

    Hello All,
    We are running our reports on Portal and as per the business requirement the users have to create comments or attach documents to certain amounts in certain columns and once they create the comment a document icon shows up near that amount (for example there are 3 columns Budget, actual, balance then the user have to create comment for some amounts which needs explanation) they do that from context menu  Documents -> Create new Comment.
    Now we want those documents to be saved on Infoprovider level and not on master data for any particular object. We have activated the flag "Characteristic is document property" on related infoobjects. We have the flag to display document icon on Infoprovider active in the web template. Now when I run the report I am able to create new comments on first two columns and when the report refreshes it shows me icon near that amount but it gives me errors on third column after the report refreshes itself. Now when I go in portal KM repository where documents are stored I do see the document that I created for the third column as well so looks like the document is getting created and being stored but the issue is when it tries to display the icon on that third column.
    The error I get is this:
    The initial exception that caused the request to fail was:
    Invalid selection value:  AttributeMember
    com.sap.ip.bi.bics.dataaccess.resource.impl.bi.exceptions.BicsResourceBwRuntimeException: Invalid selection value:  AttributeMember
    at com.sap.ip.bi.bics.dataaccess.resource.impl.bi.selector.selection.ProviderRange.setLowForced(ProviderRange.java:297)
    at com.sap.ip.bi.bics.dataaccess.resource.impl.bi.selector.selection.ProviderRange.setLow(ProviderRange.java:291)
    at com.sap.ip.bi.bics.dataaccess.resource.impl.bi.selector.selection.ProviderRange.set(ProviderRange.java:469)
    at com.sap.ip.bi.bics.dataaccess.consumer.impl.selector.selection.SingleMember.set(SingleMember.java:125)
    at com.sap.ip.bi.km.common.assignment.AssignmentMember.isContained(AssignmentMember.java:192)
    Please give some inputs if anyone is facing same problem or is anyone has worked previously with this kinda of stuff.
    Thanks in advance.
    Kiran

    Hi!
    Have you solved this problem? I have the same problem after a SPS implementation (SPS 17). The message appears when we select a single value in a DP (hierarchical filter item) that filters another one, but when I select a node it doesn't.
    Before the patch implementation the apliccation worked ok.
    Any idea?
    Thanks in advance.
    Jose

  • How to refresh page after selecting value from LOV item , in a tabular form

    Hi ,
    I have a tabular form, which contains 2 items(columns), of type "Select List - named LoV".
    Now, couple of issues here.
    1.
    2nd item(column) in tabular form, that LoV should get populated based user's selection value in first item LoV. So how do i refer to the value, that user selected in first item's LoV? I will have to use this reference in LoV query of my 2nd item ( on this tabular form)
    2.
    How can we refresh the page, when user selectes value in first item ( from LoV). As this is a tabular form, here item type is Select List, we dont have an option to pick item type as Select List with Submit. So problem is that when user selects value for item 1, refresh does not happen and item 2 LoV does not get populated as per user's selection in item 1.
    Please help here. Would be really appreciated.
    Thanks and Regards,
    Rave.

    Thanks Ben and Dan for your responses.
    Ben, your solution helped me with refresh of page, as page got submitted.
    This answers to my 2nd question. However, I still need to know first question, which basically is, how do i refer to the value, that user selected in first item LoV.
    Issue is, I selected the value in first item LoV, it got submitted and page fot refreshed. But after page refresh, first item LoV loses its value that I had selected last time. It does not retain the selected value after refresh.
    I have an unconditional process, that on every submit(refresh) of page, I set my items with their corresponding values. But problem is what do i mention there to refer to this item.
    I looked in view source of my page, this item is referred as f03.
    So i used "apex_application.g_f03", to set this item to its value, in my uncoditional submit process. But it did not work. I tried to refer this item as "f03" in this unconditional submit process. But still it did not help, the selected item loses its value after page refresh(submit).
    Any help here would be really appreciated. Please suggest how do we refer to this item's selected value.
    Thanks and Regards,
    Ravi.

  • Unable to set the selected value for a ADF LOV

    Hi,
    I am developing an application using jdeveloper 10.1.3 and Struts.
    I have created a ADF LOV on my JSP Page as given below:
    <html:select property="lob" onchange="javascript:selectLOB(this.form)">
    <html:optionsCollection label="prompt" value="index" property="lob.displayData"/>
    </html:select>
    When i submit the form, i am able to get the value of the selected Value in the List.
    JUCtrlListBinding listBinding = (JUCtrlListBinding) formBean.get("Lob");
    Row r = (Row) listBinding.getSelectedValue();
    String SoLob = (String) r.getAttribute("LobLob");
    But i am unable to set the selected value back in the list when i return to the form again.
    I tried the following:
    int x = listBinding.getSelectedIndex();
    listBinding.setSelectedIndex(x);
    It would be really helpful if some one could let me know what needs to be done.
    Thanks,
    Subashini

    Gyan,
    I tried with the code you suggest , its trying to set the value of a field, but my requirement is to change the property for
    "Rendered" on the field so that based on search parameters we can hide result table column.
    After searching online, I modified the controller code as follows
    1.Created a new transient attribute (Testrender) with type "Boolean" and always updateable.
    2.changed the "Rendered" property value on the field I want to hide as ${oa.PoSearchVO1.Testrender}.
    3. Modified the controller code as follows :
            OAApplicationModule am = pageContext.getApplicationModule(webBean);
            OAViewObject testvo = (OAViewObject)am.findViewObject("PoSearchVO1");
            OADBTransaction txn = am.getOADBTransaction();
            if (testvo != null)
              OARow row = (OARow)testvo.first();
                if (a.equalsIgnoreCase("Approved"))
                     row.setAttribute("Testrender", Boolean.FALSE);
                else
                     row.setAttribute("Testrender", Boolean.TRUE);
            } But now when i run the page and populate the search field and click "Go" its hiding the field but throwing the following error and the search results are also bad.
    Its using only the value of one search parameter but not the second one .
    The search cannot be executed because the table has pending changes that would be lost. I think the vo is getting dirty when I update the transient attribute value. So I used txn.rollback ,then search is working fine but its not hiding the field.
    So can you please let me know how to proceed from here ?

  • SSRS Report with mutli select values in parameters

    Hi All,
    I am creating a SSRS report and displaying the result in tablix. I want to make the report to filter by multi select values from the parameters.
    I have 3 parameters. For all the three parameters, I have set "Default  Values" and "Available Values". Also, modified my result dataset to get the values from parameters using "WHERE ID = @Parameter1" (example) and so
    on..
    3 Parameters types:   1. Yes or No       
    2. Date          3. Values with NULL in the DB
    Problems:
    1. When I am passing the default values "Yes" "No" - it is throwing errors because default values is passed as Yes "AND" No instead of "OR" condition. The value stored in the DB wil have either Yes or No but not both.
    2. When I am querying the date values, it is a DateTime field in the DB. But I have queried like SELECT CONVERT(DATE, EXE_DATE) AS DATE FROM table which is giving only date in SQL but in SSRS displaying date with time.
    3. When I pull the list of values for third Parameter from SQL, it has some NULL values. When I try to use it in SSRS, it is not displaying the NULL value as select option in the list of values
    Any suggestions for the above three problems for SSRS with multi select values as filter will be helpful.
    Maruthu | My Blog

    Hi Maruthi,
    Regarding the three things:
    1.) I believe your first parameter is mutliselect , please convert it to single select.
    Steps: 
    a.) Select the parameter, right click and go to parameter properties
                    b.) Under General Tab in DataType section remove the checkbox for Allow Multiple Value.
    2.) Instead of returning as the date please return string. For example : 
    SELECT CONVERT(VARCHAR, GETDATE(),101)
    Here is the list of conversion : http://www.sqlusa.com/bestpractices/datetimeconversion/
    3.) As such there is no concept of null in SSRS. (Its a relational concept) . We do have nothing , which means empty. In Order to use null please select the Allow null option in the DataType section of the Parameter, This will add an checkbox for null in
    the report preview. Its developer job to handle the null values in there query.
    Regards Harsh

Maybe you are looking for

  • How  to read all files  under a folder directory in FTP site

    Hi Experts, I use this SQL to read data from a file in FTP site. utl_file.fopen('ORALOAD', file_name,'r'); But this need to fixed file name in a directory. However, client generate output file with auto finename. SO do we have any way to read all fil

  • In Photoshop Elements 1, how do I put a frame/box around some type ?

    I am doing a post card and I want to find out how to put a box around some text (i.e. a text box) and then be able to alter the thickness of the line.

  • On maverick 10.9.4 adobe indesign cc 2014 crash at open

    i make every thing Sandee Cohen say in her comunication but my indesign cc still crash and the installation destroy my adobe creative suite CS6 that lives in my another macosx 10.6.8 partition,  Adobe CC begins to drive me crazy. i restore my 10.6.8

  • Annual upgrade pricing?

    I've read that a $49.99 calling plan on any line is required for an annual upgrade. So if your on the 65+ share plan with two lines, your not eligible because it's $40.00 for the primary line and $19.99 for the secondary line. Yet the account owner i

  • Acrobat 10 - Where's the print all open docs function?

    In Acrobat 9 I was able to go to Advance->Batch Sequences->Print All Then all of the documents that were opened would be printed, and if you wanted to it could Print All without saving.  This was a very useful feature that I no longer have access to.