Collapsed rows give unexpected results in a grid

Hi,
For learning purposes, I am working on the sample which comes with SDK called: 19.Grid.
I have modified the basic sample as follows:
I have added a checkbox column
I have added code to color the row which is ticked. It ticked = blue, if unticked = gray
I retained only 2 collapse levels:
CollapseLevel = 0 for the radiobutton "No Grouping"
CollapseLevel = 1 for the radiobutton "Card Code"
The relevant code I used is shown at the bottom of this thread.
oGrid.CommonSetting.SetRowBackColor(pVal.Row + 1, newColor)
When I group on Card Code and Expand all rows, the code for background color works fine:
When I tick any checkbox, the row becomes blue.
When I untick the checkbox, the row returns to gray.
No problem at all here..
Problem:
Problems arise when some rows are collapsed.
The attached picture explains the problem better than words.
It seems that when there are collapsed rows ABOVE the relevant checkbox, then pVal.Row is not working properly.
If I expand all rows, the rows are correctly colored when I tick a checkbox.
Request:
Anybody knows what is happening, and propose a solution?
Thanks
Leon Lai
Picture:
Relevant Code: (in SBO_Application > ItemEvent)
Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
        BubbleEvent = True
        Dim EventEnum As SAPbouiCOM.BoEventTypes
        EventEnum = pVal.EventType
        If (FormUID = "frmGrid") And ((pVal.ItemUID = "optNo") Or _
             (pVal.ItemUID = "optCode")) And _
             (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) And (pVal.BeforeAction = False) Then
            If (userDS.Value = 1) Then
                oForm.Freeze(True)
                DocStatus, U_HandOver, ShipToCode from OINV where U_HandOver IS NULL and ShipToCode NOT LIKE  '%Address' ")
                oForm.DataSources.DataTables.Item(0).ExecuteQuery("Select TOP 3000 CardCode, CardName, DocDate, DocEntry, DocNum, DocTotal,                     DocStatus, U_HandOver, ShipToCode from OINV where U_HandOver IS NULL ")
                oGrid.Columns.Item("U_HandOver").Type = SAPbouiCOM.BoGridColumnType.gct_CheckBox
                oGrid.CollapseLevel = 0
                oForm.Freeze(False)
            ElseIf (userDS.Value = 2) Then
                oForm.Freeze(True)
               oForm.DataSources.DataTables.Item(0).ExecuteQuery("Select TOP 3000 CardCode, CardName, DocDate, DocEntry, DocNum, DocTotal,                     DocStatus, U_HandOver, ShipToCode from OINV where U_HandOver IS NULL ")
                oGrid.Columns.Item("U_HandOver").Type = SAPbouiCOM.BoGridColumnType.gct_CheckBox
                oGrid.CollapseLevel = 1
                oForm.Freeze(False)
            End If
        End If
        If (FormUID = "frmGrid") And (pVal.BeforeAction = False) And _
       (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK) And _
       ((pVal.ItemUID = "btnCol") Or (pVal.ItemUID = "btnExp")) Then
            If (pVal.ItemUID = "btnCol") Then
                oGrid.Rows.CollapseAll()
            End If
            If (pVal.ItemUID = "btnExp") Then
                oGrid.Rows.ExpandAll()
            End If
        End If
        If FormUID = "frmGrid" And pVal.BeforeAction = False _
            And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED _
            And pVal.ColUID = "U_HandOver" Then
            Dim newColor As Integer = If(oGrid.DataTable.GetValue("U_HandOver", oGrid.GetDataTableRowIndex(pVal.Row)).ToString() = "Y", 16777088,           15198183)
            oGrid.CommonSetting.SetRowBackColor(pVal.Row + 1, newColor)
        End If

Hi Maik,
Thanks for your reply, but I'm still shrouded in mystery.
>> the value is set in the row before :
>> 1. row is leaf
>> 2.lastbranchExpanded = true
Do you mean this line?
Dim lastbranchExpanded As Boolean = True
Even if I set it = False, the code works perfectly!
Anyway, it is = True only initially.
If the row is a leaf, this value is set to = False, so it is no longer = True
If the row IS NOT a leaf, this code is executed:
If Not oGrid.Rows.IsLeaf(i) Then
                    lastbranchExpanded = oGrid.Rows.IsExpanded(i)
and it returns False.
Yes! Here lastbranchExpanded IS INDEED EVALUATED (to False)
But if the row IS a leaf, the above code IS NOT executed
and hence, there is nothing to set the value of lastbranchExpanded to True.
Notice that the initial value (True) has already changed to False.
Nowhere in your code is there something to set the value of lastbranchExpanded to True
Your code only says that if lastbranchExpanded  =True, then expandedleafs += 1
I still cannot see WHERE the value of lastbranchExpanded is set to TRUE in the first place.
Really,I am in thick mud. Hope you can enlighten me!
Best Regards,
Leon

Similar Messages

  • Calling PL/SQL Procedure In Another Schema Gives Unexpected Result

    I have a SQL Script that does this:
    conn pnr/<password for user pnr>;
    set serveroutput on;
    exec vms.disable_all_fk_constraints;
    SELECT owner, constraint_name, status FROM user_constraints WHERE constraint_type = 'R';
    and the disable_all_fk_constraints procedure that is owned by user 'vms' is defined as:
    create or replace
    procedure disable_all_fk_constraints is
    v_sql   VARCHAR2(4000);
    begin
    dbms_output.put_line('Disabling all referential integrity constraints.');
    for rec in (SELECT table_name, constraint_name FROM user_constraints WHERE constraint_type='R') loop
    dbms_output.put_line('Disabling constraint ' || rec.constraint_name || ' from ' || rec.table_name || '.');
    v_sql := 'ALTER TABLE ' || rec.table_name || ' DISABLE CONSTRAINT ' || rec.constraint_name;
    execute immediate(v_sql);
    end loop;
    end;
    When I run the SQL script, the call to vms.disable_all_fk_constraints disables the FK constrains in the 'vms' schema, whereas I wanted it to disable the FK constraints in the 'pnr' schema (the invoker of the procedure). I know that I could make this work by copying the disable_all_fk_constraints procedure to the 'pnr' schema and calling it as "+exec disable_all_fk_constraints;+" from within the SQL script but I want to avoid having to duplicate the PL/SQL procedure in each schema that uses it.
    What can I do?
    Thank you

    You have two issues to solve.
    First you need to write a packaged procedure that works with INVOKER rights. The default is DEFINER rights.
    The difference is excatly what you need. Usually the package has the rights from the schema where it is defined (=Definer rights). In your case schema VMS. Whereas you need the privileges from the user that calls the package (PNR).
    => Check out the documentation for INVOKER rights
    The second problem is that the view "user_constraints" will not give the results you expect when called from inside a procedure in another schema. An alternative could be to use the view DBA_CONSTRAINTS with a filter on the owner (where owner = 'PNR'). Not sure if there are other working possibilities. Well you could create a list of constraint names that you want to disable, instead of creating the list dynamically.
    And you could have another potential disaster creeping up upon you. If you run this thing, then at this moment you don't have any referential integrity anymore. You can't be sure that you can create the FKs again after this action. This is EXTREMLY DANGEROUS. I would never ever do this in any kind of production or test database. I would be very careful when I do it on a development database.

  • InDesign CS5 - Enter and Return keys give unexpected results

    I've been using CS5 for just a few days (Mac Pro, Mac OS X 10.6.3). I've noticed that the Enter and Return keys aren't always behaving as expected. Enter doesn't give me a column break, shift-Return doesn't give me a line break but a new paragraph, and more often than not I can't select the default option in a dialog with either Return or Enter. I've just read cpsid_84345, which says this is an issue in German and Swedish language versions, but I'm using English. The 7.01 update doesn't seem to be available. Any advice?

    That the KBSC files are XML doesn't guarantee faultless migration from one version to the next, probably because Adobe just forgot to cope with importing KBSCs from previous versions. It's great that InDesign offers you such flexibility with the KBSCs, but it's terrible that the implementation has been so sloppy in at least the three last versions (maybe earlier versions, too, but I try to repress the memories).
    Some people have been asking Adobe to make KBSCs scriptable. This would enably you to maintain a small database with KBSCs which a script could read and feed into a new version of InDesign, or redo a KBSC file after it has become corrupt, or whatever minor or major mishap.
    The more people ask for this the better: go to http://www.adobe.com/support/feature.html and request script access to the KBSCs.
    Peter

  • ListRest with includeEmptyValues gives unexpected result

    I believe I've encountered a bug in Coldfusion 9 and 10.  Whenever includeEmptyValues (the third parameter) of ListRest is set to true it appears to return the entire list with no elements removed.
    I've verified this behaviour with the following test.
    <CFSET olst = 'a quick red fox jumped over the lazy brown dog'>
    <CFSET rlst = ListRest(olst, ' ', true)>
    <CFDUMP var="#rlst#">
    The result is "a quick red fox jumped over the lazy brown dog".

    Yep, it was reported over two years ago, and Adobe - apparently - don't have enough time to fix it. Which is disappointing, given how easy it must be to fix.
    https://bugbase.adobe.com/index.cfm?event=bug&id=3041684
    Adam

  • $chaptertitlename gives unexpected results

    Not sure if this is a bug or a feature.  I wanted to use the chapter title name in the footer of my master pages so I went to the master page, deleted some static text i found there then tried to add the building block <$chaptertitlename> but what i got was the short file name instead.  Is there a fix for this?

    The <$chaptertitlename> building block wasn't really designed for what you're trying to use it for. It's for hierarchical books where you're using folders and templates.
    From the Help:
    Associate a template with a folder
    Associate a template with a folder to publish a cover page for the files in the folder. Any template associated with a folder is published like any other file in a book. Use the <$chaptertitlename> variable to include the folder name in the template associated with the folder. You can use this variable for a folder occurring at any level in a book.
    See also:
    http://blogs.adobe.com/techcomm/2009/09/fm9_hierarchical_books_new_variable.html
    http://blogs.adobe.com/techcomm/2009/06/numbering_in_hierarchical_books.html
    As Error suggests, use a running header/footer variable to reference the paragraph text of the chapter title tag.

  • [solved]lspci gives strange results

    I just reinstalled, and am trying to get my wireless card up and running.  I ran lspci, then lspci -nn, and it gives unexpected results.  Instead of listing things like vendors and such as intel, and ralink, it just lists non-useful stuff in a format like this:
    xx.xx.x Class [xxxx] Device [xxxx:xxxx] rev 40
    (where all x's are digits)
    what does this mean?  where is the useful information that I was expecting to find (like actual device names)?  What did I forget to do?
    edit:
    Now I have Xorg up, so I'll post the output:
    lspci
    00:00.0 Class 0600: Device 1002:5957
    00:02.0 Class 0604: Device 1002:5978
    00:09.0 Class 0604: Device 1002:597e
    00:0a.0 Class 0604: Device 1002:597f
    00:11.0 Class 0106: Device 1002:4390 (rev 40)
    00:12.0 Class 0c03: Device 1002:4397
    00:12.2 Class 0c03: Device 1002:4396
    00:13.0 Class 0c03: Device 1002:4397
    00:13.2 Class 0c03: Device 1002:4396
    00:14.0 Class 0c05: Device 1002:4385 (rev 42)
    00:14.1 Class 0101: Device 1002:439c (rev 40)
    00:14.3 Class 0601: Device 1002:439d (rev 40)
    00:14.4 Class 0604: Device 1002:4384 (rev 40)
    00:14.5 Class 0c03: Device 1002:4399
    00:15.0 Class 0604: Device 1002:43a0
    00:16.0 Class 0c03: Device 1002:4397
    00:16.2 Class 0c03: Device 1002:4396
    00:18.0 Class 0600: Device 1022:1200
    00:18.1 Class 0600: Device 1022:1201
    00:18.2 Class 0600: Device 1022:1202
    00:18.3 Class 0600: Device 1022:1203
    00:18.4 Class 0600: Device 1022:1204
    01:00.0 Class 0c03: Device 1033:0194 (rev 03)
    02:00.0 Class 0200: Device 10ec:8168 (rev 06)
    03:00.0 Class 0c00: Device 1106:3403 (rev 01)
    04:00.0 Class 0300: Device 10de:0e22 (rev a1)
    04:00.1 Class 0403: Device 10de:0beb (rev a1)
    05:05.0 Class 0280: Device 1814:0301
    05:06.0 Class 0401: Device 1102:0004 (rev 04)
    05:06.1 Class 0980: Device 1102:7003 (rev 04)
    05:06.2 Class 0c00: Device 1102:4001 (rev 04)
    Last edited by Convergence (2012-06-07 02:48:41)

    Falconinidy:  You're right!  That was a  bad move.  Thanks!

  • To show the result of 2 grids in a single csv file

    Hi,
    i want to show 2 grids(seperately) in a csv file.i created a aggregate query that is giving me result of 2 grid seperately  but when i use a igrid template with aggregate query it is giving me result in a single row.i.e instead of giving 2 grids it is giving result with all the columns in a single row .I am using Applet.saveas CSV File();is there any way to have 2 seperate grid in a single Excel file.
    thanks in advance.

    Karthik
    Aggregate Query is mostly used to combine multiple queries which have at least one common column among those.
    For ur requirement, u can use direct BLS with the help of Action Block <b>WriteFile</b>.
    <b>Scenario :</b> u hv 2 queries - one with 4 columns A, B, C & D; another with 2 columns E & F
    U want to display those tables separately in one single Excel Sheet.
    <b>Solution :</b> Forget AggregateQuery and Take the following steps
    Step 1: Take those two Queries in one sequence
    Step 2: Define two Local variables - Text1 & Text2 with String Data Type
    Step 3: Use Repeater to loop one query's result and Assign the Looping results to the Local.Text1 using action <b>Assignment</b> as following expression in the Link Editor 
    <b>Local.Text1 &
    Repeater_0.Output{/Row/A} & tab &
    Repeater_0.Output{/Row/B} & tab &
    Repeater_0.Output{/Row/C} & tab &
    Repeater_0.Output{/Row/D} & crlf
    </b>
    Step 4: Use another Repeater outside the first Repeater to loop 2nd query's result and Assign the looping results to the Local.Text2 in similarly way as follows in the Link Editor
    <b>
    Local.Text2 &
    Repeater_1.Output{/Row/E} & tab &
    Repeater_1.Output{/Row/F} & crlf
    </b>
    Step 5: Use action <b>WriteFile</b> outside those above Repeaters and take the mode <b>APPEND</b> and FilePath <b>C:
    test
    TwoTables.xls</b> and Text as follows
    <b>
    "A" & tab & "B" & tab & "C" & tab & "D" & crlf & Local.Text1 & crlf & crlf &
    "E" & tab & "F" & crlf & Local.Text2
    </b>
    in the Link Editor
    Step 6: Hit F5/F6 and see the Excel File with two tables showing separately in the mentioned path above.
    Regards
    Som

  • Selecting a row in the output of alv grid

    hi,
    how do i select a row in the output of alv grid?plz help...
    regards,
    sheeba.

    Hi,
    Please refer the code below:
    *& Report  ZDEMO_ALVGRID_SELROW                                        *
    *& Example of a simple ALV Grid Report                                 *
    *& The basic ALV grid, Enhanced to display capture each row a user has *
    *& selected                                                            *
    REPORT  zdemo_alvgrid_selrow                 .
    TABLES:     ekko.
    type-pools: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      SEl,                         "stores which row user has selected
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
          gd_tab_group type slis_t_sp_group_alv,
          gd_layout    type slis_layout_alv,
          gd_repid     like sy-repid.
    *Start-of-selection.
    START-OF-SELECTION.
    perform data_retrieval.
    perform build_fieldcatalog.
    perform build_layout.
    perform display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
    *       Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
    * There are a number of ways to create a fieldcat.
    * For the purpose of this example i will build the fieldcatalog manualy
    * by populating the internal table fields individually and then
    * appending the rows. This method can be the most time consuming but can
    * also allow you  more control of the final product.
    * Beware though, you need to ensure that all fields required are
    * populated. When using some of functionality available via ALV, such as
    * total. You may need to provide more information than if you were
    * simply displaying the result
    *               I.e. Field type may be required in-order for
    *                    the 'TOTAL' function to work.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    *  fieldcatalog-do_sum      = 'X'.
    *  fieldcatalog-no_zero     = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-do_sum      = 'X'.        "Display column total
      fieldcatalog-datatype     = 'CURR'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endform.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
    *       Build layout for ALV grid report
    form build_layout.
      gd_layout-box_fieldname     = 'SEL'.
                                     "set field name to store row selection
      gd_layout-edit              = 'X'. "makes whole ALV table editable
      gd_layout-zebra             = 'X'.
    endform.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
    *       Display report using ALV grid
    form display_alv_report.
      gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
    *            i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
                i_callback_user_command = 'USER_COMMAND'
    *            i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
    *            it_special_groups       = gd_tabgroup
    *            IT_EVENTS                = GT_XEVENTS
                i_save                  = 'X'
    *            is_variant              = z_template
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
      if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    form data_retrieval.
    select ebeln ebelp statu aedat matnr menge meins netpr peinh
    up to 10 rows
      from ekpo
      into corresponding fields of table it_ekko.
    endform.                    " DATA_RETRIEVAL
    *       FORM USER_COMMAND                                          *
    *       --> R_UCOMM                                                *
    *       --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    * Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
    *   Check field clicked on within ALVgrid report
        IF rs_selfield-fieldname = 'EBELN'.
    *     Read data table, using index of row user clicked on
          READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
    *     Set parameter ID for transaction screen field
          SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
    *     Sxecute transaction ME23N, and skip initial data entry screen
          CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
        ENDIF.
        WHEN '&DATA_SAVE'.  "user presses SAVE
        loop at it_ekko into wa_ekko.
          if wa_ekko-sel EQ 'X'.
    *       Process records that have been selected
          endif.
        endloop.
      ENDCASE.
    ENDFORM.
    Thanks,
    Sriram Ponna.

  • Bug in 10.2.0.3.0 - sum gives wrong result?

    Hi,
    I've found a strange behavior when using sum without group by. Firs I thought it's hash group by, but it's supposed to be fixed in 10.2.0.3, and setting GBYHASH_AGGREGATION_ENABLED=FALSE also didn't fix the error.
    We have automated tests to verify our results of views and procedures. The test works on a small subset of data, so it uses the following (pseudo) select to calcuate the expected value:
    select
    sum(round(trw.a* rc.b,2))
    into
    tmp_result
    from
    trw
    inner join rc on rc.cp_id= trw.cp_id and rc.r_id= trw.r_id and rc.pc_id=param_pc_id
    where
    trw.t_id= test_t_id;
    Now, this select returns a value that's a little bit different than a value we get from the view we are testing.
    The view is basically the same, it has a group by trw.t_id and some simple logic.
    The interesting part is this:
    if I dump "un-summarized" data from the view and the select statement into temporary tables, i get the same rows, and sum over those rows gives the right value.
    Either I've missed something obvious or it truly is a bug. Any ideas?
    Regards
    Jernej

    OMG, my bad, I'm sorry.
    That's what happens when you test sysdate dependent results.
    Sorry again

  • 0I_FYPER - Variable in BEx gives no result

    Hello all,
    I have a problem in BEx-reporting after a releasechange from BW3.5 to BI7.0 and at the same time SEM-BCS4.0 to SEM-BCS6.0 which belongs to the variable 0I_FYPER. I use this variable in the columns (only) in order to give the user the possibillity to define which periods to show. In the rows I use the rest for defining which numbers to bring up. It worked in BW3.5/SEM-BCS4.0 fine.
    I debuged the content of the variable in user-exit ZXRSRU01 (after processing the selection screen) and could find the data I entered but the query gives no result. Any ideas?
    Thank you for any feedback,
    Chris

    Hi Guru,
    We have a work around for your issue. Just create a customer Exit variable on the calendar month and use it in the filter.
    In the customer Exit variable read the Plant variable and if it is empty populate # as result. Else read the calmonth input variable and populate it as the result.
    Use the following snippet to read input ready variables.
    DATA: loc_var_range LIKE rrrangeexit.
    READ TABLE i_t_var_range WITH KEY vnam = 'VARNAME' INTO loc_var_range.
    (loc_var_range-low will have the value of the variable)
    Hope this helps.
    Regards.
    Shafi.

  • Unexpected result from treenode.getPath() ???

    Hi,
    I am using Jtree in application.
    The tree is as following
    - Desktop
          -C:\
              - Folder1
              - File2
         - D:\I want to expend the node Folder1 as selected node. To do that I got the FileNode Folder1 and do
    TreePath path=new TreeaPath( folder1node.getPath() );
    int row=tree.getRowForPath(path);
    jtreetable.expend(row);
    But the problem is with the path returned. I must get the path [Desktop, C:\, Folder1] but I am getting path [Folder1].
    What I am doing wrong. Is there any other way to expend a particular node programatically ?
    Thanks

    Andy,
    You should contact support with regards to this issue. It is a known
    problem, you can reference CR042529.
    Cheers!
    Adam
    "Andy Kimbrough" <[email protected]> wrote in message
    news:3ae8b1f7$[email protected]..
    randomly I get the following error in my weblogic.log. The server stopsresponding and I get about a million of these entries, what is going on? I
    am running on Linux 6.2....<Error> <Posix Performance Pack>
    <mdw2.neomorphic.com> <myserver> <ExecuteThread: '49' for queue: 'default'>
    <><><00000><Uncaught Throwable in processSockets>java.io.IOException:
    unexpected result from poll: -1at weblogic.socket.PosixSocketMuxer.pool
    (Native Method)at weblogic.socket.PosixSocketMuser.processSocktesat
    weblogic.socket.SocketReaderRequest.executeat
    weblogic.kernel.ExecuteThread.executeat weblogic.kernel.ExceuteThread.run

  • Colors in JTable - unexpected result when scrolling

    Hi Guys,
    Looks like I'm having a problem with a JTable.
    I have a list of items and they are distinguished by 2 colors (so the end-user can differentiate between them). Anyway, the table colors work ok but when using a JScrollbar the table receives an unexpected result � few of the first items (which are not identical) share the same color.
    anyone?
    Example of an output (Gil will be colored Green, Dan Yellow, James Green�and so forth)
    Gil
    Gil
    Gil
    Dan
    Dan
    Dan
    James
    James
    James
    James
    my code looks like this (I'll appritiate if someone can point out where I can have the html tags to display it correctly)
    aTable = new JTable(dataModel)
    public Component prepareRenderer(TableCellRenderer r, int row, int col)
    Component c = super.prepareRenderer(r, row, col);
    Color bg = Color.YELLOW;
    String[] valuesRaw = (String[]) model.elementAt(row);
    if (changeRround)
    name1=valuesRaw[0];
    changeRround=false;
    name2=valuesRaw[0];
    if (!name1.equals(name2))
    this.switchColor(bg,c);
    changeRround=true;
    return c;
    public void switchColor(Color bg, Component c)
    if (colorSwitcher%2==0)
    bg = new Color(221, 250, 207);
    c.setBackground(bg);
    c.setForeground(Color.BLACK);
    else
    bg = new Color(253, 252, 193);
    c.setBackground(bg);
    c.setForeground(Color.BLACK);
    colorSwitcher++;
    }

    I'm getting there...
            aTable = new JTable(dataModel)
                public Component prepareRenderer(TableCellRenderer r, int row, int col)
                     Component c = super.prepareRenderer(r, row, col);
                     Color bg = Color.YELLOW;         
                     String[] valuesRaw = (String[]) model.elementAt(row);         
                     if (changeRround)
                         name1=valuesRaw[0];
                         changeRround=false;
                         name2=valuesRaw[0];
                     if (name1.equals(name2))
                     else
                         this.switchColor(bg,c);                    
                         changeRround=true;
                     return c;
                 public void switchColor(Color bg, Component c)
                    if (colorSwitcher%2==0)
                        bg = new Color(221, 250, 207);
                        c.setBackground(bg);
                        c.setForeground(Color.BLACK);
                    else
                        bg = new Color(253, 252, 193);
                        c.setBackground(bg);
                        c.setForeground(Color.BLACK);
                    colorSwitcher++;
                }

  • Select for update gives wrong results. Is it a bug?

    Hi,
    Select for update gives wrong results. Is it a bug?
    CREATE TABLE TaxIds
    TaxId NUMBER(6) NOT NULL,
    LocationId NUMBER(3) NOT NULL,
    Status NUMBER(1)
    PARTITION BY LIST (LocationId)
    PARTITION P111 VALUES (111),
    PARTITION P222 VALUES (222),
    PARTITION P333 VALUES (333)
    ALTER TABLE TaxIds ADD ( CONSTRAINT PK_TaxIds PRIMARY KEY (TaxId));
    CREATE INDEX NI_TaxIdsStatus ON TaxIds ( NVL(Status,0) ) LOCAL;
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100101, 111, NULL);
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100102, 111, NULL);
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100103, 111, NULL);
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100104, 111, NULL);
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (200101, 222, NULL);
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (200102, 222, NULL);
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (200103, 222, NULL);
    --Session_1 return TAXID=100101
    select TAXID from TAXIDS where LOCATIONID=111 and NVL(STATUS,0)=0 AND rownum=1 for update
    --Session_2 waits commit
    select TAXID from TAXIDS where LOCATIONID=111 and NVL(STATUS,0)=0 AND rownum=1 for update
    --Session_1
    update TAXIDS set STATUS=1 Where TaxId=100101;
    commit;
    --Session_2 return 100101 opps!?
    --Session_1 return TAXID=100102
    select TAXID, STATUS from TAXIDS where LOCATIONID=111 and NVL(STATUS,0)=0 AND rownum=1 for update
    --Session_2 waits commit
    select TAXID, STATUS from TAXIDS where LOCATIONID=111 and NVL(STATUS,0)=0 AND rownum=1 for update
    --Session_1
    update TAXIDS set STATUS=1 Where TaxId=100102;
    commit;
    --Session_2 return 100103                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    This is a bug. Got to be a bug.
    This should be nothing to do with indeterminate results from ROWNUM, and nothing to do with read consistency at the point of statement start time in session2., surely.
    Session 2 should never return 100101 once the lock from session 1 is released.
    The SELECT FOR UPDATE should restart and 100101 should not be selected as it does not meet the criteria of the select.
    A statement restart should ensure this.
    A number of demos highlight this.
    Firstly, recall the original observation in the original test case.
    Setup
    SQL> DROP TABLE taxids;
    Table dropped.
    SQL> 
    SQL> CREATE TABLE TaxIds
      2  (TaxId NUMBER(6) NOT NULL,
      3   LocationId NUMBER(3) NOT NULL,
      4   Status NUMBER(1))
      5  PARTITION BY LIST (LocationId)
      6  (PARTITION P111 VALUES (111),
      7   PARTITION P222 VALUES (222),
      8   PARTITION P333 VALUES (333));
    Table created.
    SQL>
    SQL> ALTER TABLE TaxIds ADD ( CONSTRAINT PK_TaxIds PRIMARY KEY (TaxId));
    Table altered.
    SQL>
    SQL> CREATE INDEX NI_TaxIdsStatus ON TaxIds ( NVL(Status,0) ) LOCAL;
    Index created.
    SQL>
    SQL>
    SQL> Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100101, 111, NULL);
    1 row created.
    SQL> Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100102, 111, NULL);
    1 row created.
    SQL> Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100103, 111, NULL);
    1 row created.
    SQL> Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100104, 111, NULL);
    1 row created.
    SQL> Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (200101, 222, NULL);
    1 row created.
    SQL> Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (200102, 222, NULL);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> Original observation:
    Session1>SELECT taxid
      2  FROM   taxids
      3  WHERE  locationid    = 111
      4  AND    NVL(STATUS,0) = 0
      5  AND    ROWNUM        = 1
      6  FOR UPDATE;
         TAXID
        100101
    Session1>
    --> Session 2 with same statement hangs until
    Session1>BEGIN
      2   UPDATE taxids SET status=1 WHERE taxid=100101;
      3   COMMIT;
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    Session1>
    --> At which point, Session 2 returns
    Session2>SELECT taxid
      2  FROM   taxids
      3  WHERE  locationid    = 111
      4  AND    NVL(STATUS,0) = 0
      5  AND    ROWNUM        = 1
      6  FOR UPDATE;
         TAXID
        100101
    Session2>There's no way that session 2 should have returned 100101. That is the point of FOR UPDATE. It completely reintroduces the lost UPDATE scenario.
    Secondly, what happens if we drop the index.
    Let's reset the data and drop the index:
    Session1>UPDATE taxids SET status=0 where taxid=100101;
    1 row updated.
    Session1>commit;
    Commit complete.
    Session1>drop index NI_TaxIdsStatus;
    Index dropped.
    Session1>Then try again:
    Session1>SELECT taxid
      2  FROM   taxids
      3  WHERE  locationid    = 111
      4  AND    NVL(STATUS,0) = 0
      5  AND    ROWNUM        = 1
      6  FOR UPDATE;
         TAXID
        100101
    Session1>
    --> Session 2 hangs again until
    Session1>BEGIN
      2   UPDATE taxids SET status=1 WHERE taxid=100101;
      3   COMMIT;
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    Session1>
    --> At which point in session 2:
    Session2>SELECT taxid
      2  FROM   taxids
      3  WHERE  locationid    = 111
      4  AND    NVL(STATUS,0) = 0
      5  AND    ROWNUM        = 1
      6  FOR UPDATE;
         TAXID
        100102
    Session2>Proves nothing, Non-deterministic ROWNUM you say.
    Then let's reset, recreate the index and explicity ask then for row 100101.
    It should give the same result as the ROWNUM query without any doubts over the ROWNUM, etc.
    If the original behaviour was correct, session 2 should also be able to get 100101:
    Session1>SELECT taxid
      2  FROM   taxids
      3  WHERE  locationid    = 111
      4  AND    NVL(STATUS,0) = 0
      5  AND    taxid         = 100101
      6  FOR UPDATE;
         TAXID
        100101
    Session1>
    --> same statement hangs in session 2 until
    Session1>BEGIN
      2   UPDATE taxids SET status=1 WHERE taxid=100101;
      3   COMMIT;
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    Session1>
    --> so session 2 stops being blocked and:
    Session2>SELECT taxid
      2  FROM   taxids
      3  WHERE  locationid    = 111
      4  AND    NVL(STATUS,0) = 0
      5  AND    taxid         = 100101
      6  FOR UPDATE;
    no rows selected
    Session2>Of course, this is how it should happen, surely?
    Just to double check, let's reintroduce ROWNUM but force the order by to show it's not about read consistency at the start of the statement - restart should prevent it.
    (reset, then)
    Session1> select t.taxid
      2   from
      3    (select taxid, rowid rd
      4      from   taxids
      5      where  locationid = 111
      6      and    nvl(status,0) = 0
      7      order by taxid) x
      8   ,  taxids t
      9   where t.rowid = x.rd
    10   and   rownum = 1
    11   for update of t.status;
         TAXID
        100101
    Session1>
    --> Yes, session 2 hangs until...
    Session1>BEGIN
      2   UPDATE taxids SET status=1 WHERE taxid=100101;
      3   COMMIT;
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    Session1>
    --> and then
    Session2> select t.taxid
      2   from
      3    (select taxid, rowid rd
      4      from   taxids
      5      where  locationid = 111
      6      and    nvl(status,0) = 0
      7      order by taxid) x
      8   ,  taxids t
      9   where t.rowid = x.rd
    10   and   rownum = 1
    11   for update of t.status;
         TAXID
        100102
    Session2>Session 2 should never be allowed to get 100101 once the lock is released.
    This is a bug.
    The worrying thing is that I can reproduce in 9.2.0.8 and 11.2.0.2.

  • Custom search using boolean attribute set to True gives no result

    I am setting up an auto-query using the custom search portlet. This is to show all items where a boolean custom attribute is checked, ie = True.
    In step 3 I have tried to set the operator to Equals to and the default value to True. This gives no results even though several items have this attribute set to True.
    The Auto Query check box is checked.

    Found that True = 1 in database. When set to this the search works.

  • How to add a dummy row in the result set of a SELECT statement.

    Hello Everyone -
    I have requirment to add a dummy row in the result set of a SELECT statement.
    For e.g. lets say there is a table Payment having following colums:
    Payment_id number
    status varchar2(10)
    amount number
    payment_date date
    so here is the data :-
    Payment_id Status Amount payment_date
    1 Applied 100 12/07/2008
    2 Reversed 200 01/ 06/2009
    3 Applied 300 01/ 07/2009
    Here is my SQL
    Select * form payment where payment_date >= 01/01/2009
    Output will be
    2 Reversed 200 01/ 06/2009
    3 Applied 300 01/ 07/2009
    My desired output is below
    2 Reversed 200 01/ 06/2009
    3 Applied 300 01/ 07/2009
    2 Reversed -200 01/ 06/2009 ------(Dummy Row)
    Thrid row here is the dummy row which I want to add when status is "Reversed"
    I would be very thankful for any kind of help in this regard ...
    Thanks,
    Gaurav

    Cartesion joining against a dummy table is a useful method of creating a dummy row:
    with my_tab as (select 1 cust_id, 1 Payment_id, 'Applied' Status, 100 Amount, to_date('12/07/2008', 'mm/dd/yyyy') payment_date from dual union all
                    select 1 cust_id, 2 Payment_id, 'Reversed' Status, 200 Amount, to_date('01/06/2009', 'mm/dd/yyyy') payment_date from dual union all
                    select 1 cust_id, 3 Payment_id, 'Applied' Status, 300 Amount, to_date('01/06/2009', 'mm/dd/yyyy') payment_date from dual union all
                    select 2 cust_id, 1 Payment_id, 'Applied' Status, 100 Amount, to_date('12/07/2008', 'mm/dd/yyyy') payment_date from dual union all
                    select 2 cust_id, 2 Payment_id, 'Reversed' Status, 200 Amount, to_date('01/05/2009', 'mm/dd/yyyy') payment_date from dual union all
                    select 2 cust_id, 3 Payment_id, 'Applied' Status, 300 Amount, to_date('01/06/2009', 'mm/dd/yyyy') payment_date from dual union all
                    select 2 cust_id, 4 Payment_id, 'Reversed' Status, -400 Amount, to_date('01/06/2009', 'mm/dd/yyyy') payment_date from dual union all
                    select 2 cust_id, 5 Payment_id, 'Applied' Status, 500 Amount, to_date('01/07/2009', 'mm/dd/yyyy') payment_date from dual),
                    --- end of mimicking your table
          dummy as (select 'Reversed' col1, 1 rn from dual union all
                    select 'Reversed' col1, 2 rn from dual)
    select mt.cust_id,
           mt.payment_id,
           mt.status,
           decode(dummy.rn, 2, -1*mt.amount, mt.amount) amount,
           mt.payment_date
    from   my_tab mt,
           dummy
    where  mt.status = dummy.col1 (+)
    order by mt.cust_id, mt.payment_id, dummy.rn nulls first;
    CUST_ID     PAYMENT_ID     STATUS     AMOUNT     PAYMENT_DATE
    1     1     Applied     100     07/12/2008
    1     2     Reversed     200     06/01/2009
    1     2     Reversed     -200     06/01/2009
    1     3     Applied     300     06/01/2009
    2     1     Applied     100     07/12/2008
    2     2     Reversed     200     05/01/2009
    2     2     Reversed     -200     05/01/2009
    2     3     Applied     300     06/01/2009
    2     4     Reversed     -400     06/01/2009
    2     4     Reversed     400     06/01/2009
    2     5     Applied     500     07/01/2009Edited by: Boneist on 07-Jan-2009 23:10
    NB. You may have to mess around with the ordering if that's not come back in the order you wanted. You didn't mention what the rules were for any expected ordering though, so I've made up my own *{;-)
    Also, I added an identifier (cust_id) to differentiate between different sets of payments, since that's usually the case. Remove that if it's not applicable for your case.

Maybe you are looking for

  • DB Adapter -Polling SQL and  After Read SQL:

    Hi.., I have DB adapter Configured for logical delete. Here is the SQLs Polling SQL: SELECT LOG_ID, ORG_ID, ROUTE, ATTRIBUTE9 FROM GETS_UX.GETS_UX_PROF_TRANS_LOG WHERE (((ROUTE = 'ERP INBOUND') AND (((ORG_ID = 123) OR (ORG_ID = 234)) OR (ORG_ID = 5))

  • CCM 200 and other related documents.

    Hi SRM Experts, Could anybody send me CCM 200 configuration docuements at my mail id [email protected] I shall reward you with points. Thanks in advance, Vatan

  • Anyone not having trouble with Airport?

    Leopard sits on a shelf, still unloaded. I read here and elsewhere of so many problems with connecting to one's Airport or other wireless router that I'm content to wait till there's an upgrade to fix the problem. But I'm curious... Is there anyone w

  • Extending the Hunting time on a Hunt Group CUCM 8.5.1

    Good afternoon.  We are trying to implement a hunt group for our main switchboard.  The scenario would be all calls to the home office come into a hunt pilot and then hunt, top down, to the main switchboard extension and then to a choice of 3 other d

  • Apple Hardware Test launches Open Firmware window

    At work, I have a 2.3 GHz Dual-Core G5. When I run Apple Hardware Test [Extended], it generates an Open Firmware window in the lower-left corner at 11 minutes. Has anyone else seen this?