Sort records !!!

Hi Gurus,
The requirement I have here is in a custom form(oracle forms 4.5). User want that when they open the form they want all the records whose checkbox is checked at the top.It is a multi record block. The check box is a non database item.The value in the check box is populated during run time. This piece of code is in the program unit.
To fix it I used the order by property in the property pallette of the block and added the clause" :block_name.checkbox_name desc". But when I opened the form in apps. it is throwing the error FRM 40505 cannot perform the query and sql command not properly ended. I again used a post query trigger at block level and used this set_block_property('block_name',order_by,'block.item');
This yielded no result either. Do I have to change any properties to bring this into effect? Suggestions are really appreciated.

Since it is not in the database table, you cannot sort on it. Oracle does the sorting before your form even fetches the first row.
How complex is the logic to determine the checkbox value? Maybe it can be included in the select... or you can create a stored function in the database that returns the checkbox value, and use it in your order by clause.

Similar Messages

  • How can we sort records in alv, give example

    how can we sort records in alv, give example

    Hi
    <b>Setting Sort Conditions</b>
    It is possible to set sort conditions for the table data. This is achieved by filling an internal table of structure “LVC_T_SORT” which consists of the sort criteria. To have an initial sorting, pass it to the parameter “IT_SORT” of the method “set_table_for_first_display”.
    FORM prepare_sort_table CHANGING pt_sort TYPE lvc_t_sort .
    DATA ls_sort TYPE lvc_s_sort .
    ls_sort-spos = '1' .
    ls_sort-fieldname = 'CARRID' .
    ls_sort-up = 'X' . "A to Z
    ls_sort-down = space .
    APPEND ls_sort TO pt_sort .
    ls_sort-spos = '2' .
    ls_sort-fieldname = 'SEATSOCC' .
    ls_sort-up = space .
    ls_sort-down = 'X' . "Z to A
    APPEND ls_sort TO pt_sort .
    ENDFORM. " prepare_sort_table
    <b>Preparing the table for sorting settings</b>
    We have two important points to tell about this topic. First one is that, be ready for a short dump if any one of the fields given to be sorted is not in the content of the field catalog. Secondly, when you make ALV Grid to sort data, by default it vertically merges fields having the same content. To avoid from this for all of the columns, you can set “no_merging” field of the layout structure to ‘X’. If you want to disable merging for just some columns, set “no_merging” field of the field catalog row corresponding to that column.
    You can get and set sort criteria applied whenever you want by using methods “get_sort_criteria” and “set_sort_criteria”, respectively.
    <b>
    Sort Using FACTORY CLASSES</b>
    <b>Sorts – CL_SALV_SORTS</b>
    we can add some sorting to the ALV grid. Create the object reference variable and receive the object using the GET_SORTS method of the GR_TABLE object. Next, add the sort by calling the ADD_SORT method of the GR_SORTS object.
    report zalvom_demo1.
    data: ispfli type table of spfli.
    data: gr_table type ref to cl_salv_table.
    data: gr_functions type ref to cl_salv_functions.
    data: gr_display type ref to cl_salv_display_settings. data: gr_columns type ref to cl_salv_columns_table.
    data: gr_column type ref to cl_salv_column_table.
    data: gr_sorts type ref to cl_salv_sorts.
    data: color type lvc_s_colo.
    start-of-selection.
    select * into table ispfli from spfli. cl_salv_table=>factory( importing r_salv_table = gr_table   changing t_table = ispfli ).
    gr_functions = gr_table->get_functions( ). gr_functions->set_all( abap_true ).
    gr_display = gr_table->get_display_settings( ). gr_display->set_striped_pattern( cl_salv_display_settings=>true ). gr_display->set_list_header( 'This is the heading' ). gr_columns = gr_table->get_columns( ).
    gr_column ?= gr_columns->get_column( 'CITYTO' ). gr_column->set_long_text( 'This is long text' ). gr_column->set_medium_text( 'This is med text' ). gr_column->set_short_text( 'This is sh' ).
    gr_column ?= gr_columns->get_column( 'CITYFROM' ). color-col = '6'.
    color-int = '1'.
    color-inv = '0'.
    gr_column->set_color( color ).
    gr_sorts = gr_table->get_sorts( ).
    gr_sorts->add_sort 'CITYTO' ).
    gr_table->display( ).
    Regards
    Ravish
    <b><i>
    Reward if useful to you</i></b>
    Message was edited by:
            Ravish Garg

  • Does cleaning sort records and impact on max log size

    I'm looking for confirmation that the act of cleaning logs produces sorted records, equivalent to having inserted them in sorted order to begin with. If that is the case is the memory overhead of cleaning proportional to the maximum log file size, or will it spill to disk to sort? I ask since the max log file size is 1G, and if there is a memory component then it may be relevant to take into consideration.
    On a similar note, is increasing the log file size from 10MB recommended if the database is large (say a TB)? Are there some linear operations (most likely in the admin/maintenance category) that have to iterate over each log file?
    Thanks.

    Hi,
    I'm looking for confirmation that the act of cleaning logs produces sorted records, equivalent to having inserted them in sorted order to begin with.No, that's not exactly true. When records are written (migrated to the end of the log) during the log cleaning process, any clustering (writing of adjacent records in key order) occurs on a per BIN (bottom internal node) basis. So at most 128 records (or DatabaseConfig.setNodeMaxEntries) with adjacent key values are sorted and written out together in this manner. But normally not all records in a BIN will be migrated and I'll describe more about this below.
    If that is the case is the memory overhead of cleaning proportional to the maximum log file size, or will it spill to disk to sort? I ask since the max log file size is 1G, and if there is a memory component then it may be relevant to take into consideration.No, the memory used for sorting in this case is the JE cache itself -- the memory that holds the Btree. The log cleaner thread moves records to be migrated into the Btree (in the cache), and flags them for migration. These records are written lazily the next time their parent Btree node (the BIN I mentioned) needs to be flushed. This can occur for two reasons: 1) when the BIN is evicted from the cache because the cache is full, or 2) during the next checkpoint, since a checkpoint will flush all dirty BINs. The most desirable situation is that the BIN is flushed during the checkpoint, not during eviction, to reduce the number of times that a single BIN is flushed to disk. If a BIN is evicted, it may have to be fetched again later in order to migrate more records as part of the log cleaning process, and this is counterproductive.
    So during this process, the number of records that are written to disk in key order in a cluster, such that they are physically adjacent on disk, is variable. It depends on how many records are processed by cleaner threads, and inserted in their parent BIN for migration, between checkpoint intervals, and whether the BINs are evicted during this period.
    A physical cluster of records includes the BIN itself as well as its child records that are migrated for log cleaning. The fact that the BIN is part of the cluster is beneficial to apps where not all BINs fit in the cache. If a record and its parent BIN are not in cache, and the app reads that record, the BIN and the record must both be fetched from disk. Since they will be in physical proximity to each other on disk, disk head movement is avoided or reduced.
    However, not all of the child records in a BIN will necessarily be part of a physical cluster. If only some of the records in a BIN were processed by the log cleaner before the BIN is flushed by the checkpointer or evictor, then only a subset of the child records will be written as part of the cluster. In other words, even for a single BIN, all the child records in that BIN are not normally written out together in a cluster.
    Clustering is a useful feature and something we would like to enhance in the future. What I've described above is as far as we've gotten with this feature in the currently released and supported product. However, there are two experimental configuration settings that cause additional clustering to occur. These cause additional records to be written to disk when their parent BIN is flushed. If you're interested in trying these, I will be happy to explain them and work with you. But you should be aware that they're not currently in the standard, supported set of features, and are not well tested.
    I'm not sure whether I've given you less information than you need or more than you wanted. :-) If you describe in detail what you're trying to do, and more about your app and performance requirements, I may be able to offer more concrete advice.
    On a similar note, is increasing the log file size from 10MB recommended if the database is large (say a TB)? Are there some linear operations (most likely in the admin/maintenance category) that have to iterate over each log file?Yes, there are such operations and per-log file overhead, and we recommend using using a 20M to 50M log file size for large data sets. Log files larger than 50MB could decrease log cleaner performance.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Sort record!!

    Hi Experts,
    My scenario is FILE to FILE
    1 file to N file
    source file will contains multiple records.
    i need to create target file depending upon the company code.
    suppose i have 100 record in source file with
    30 records with companyCode US
    30 records with companyCode UK
    40 records with companyCode DK...
    so i have to create 3 target file  and need to push 30 US record into a FILE.US
    30 UK record into FILE.UK and
    40 DK record into FILE.DK
    can anyone gone thro such requirement??/

    SplitByValue function may help:
    Message Splitting Using the Graphical Mapping Tool
    i would do something like this:
    Field(context change to obtain the whole queue) => sort/sortbyKey (sort is enough in order to order the data, sortbykey is used if u need to order based in another field from another queue but they would have to be equals) => splitByvalue("value change" , that would create a new context for each separate value)
    That would create 3 big queues with the values you want
    - For the header target u may want to use Collapse context function which will leave u with one context per value because if you have 3 types and 30 types of values, for the header segment you  only want to know that these are 3 segments:
    context:
    DK
    DK
    DK
    UK
    UK
    UK
    US
    US
    after collapse:
    DK
    UK
    US
    - For item level you would maintain the same logic (without the collapse) because per one "DK"/"UK"/"US" segment you would need to map the corresponding quantity obtaining one header DK and 3 items, one header UK and 3 items, one "US" with two items
    Hope it's clear!

  • Sorting records problem in BOE

    Hi all.
    I have a problem. I have created a new Crystal Reports Report which I uploaded to BOE. I tested it firstly locally in my machine, refreshing it through Crystal Reports  at design time. It gives me the results I want.
    This reports gets called from another application via URL using the opendocument command. Such application sends the proper parameters to my report when I upload it to BOE. The BOE server connects to the same DatabaseServer which I get connected locally. The problem comes when I execute the Report in BOE through the opendocument command, cause it sorts the records in a different order from the order I get when I run it locally which is a big issue since the main functionality of this report is based on the order it presents the information.
    The DataSource  for my Report is an Oracle Stored Procedure.
    This would be the output of my local Report (It would be clearer if I could upload the PDF file itself, but I'm afraid I can't)
    CPM FOP_01 Produccion
         CPM FOP_01 C2 Produccion
              Cemento Granel Tipo V
              Clinker Gris 02 Tipo I
              Harina Gris - es
    CPM FOP_01 Inventarios
         CPM FOP_01 C2 Inventarios Amounts
         CPM FOP_01 C2 Inventarios Units
    CPM FOP_01 C1 Income
         Own production
    This would be the output of the Report called from the application.  As you can see the record containing CPM FOP_01 C1 Spread should not be placed there, according to my local test
    CPM FOP_01 Produccion
         CPM FOP_01 C2 Produccion
              Cemento Granel Tipo V
              Clinker Gris 02 Tipo I
              Harina Gris - es
    CPM FOP_01 C1 Spread
    CPM FOP_01 Inventarios
         CPM FOP_01 C2 Inventarios Amounts
         CPM FOP_01 C2 Inventarios Units
    CPM FOP_01 C1 Income
         Own production
    The record containing CPM FOP_01 C1 Spread does exist in my report, but should be placed in another section below the section it is placed now.
    Besides, the report in BOE is doing weird things such as hiding some totals is should not hide.
    I wonder is this has something to do with some sort of problem involving the services, or maybe some cache memory or something alike. I tried as many things as have come to my mind in order to solve this issue, but now I'm out of ideas.
    As always, any help will be very useful for me and my team
    Edited by: GABRIEL SANCHEZ VALDEZ on Jun 22, 2010 7:11 PM

    Hi Gabriel,
    Since you are a BOE user you should also have a support contract. I suggest you log a new case and get a Support engineer working with your directly. Then you can attach the PDF to the case.
    Thank you
    Don
    Also, I am moving this post to the BOE forum.

  • Sort records in a csv file in the descending order of time created attribute

    I have an excel (.csv) file with the following column headers :-
    Client, 
    SourceNetworkAddress
    ,TimeCreated,
     LogonType
    ,User,
    Message
    Values like :- ABC, 10.5.22.27, 11/23/2014 9:02:21 PM, 10, testuser
    The file is a combination of a report generated everyday using multiple scripts. The data is appended each day therefore, I would like to sort the final output file in descending order of time created (a combination of date and time) fetched from events
    i.e. the latest record with the latest date and time should be at the top of the list.
    I tried using the following command however, I get a sorted list according to the date but not the time. The command does not consider the AM/PM mentioned in the time instead simply sorts them as per numbers 
    Import-Csv "C:\Users\a\Desktop\report.csv" | sort Timecreated -Descending | Export-csv "C:\Users\a\Desktop\report_sorted.csv" -force -NoTypeInformation
    So if I have a record with 9:02:21 PM(latest) and a record with time 10.44.10 AM on the same date, the command will sort the list with record 10:44:10 AM first and then record with 9:02:21 PM however it should be the opposite as per descending order.
    Kindly help !!

    Hi jrv,
    Thanks for your response. However, I get errors while I run this command in Powershell :-
    Import-Csv <file> | Select Client,SourceNetworkAddress,LogonType,User,Message,@{N='TimeCreated';E={[datetime]($_.TimeCreated)} | Sort TimeCreated -Descending | Export-csv <file> -force -NoTypeInformation
    Missing expression after ','.
    At line:1 char:150
    Unexpected token 'LogonType' in expression or statement.
    At line:1 char:151
    Unexpected token ',' in expression or statement.
    At line:1 char:160
    Unexpected token 'User' in expression or statement.
    At line:1 char:161
    Unexpected token ',' in expression or statement.
    At line:1 char:165
    Unexpected token 'Message' in expression or statement.
    At line:1 char:166
    The hash literal was incomplete.
    At line:1 char:174
    Please help!
    You are missing a second curly brace - 
    Import-Csv <file> | Select Client,SourceNetworkAddress,LogonType,User,Message,@{N='TimeCreated';E={[datetime]($_.TimeCreated)}} | Sort TimeCreated -Descending | Export-csv <file> -force -NoTypeInformation

  • Sorting records based on multiple columns

    Hi All,
    Please provide SQK query to sort the records in multiple columns
    based on NON NULL and NULL values.
    SID SNUMBER UNIT COUNTRY  STATE
    0 M14762 DE 0
    NULL    NULL            NULL    NULL
    0 990 GB
    0 M14704 IE 0
      M14767 IE 0
    0 M14704 FR 0
    0 M15351 990 GB
              FR 0
    0 D10693 800 GB 0
    NULL    NULL            NULL    NULL
    0 D10693 800 GB 0
    If all column values are NOT NULL those records should come first.
    If first column(SID) values are NOT NULL those records should come next.
    If second column(SNUMBER) values are NOT NULL those records should come next.
    If third column(UNIT) values are NOT NULL those records should come next.
    If fourth column(COUNTRY) values are NOT NULL those records should come next.
    If fifth column(STATE) values are NOT NULL those records should come next.
    If all the column values are NULL those records should come last.
    The output should be like this.
    SID SNUMBER UNIT COUNTRY  STATE
    0 D10693 800 GB 0
    0 D10693 800 GB 0
    0 M14762 DE 0
    0 990 GB
    0 M14704 IE 0
    0 M14704 FR 0
    0 M15351 990 GB
      M14767 IE 0
              FR 0
    NULL    NULL            NULL    NULL
    NULL    NULL            NULL    NULL
    Please help me.
    Thanks.

    Hi,
           For Your Requirement,
    SELECT COALESCE (SID, snumber, unit, country, state) SID,
           (CASE
               WHEN SID IS NULL
               AND snumber IS NOT NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NOT NULL
                  THEN unit
               WHEN SID IS NOT NULL
               AND snumber IS NULL
               AND country IS NOT NULL
               AND unit IS NOT NULL
               AND state IS NOT NULL
                  THEN unit
               WHEN SID IS NOT NULL AND snumber IS NOT NULL
                  THEN snumber
               WHEN SID IS NULL
               AND snumber IS NULL
               AND unit IS NULL
               AND country IS NOT NULL
               AND state IS NOT NULL
                  THEN state
               WHEN SID IS NULL
               AND snumber IS NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NOT NULL
                  THEN country
               WHEN SID IS NOT NULL
               AND snumber IS NULL
               AND unit IS NOT NULL
               AND country IS NULL
               AND state IS NOT NULL
                  THEN unit
               WHEN SID IS NULL
               AND snumber IS NOT NULL
               AND unit IS NULL
               AND country IS NOT NULL
               AND state IS NULL
                  THEN country
               WHEN SID IS NULL
               AND snumber IS NOT NULL
               AND unit IS NULL
               AND country IS NULL
               AND state IS NOT NULL
                  THEN state
               WHEN SID IS NOT NULL
               AND snumber IS NULL
               AND unit IS NOT NULL
               AND country IS NULL
               AND state IS NULL
                  THEN unit
               WHEN SID IS NOT NULL
               AND snumber IS NULL
               AND unit IS NULL
               AND country IS NOT NULL
               AND state IS NULL
                  THEN country
               WHEN SID IS NOT NULL
               AND snumber IS NULL
               AND unit IS NULL
               AND country IS NULL
               AND state IS NOT NULL
                  THEN state
               WHEN SID IS NULL
               AND snumber IS NOT NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NULL
                  THEN snumber
               WHEN SID IS NULL
               AND snumber IS NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NULL
                  THEN country
                  when sid is not null and snumber is null and unit is null and country is not null and state is not null then country
               ELSE NULL
            END
           ) snumber,
           (CASE
               WHEN SID IS NOT NULL
               AND snumber IS NOT NULL
               AND unit IS NULL
               AND country IS NOT NULL
               AND state IS NOT NULL
                  THEN country
               WHEN SID IS NOT NULL
               AND snumber IS NOT NULL
               AND unit IS NOT NULL
               AND country IS NULL
               AND state IS NOT NULL
                  THEN unit
               WHEN SID IS NULL AND snumber IS NOT NULL AND unit IS NOT NULL
                  THEN country
               WHEN SID IS NOT NULL
               AND snumber IS NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NOT NULL
                  THEN country
               WHEN SID IS NOT NULL
               AND snumber IS NOT NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NULL
                  THEN unit
               WHEN SID IS NOT NULL AND snumber IS NOT NULL AND unit IS NOT NULL
                  THEN unit
               WHEN SID IS NULL
               AND snumber IS NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NOT NULL
                  THEN state
               WHEN SID IS NOT NULL
               AND snumber IS NULL
               AND unit IS NOT NULL
               AND country IS NULL
               AND state IS NOT NULL
                  THEN state
               WHEN SID IS NOT NULL
               AND snumber IS NOT NULL
               AND unit IS NULL
               AND country IS NULL
               AND state IS NOT NULL
                  THEN state
               WHEN SID IS NOT NULL
               AND snumber IS NOT NULL
               AND unit IS NULL
               AND country IS NOT NULL
               AND state IS NULL
                  THEN country
                  when sid is not null and snumber is null and unit is null and country is not null and state is not null then state
               ELSE NULL
            END
           ) unit,
           (CASE
               WHEN SID IS NOT NULL
               AND snumber IS NOT NULL
               AND unit IS NOT NULL
               AND country IS NULL
               AND state IS NOT NULL
                  THEN state
               WHEN SID IS NOT NULL
               AND snumber IS NOT NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NULL
                  THEN country
               WHEN SID IS NOT NULL
               AND snumber IS NOT NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
                  THEN country
               WHEN SID IS NULL
               AND snumber IS NOT NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NOT NULL
                  THEN state
               WHEN SID IS NOT NULL
               AND snumber IS NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NOT NULL
                  THEN state
               WHEN SID IS NOT NULL
               AND snumber IS NOT NULL
               AND unit IS NULL
               AND country IS NOT NULL
               AND state IS NOT NULL
                  THEN state
               ELSE NULL
            END
           ) country,
           (CASE
               WHEN SID IS NOT NULL
               AND snumber IS NOT NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NOT NULL
                  THEN state
               ELSE NULL
            END
           ) state
      FROM tablx;
    Cheers...

  • Table.Sort only sorting records in preview pane

    I have the following M query:
    let
        OrgIdParameter = Excel.CurrentWorkbook(){[Name="ClientFilter"]}[Content],
        OrgIdValue = OrgIdParameter{0}[Column2],
        Source = Sql.Database("JOHNSQLD53", "EnterpriseAnalytics"),
        dbo_vFactEngrgServiceLocMonthlyAsOfSnapshot = Source{[Schema="dbo",Item="vFactEngrgServiceLocMonthlyAsOfSnapshot"]}[Data],
        #"Filtered Rows" = Table.SelectRows(dbo_vFactEngrgServiceLocMonthlyAsOfSnapshot, each [BeProspectClientOrgId] = OrgIdValue),
        #"Sorted Rows" = Table.Sort(#"Filtered Rows",{{"SnapshotYear", Order.Ascending}})
    in
        #"Sorted Rows"
    however, the sort is working on the records that show in the preview pane (about 36 records), then the data goes back to being unsorted in the rest of the table when loaded in power pivot (224 rows).
    any idea why?

    I believe that Power Pivot does not reliably preserve the input sort of the data; this is a feature of the data model, not of Power Query.

  • Sort records when there is no timestamp

    Hello All,
    I'd like to know how we can do a sort based on timestamp on an oracle table when there is no timestamp column. I have a table
    create table x_log (A varchar,B varchar,C varchar); /* note I do not have a timestamp col */
    I'd like to know if its possible to find the records updated/inserted on an hourly basis for about a week's time. I do not have timestamp column here. Any help in this regard is greatly appreciated.
    Thanks All.

    of course it can be accomplished and you have more than one option, I would start with (2) in your case
    1. trigger - you use setup UPDATE trigger on that table, it would then do whatever you want after anybody runs update, ...
    2. use ORA_ROWSCN pseudo column - this is a sequence column but at the end can tell you when each record was updated http://blog.tanelpoder.com/2009/02/07/when-was-a-table-last-changed/
    3. use data change notification http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_dcn.htm

  • Sort Record By select different critirea in listbox

    I would like to a sorting for my records....which when user select a option let's say name from the listbox....The records which already displayed on JSP page need to be sorted according to 'name'
    Anyone knows how to do it?
    Thank You In advanced....

    Use this code in your jsp
    String sortby_param=request.getParameter("sortby");
    // "sortby" name of u r field
    String Sql="select * from emp order by'"+sortby_param+"'";
    Hope it helps

  • Sorting records in FM Data Retraction

    Hi all,
    In our project we use Data Retraction from BPS to R/3 Funds Management (Former Budgeting, transaction FMBPRET). We want to influence the order in which records are transferred from BW to R/3. Although we can use the sort functions in the BW query, this does not influence the order of the records.
    Anyone has a clue?
    Thnx in advance,
    Henk.

    Hi Marc,
    Thanks for your response
    In our case the sort order of the records does matter. I will try to explain shortly:
    - We use SEM-BPS to make a registration of all individual changes on the different budgets (in this case of the Ministry of Transportation of the Netherlands).
    - The individual changes (pointed by a characteristic “Document Number” need several approval steps. At the end all individual changes are - daily - retracted to FundsManagement in R/3.
    - The changes on the budgets take place on the masterdata of Fundsmanagement: Fundscenters en Commitment Items.
    - Now, take the following situation:
    <b>R/3 Fundsmanagement</b>
    Total budget Fundscenter A/Comm.Item X: 10.000 EUR
    <b>SEM-BPS</b>
    Change 1 on Fundscenter A/Comm.Item X:     -/- 12.000 EUR
    Change 2 on Fundscenter A/Comm.Item X:          5.000 EUR
    - In R/3 Fundsmanagement it’s not allowed to have a negative total budget.
    - So, in this case we first have to post change 2 (total budget: 10.000 + 5.000 = 15.000) and then change 1 (total budget: 15.000 -/- 12.000 = 3.000). The other way around leads for change 1 to a negative budget (10.000 -/- 12.000 = -/- 2.000) and therefore an error in the retraction.
    I hope the situation is more clear now. Many thanks if you can give me a clue for a solution.
    Regards,
    Henk.

  • Sorting records in Sort and Rank report

    I created a Top 10 report based on the Sort and Rank template. The report behaves well at first, giving me 10 records nicely sorted. However, after having run it a few times with various parameters, the sorting seems to be random.
    The EVENE() in cell I33 refers to the row set in cell F5:
    TopCount(Descendants([ENTITY].[RepEntities], 99, LEAVES),10,([ENTITY].CurrentMember,[TIME].[2009.JAN],[RCFINANCE].[31_RC],[CATEGORY].[ACTUAL],[RPTCURRENCY].[LC],[COUNTERPART].[ALL_Counterpart],[MEASURES].[YTD],[DATASRC].[LegalTotal],[ORGANIZATION].[ALL_Organization],[FLOWDETAIL].[All_F]))
    In cell F6, there is an Order expression:
    Order(Descendants([ENTITY].[RepEntities], 99, LEAVES),([ENTITY].CurrentMember,[TIME].[2009.JAN],[RCFINANCE].[31_RC],[CATEGORY].[ACTUAL],[RPTCURRENCY].[LC],[COUNTERPART].[ALL_Counterpart],[MEASURES].[YTD],[DATASRC].[LegalTotal],[ORGANIZATION].[ALL_Organization],[FLOWDETAIL].[All_F]),BDESC)
    However, there seems to be no reference the this expression in EVENE() or elsewhere, which I guess is why the sorting doesn't work.
    Is anyone familiar with the Sort and Rank template and can tell me where to include this Order expression and the syntax for it? My version is 7.0M.
    Cheers,
    Cecilia

    Hi,
    The DB->set_bt_compare() is used to compare keys in Btree database. In the callback function, both the DBTs are key, but not data. Please refer to http://www.oracle.com/technology/documentation/berkeley-db/db/api_reference/C/dbset_bt_compare.html.
    If you want any field in the data to be sorted, you might create a secondary index on it and define the compare function as you wish.
    Regards,
    Emily Fu, Oracle Berkeley DB

  • Sorting records with property values

    Hi Friends,
    Can anybody please suggest a solution/approach for this requirement?
    Lets say,I have 100 records displayed in a non-search results page which are inter-related but they have 2 different inventory properties ex:online_inventory and store_inventory.We are sorting the products by online_inventory property and we are seeing the products displayed in the following order:
    online_instock items--->online_outofstock items--->store_instock items--->store_outofstock items.
    Now,our requirement is to show the products in following order:
    online_instock items--->store_instock items--->online_outofstock items--->store_outofstock items.
    The basic idea is to push the out of stock items at last irrespective of whether it is an online or store product?
    Please note that due to some limitations,we cannot maintain a single inventory property combining online and store inventories.
    Is it possible to apply a sort key here based on a property value or how can we achieve this requirement?
    Regards
    Shreyas

    Shreyas,
    You can do it another way :
    Create a Property say P_combain_sort and enabled for sort, add a manipulator for retrieving the value of online_instock and store_instock.
    check if online_instock  and store_instock value is 1 then add source property combain_sort and its value 1 otherwise 0 with record.
    In Property mapper map property combain_sort to P_combain_sort and apply sort in newly created property.
    Hope this will help you.
    Thanks,
    Sunil

  • Sorting records all except one  and maintaining index

    I have a mysql table with three attributes.
    att1 | att2 | att3
    1 | 0.1 | 0.2
    2 | 0.4 | 0.3
    3 | 0.2 | 0.1
    4 | 0.3 | 0.5
    Now through my program, I select one record according to attribute 2. Suppose in this case I select the value 0.2(from att2) and get the index. Now what I want to do is: sort descending(here is want to exclude index 3 since it has already been identified by the first part of the program) according to the rest values in att3. I want the corresponding index of of these values too.
    Can anyone help plz.... I have tried to make the problem clear...In case of doubt please ask me..
    Thanks in advance
    Rakesh

    thanks..
    i already solved it..
    but thanks anyways....
    its nice of u to ask

  • Sort Records in Backing Bean from table.getSelectedRowKeys()

    I have a table on my form and the user can sort and filter it in anyway they like; however, when they select multiple records we must always process them in the same order. How do I sort the selected records in my table so that I'm always reading through it by lowest to greatest Id number? I have a field in my table called EcoQueueId that I always want to sort in ascending numbers. I have the following code and it does not work...it's always giving me the highest id number record selected. I've tried changing the "true" to "false" as well and it makes no difference.
    RowKeySet rowKeySet = (RowKeySet) table.getSelectedRowKeys();
    CollectionModel cm = (CollectionModel) table.getValue();
    SortCriterion sortByEcoQueueId = new SortCriterion("EcoQueueId", true);
    List<SortCriterion> listOfSortCriteria = new ArrayList();
    listOfSortCriteria.add(sortByEcoQueueId);
    cm.setSortCriteria(listOfSortCriteria);
    for (Object facesTreeRowKey : rowKeySet) {
    cm.setRowKey(facesTreeRowKey);
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding) cm.getRowData();
    Can someone tell me what is wrong with this code? Thanks.

    Hi,
    How you are sorting your selected row. i tried like
    RowKeySet rowKeySet = (RowKeySet)this.printTB.getSelectedRowKeys();
    CollectionModel cm = (CollectionModel)this.printTB.getValue();
    String wordDocument = null;
    List<LetterInfo> letterInfoLST = new ArrayList<LetterInfo>();
    WelcomeLetterService driver = new WelcomeLetterService();
    String vSanction = null;
    List<SortCriterion> criteria = new ArrayList<SortCriterion>();
    criteria.add(new SortCriterion("PrintRequestId", true));
    cm.setSortCriteria(criteria);
    int numberOfSelectedRecords = rowKeySet.getSize();
    for(int i = 0; i < numberOfSelectedRecords; i++){
    cm.setRowIndex(i);
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)cm.getRowData();
    if (rowData.getAttribute("ContactAddress1") != null)
    cust_address = rowData.getAttribute("ContactAddress1").toString();
    but here cust_address i am getting not selected row i am getting 1st row value. can any one help me how to get selected and that should be order.

Maybe you are looking for

  • I need help with proper DNS setup for 10.5.8 Server

    I'm administering a 10.5.8 server that I sold and setup about a year ago. I'm experiencing issues with getting iCal server to be happy. All of the clients are running 10.5.8, but I'm running 10.6.1. I've heard from others that connecting iCal in 10.6

  • Does PSE13 download photos in the order they are taken on that date and show actual time when hovering over the photo as it did in PSE6?

    In my work, I need to be able to look at photos I took throughout the day at various locations and group them by the time I was there on that date to distinguish the different properties I am taking photos of.  In my previous version of PSE6, when th

  • HELP! Lost work!!

    I was typing a paper on ipages when it closed without warning. I did not save before this happened. Is there anyway to get it back? Please I put a lot of work in to this I was so stupid not to save!

  • "Fatal Error" message in Photoshop CS4

    Whenever I open a photo I recieve a message that says: "Fatal error - missing component /Library/Application Support/Adobe/Adobe Version Cue CS4/Client/4.0.0/VersionCue.framework" What do I do to fix this?

  • Adding extra TAB on MM01

    Dear Experts Does anyone know , via an enhancement, whether is there any way to add a customer tab on the MM01/MM02/MM03 transactions? Thank you in advance. Best regards Goh Yen