DbAdapter toplink 'select.... order by...'

I'm using the DbAdapter in BPEL 10.1.2 which uses toplink to load records from a table in a database.
Is it possible to add an 'ORDER BY...' clause to control the order in which the records are retrieved?

Thanks, but that unfirtunately isn't an option as I'm connecting to a database which is outside my control.
I can re-order the xml data after retrieval, but would prefer to do this at the toplink/database level (at the source) if possible.

Similar Messages

  • Is there a way to get the selection order for selectedProperties?

    app.project.activeItem.selectedLayers seems to be ordered by the selection order, but app.project.activeItem.selectedProperties (at least in Shape Layers) seems to be ordered by the stacking order. Is there a way to get the selection order for selectedProperties?
    Thank you!

    Hi,
    i had tried to investigate this a while back and it's really hard to figure out.
    The array seems to be reorganized using various rules:
         At layer level : preserve the user layer selection order,
         Children of indexed groups : propertyIndex ordering,
         Children of named groups : some internal ordering.
    The following is may be more detail than necessary, and given that it is based on observation, not official docs, it is not so reliable, but well, it might still be of interest !!
    Say you have 2 selected properties A, and B, and call [COMMON PARENT] their "greatest common ancestor", that is:
            A = [COMMON PARENT].property(a1).... property(aA);
            B = [COMMON PARENT].property(b1).... ...property(bB);
    with a1 != b1. Then:
    if [COMMON PARENT] = A (ie if A is an ancestor of B), then A comes first.
            For instance: if you select comp.layer(1).mask(1).maskPath, there are 2 selected properties, the mask group and its maskPath: the first is the group and the second the path (the parent comes first).
    if [COMMON PARENT] is the containing composition, ie A is a property inside comp.layer(a1), and B a property inside comp.layer(b1), then A and B are ordered according to the layers selection order.
            This can have some strange side effects. For instance:
                deselect everything
                select comp.layer(2) (and nothing else)
                select comp.layer(1).transform.position
                select comp.layer(2).transform.position
                ===> comp.selectedProperties = [comp.layer(2).transform.position, comp.layer(1).transform.position] even though the first entry was effectively selected after the second...
    if [COMMON PARENT] is an indexed group, A and B are ordered by propertyIndex
            For instance:
                if you select comp.layer(1).mask(2), then comp.layer(1).mask(1), mask(1) appears before mask(2)
    if [COMMON PARENT] is a named group, ... no clue (internal ordering).
            For instance, at propertyDepth 1, it seems that Time Remapping < Effects < Masks < Material Options < Transform, etc, independantly of the selection order, and this is also not the propertyIndex ordering.
            At higher depth, in CS5 the ordering seems to be the propertyIndex ordering, but it is no longer true in CC.
            For instance, selected Position (index 2), Scale (index 6) and Opacity (index 11) in various order on the same layer.
            in CS5 : selectedProperties = [Position, Scale, Opacity];    // propertyIndex ordering, always
            in CC : selectedProperties = [Scale, Position, Opacity];    // always the same ordering, but not the propertyIndex one
    So the ordering is a lexicographic ordering (Compare the ancestor of depth 0. If no difference, compare the ancestor of depth 1. If no diff, compare the ancestor at depth 2. And so forth).
    But at each step, the comparaison depends on the type of the ancestor, and when the type is named group, the ordering is internal so we can't know.
    Practically the most important thing is that selected properties seem to be reorganized by "containing layer" (the layer selection is preserved),
    and then in each layer selected properties are "grouped by same parent": you can't have a mask related property, then an effect related property, then another mask related property:
    all masks related properties appears together, all effect related properties appear together, etc.
    If several effects are selected, effect(1) and all its properties appear first (if selected), then effect(2) and all its properties would appear second etc
    and so forth
    Xavier.

  • DbAdapter / Toplink Performance issues

    I'm using the DbAdabpter / Toplink to fetch a sizable dataset (500 - 30,000) row for later emission to a file. The fetch of this data via the DbAdapter / Toplink seems to works reasonably well (albeit quite slow) for datasets between 500-7,000 rows. If I attempt to read a larger dataset, the DbAdapter invocation simply times out. I've tweaked the following configuration options suspecting they might help with the long running invoke the DbAdapter partner link:
    * created an on alarm branch and allowed for 15 minutes for the dataset to be returned.
    * increased the syncMaxWaitTime attribute to 15 minutes.
    * Configured the BPEL OC4J instance to use 2048MB for the JVM heap.
    I've tested the query being used by the DbAdapter via SQL navigator and it returns the data sub-second. I'm suspecting the performance issue is related to the DbAdapter / Toplink rendering the thousands of rows into an XML DOM representation. Might this be the case?
    To help further my hypothesis, I'd like to enable the Toplink profiler. I've found a document in the Oracle doc library that suggests it can be enabled with the following directive, "logProfile" (http://www.oracle.com/technology/products/ias/toplink/doc/1013/MAIN/_html/optimiz003.htm#BEEBCBJF). Any idea where I'd specify this directive? Perhaps somewhere in the toplink_mappings.xml file?
    I could be completely off base and the performance issue could be attributed to some other aspect of my BPEL process. Has anyone else encountered this sort of behavior when working with DbAdapters that return thousands of rows?
    Thanks,
    Peter

    Hi Peter,
    if you are still experiencing the timeout problem you may want to alter the transaction config timout setting in the server.xml file. The tuning guide indicates to change the one file but we have changed it in two locations.
    j2ee/OC4J_BPEL/config (to 700000) and integration/orabpel/system/appserver/oc4j/j2ee/home/config/ (600000) we have previously found that the sync_max_wait_time in the console needs to be set at a value lower than the settings in the above files (540 secs).
    For the performance have you captured the sql from the island log that BPEL is actually running (colaxa.cube.ws logging to debug), is it from a single table or from multiple. We managed to improve the perfromance by setting the use-joining in the toplink-mappings file, but then ended up creating a view in the source system to limit the queries being executed. I am not sure about BPEL's capacity to handle large payloads but it would be interesting to know.
    Ashley

  • IDVD 09:  Scenes page - Chapter select order in wrong order

    I have an iDVD (iLife09) project that contains 35 chapters and have previewed it in DVD Player.
    When using the controller's right advance button, the chapters are not selected in their proper order. Each scene page has a different chapter select order, with none of them being logical or correct. I had edited the video and added the chapters in Final Cut Express and then separately in iMovie. Both have the same results.
    It seems that this has been a long-lived problem, as I recall having the same results with a few earlier versions of iDVD. Unfortunately, if you have a slick video, the Scenes/Chapter selection options makes for a poor presentation.
    Any fixes, suggestions, or reasons why this is an ongoing problem would be greatly appreciated.

    Did you follow these steps?
    http://support.apple.com/kb/TS1611
    http://support.apple.com/downloads/iLifeSupport_9_03
    http://www.mydvdedit.com/index.php?lang=english
    http://www.dvinfo.net/conf/non-linear-editing-mac/127485-quality-fce-imovie-idvd -fc.html
    http://archive.bagelturf.com/canons3/s3fce/index.php
    http://www.simplydv.co.uk/simplyBB/viewtopic.php?f=4&t=20934
    The above are additional tools / links you may find useful but if not just come on back.
    Disclaimer: Apple does not necessarily endorse any suggestions, solutions, or third-party software / products that may be mentioned in this topic. Apple encourages you to first seek a solution at Apple Support. The following links are provided as is, with no guarantee of the effectiveness or reliability of the information. Apple does not guarantee that these links will be maintained or functional at any given time. Use the information above at your own discretion.
    Message was edited by: SDMacuser

  • Object selection order.

    I wonder if there's a way to set the selection index as to the real selection order and not the creation order.
    e.g.
    if i create 3 textframes on a page:
    named these as txtFrame1, txtFrame2 and txtFrame3.
    I first select txtFrame3 followed by txtFrame1 and last txtFrame2 and assign them as TEXT tag.
    in InDesign CS2, result will be:
    The sequence in the XML structure will be exactly which I select and tag first.
    which is: content of txtFrame3, then content of txtFrame1 and last content of txtFrame2.
    However in CS3/CS4
    The sequence in the XML structure will be based on the creation of the txtFrames on the page.
    which is: content of txtFrame1, then content of txtFrame2, content of txtFrame3!!!
    Is there a way to have it as what the CS2 way?
    Thanks a million!!!

    I guess with their productivity highly affected,
    adobe may loss more than hundreds of upgrade sales from these group of people.
    to be honest ... I don't think they care ...
    for me - removing this option is inexplicable - I can understand why some options can't be added at beginning - but I can't understand why 100% usefull information is removed in new version of program ... if somebody need to get order of creation - he can collect IDs of all selected objects and sort ... 
    robin
    www.adobescripts.co.uk

  • Billing of pre-selected orders in a specific sequence

    Hi,
      my customer uses manual data entry of sales orders with data he gets from a bunch of papers thus generating a lot of sales orders each day. When the time comes to bill these orders - one bill per order - of different content (customers, billing dates etc.), he selects them using a client specific report - depending on application oriented criteria - and wants them afterwards be billed in a background job / without any further user interaction in the sequence of the order numbers.
    The reason for it is, that he has to check the printed bills with the bunch of paper he used for data entry of the sales orders and he has to add some of these papers to the bills to be sent out via mail afterwards.
    So the sequence of both has to be the same for obvious reasons. The sequence of the bunch of papers is reflected in the sales order numbers, the sequence of the bills in the bill numbers. Bill numbers are generated internally thus depending on the sequence in which the sales orders were billed.
    I tried VF06 giving it sales order numbers to be billed in the proper sequence. But it seems that VF06 sorts these orders first by bill date and/or customers thus destroying the order of sales orders.
    Additionally I tried a couple of VF06 runs, one per sales order. But these runs are computed in parallel thus again destroying my preselected sequence. If I could change the job attributes of such a sequence ob VF06 jobs - one depending on the finishing of the prevoius one, this would solve the problem. But unfortunately the jobs are already "planned" so that I can't add a dependency between them after creation via VF06.  
    Does anyone has a good idea? Additions to my suggestions above? Or fresh and new ideas?
    Thank you very much in advance.
    GeraldS

    Hello Gerald,
    sounds like a quite curios process. 
    The standard transactions (VF04/VF06) are more or less written to deal with mass processing, so i don't think you could influence them the way you need.
    If you need the invoices in the order of the ordernumbers, the only way is to book them one by one using VF01.
    You could use a background job if you write a little own program performing these steps:
    - selecting order-Number to be billed,
    - sorting them
    - calling vf01 for each order via call transaction
      ( with Update option 'S') .
    Make sure that this program can only run  once in the system ( using an lock object).
    As a small solution that could work.
    A bigger (and better) solution would be scanning this 'bunch of paper', connecting the documents to the orders inside SAP.
    Regards Wolfgang

  • Working around the frame selection order issue in CS 4

    Hi guys,
    I'm trying to write a javascript in Indesign that will copy the contents of every selected text frame into the clipboard. The main problem is the selection order, since I'm using CS 4. I'm trying to work around the problem by writing the X and Y coordinates of every frame in arrays through a "for" loop, since the relevant order is always from top left to bottom right in my documents. However, I'm not sure what to do after sorting the arrays : how could I tell the program to use first the frame with the coordinates closest to 0, then the next, etc. ? So far I have this :
    var LesX = new Array();
    var LesY = new Array();
    var Blocs = app.selection;
    for (var i = 0; i < Blocs.length; i++) {
    var myBounds = Blocs[i].geometricBounds;
    var X = myBounds[1];
    var Y = myBounds[0];
    LesX.push(X);
    LesY.push(Y);
    LesX.sort(sortnum);
    Thanks a lot for your help!
    Ma

    Ths is not a good approach. your LesX array will be something like [90, 50, 30, 60, 20] before the sort. And after the sort it will be [20, 30, 50, 60, 90]. But that will not tell you how to find the object whose X value is 20.
    I would write it like this:
    function byYX(a,b) {
        var
            aY = a.geometricBounds[0],
            bY = b.geometricBounds[0],
            aX = a.geometricBounds[1],
            bX = b.geometricBounds[1],
            dy = bY-aY,
            dx = bX-aX;
        return dy?dy:dx;
    var blocs = app.selection;
    blocs.sort(byYX);

  • OM: Multi-select order lines to apply hold

    We are using Standard Oracle Multi-Select order lines (Ctrl or Shift keys) to apply hold and would like to pop-up an alert when any of the selected lines is having an open delivery. Appreciate any suggestions to handle this requirement. Thanks !

    These are good links for the Apply Hold functionalities.
    What we are looking for is to alert users that any of the multi-selected lines is having an open delivery/shipper.
    Need to identify the internal Line_id multi-selected by users for validating if there is an open delivery/shipper.
    Appreciate any advise.

  • Toplink Select and Insert Order

    Hi,
    We have a situation where we have to insert a row into database with a sequence primary key and do a select on the same record with the newly generated sequence number. (Here sequence is generated via TopLink's SQLCall class, but not through work bench at runtime.) When we try this with TopLink it was trying to select first with the new sequnce number and then insert. So we are getting a NULL back. Is there a way to force toplink to create first and then do selects? Please let me know ASAP.
    Thanks..

    I am not sure why you want to do a select of an object you just committed. When you register an object in a Unit Of Work, you get an object back from the function of type Object. Caste that object to the "real" type. After you make the commit call, toplink will grab the next sequence and put the value into the object that was returned from the register function.
    Anyway, if that does not work for you. Create your object in a Unit of Work, and then commit that. In a Client Session object, do your query function. That will force your changes to happen prior to the query. Hope that helps.

  • Changing logical database DDF select order, and restricting the selection

    HI all,
    I am using logical database DDF for a report.  I would like to do two things:
    1) Change the sort order of records so that when my GET statements are processing, they are bringing the data back in sorted by a field of my choice (such as KNA1-REGIO, or KNB1-BUSAB).
    2) I would like to add KNA1-REGIO and KNB1-BUSAB as fields for selection during the LDB's initial selection, instead of filtering out records during the GET statements. 
    FYI, I did find the field DD_BUSAB in the LDB selection structure which I can use to restrict KNB1-BUSAB.  I am still not sure how to restrict by KNA1-REGIO though.
    Any thoughts?
    Thanks so much,
    L

    Thanks for the reply Shiba.  For that particular problem, the business wants to not have to use the dynamic selection, and just have KNA1-REGIO and KNB1-BUSAB as regular select options.  Like I said as well, I did find DD_BUSAB which I can use for KNB1-BUSAB, but KNA1-REGIO is still a problem. 
    Right now I just use a CHECK statement and filter kna1-regio after the GET kna1 statement.
    Thanks again,
    L

  • Dual Case Column names fail in select ORDER BY clause

    This one is solved, but I thought someone might be able to explain why it happens.
    I'm a newbie, since I just downloaded Oracel XE last night, and am trying it out.
    I set up a trivial table with 4 text columns. As it happened, I used dual case for some of my column names, such as 'Nickname'.
    When trying out the Query Builder, the Select statement failed whenever I added a sort.
    After some head scratching and back-and-forth with the sample data base (HR), I finally renamed all the columns to upper case. (e.g. column 'Nickname' became 'NICKNAME'). Then it works.
    Seems like a bug, but maybe it's just a feature. Here's the code generated by the Query Builder. As you can see, there are no quotes around the Table name or column names in the ORDER BY clause (and the dual case version of the column name works if I put the quotes in manually and run it with SQL command.) Seems quirky.
    select     "TEAMS"."NICKNAME" as "NICKNAME",
         "TEAMS"."CITY" as "CITY",
         "TEAMS"."DIVISION" as "DIVISION",
         "TEAMS"."CONFERENCE" as "CONFERENCE"
    from     "TEAMS" "TEAMS"
    order by TEAMS.NICKNAME ASC

    Welcome to forum. :)
    Now, answering your question - no i don't think this is a bug.
    It is your code - which create this bug.
    Now, question is - what happen?
    Just check your select and from clause. You put all the names are in double quote. When you put anything within double quotes - it become a case sensitive. So, the problem occurs there.
    Let's see ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Elapsed: 00:00:01.11
    satyaki>
    satyaki>create table s_otn
      2      (
      3        id    number(4)
      4      );
    Table created.
    Elapsed: 00:00:02.14
    satyaki>
    satyaki>set lin 80
    satyaki>
    satyaki>desc s_otn;
    Name                                      Null?    Type
    ID                                                 NUMBER(4)
    satyaki>
    satyaki>desc S_OTN;
    Name                                      Null?    Type
    ID                                                 NUMBER(4)
    satyaki>
    satyaki>desc s_OtN;
    Name                                      Null?    Type
    ID                                                 NUMBER(4)
    satyaki>
    satyaki>drop table s_otn;
    Table dropped.
    Elapsed: 00:00:05.22
    satyaki>
    satyaki>
    satyaki>create table "S_otn"  
      2       (
      3         id     number(4)
      4       );
    Table created.
    Elapsed: 00:00:00.12
    satyaki>
    satyaki>
    satyaki>desc S_otn;
    ERROR:
    ORA-04043: object S_otn does not exist
    satyaki>
    satyaki>desc S_OTN;
    ERROR:
    ORA-04043: object S_OTN does not exist
    satyaki>
    satyaki>desc s_otn;
    ERROR:
    ORA-04043: object s_otn does not exist
    satyaki>
    satyaki>desc "S_OTN";
    ERROR:
    ORA-04043: object "S_OTN" does not exist
    satyaki>
    satyaki>desc "S_otn";
    Name                                      Null?    Type
    ID                                                 NUMBER(4)
    satyaki>Got me?
    Regards.
    Satyaki De.

  • Problem combining select, order by, rownum (top-N) and for update

    Hello,
    i have serious problems with this.
    -- drop table testtable;
    create table testTable (id number(10,0) primary key, usage number(10,10));
    -- delete from testtable;
    insert into testtable values (11, 0.5);
    insert into testtable values (10, 0.3);
    insert into testtable values (12, 0.3);
    insert into testtable values (9, 0.3);
    insert into testtable values (8, 0.9);
    insert into testtable values (3, 0.0);
    insert into testtable values (2, 0.02);
    insert into testtable values (1, 0.05);
    insert into testtable values (7, 0.7);
    insert into testtable values (6, 0.4);
    insert into testtable values (5, 0.2);
    insert into testtable values (4, 0.1);
    select * from testtable;
    -- without FOR UPDATE
    select * from (
    select tt.id id_, tt.*
    from testtable tt
    where tt.usage > 0.1
    order by tt.usage desc, tt.id desc
    where rownum <= 10;
    --> WORKS
    -- without ORDER BY
    select * from (
    select tt.id id_, tt.*
    from testtable tt
    where tt.usage > 0.1
    where rownum <= 10
    for update of id_;
    --> WORKS
    -- without WHERE ROWNUM <= 10
    select * from (
    select tt.id id_, tt.*
    from testtable tt
    where tt.usage > 0.1
    order by tt.usage desc, tt.id desc
    for update of id_;
    --> WORKS
    -- But what i need is this:
    select * from (
    select tt.id id_, tt.*
    from testtable tt
    where tt.usage > 0.1
    order by tt.usage desc, tt.id desc
    where rownum <= 10
    for update;
    --> ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc., SQL State: 42000, Error Code: 2014
    select * from (
    select tt.id id_, tt.*
    from testtable tt
    where tt.usage > 0.1
    order by tt.usage desc, tt.id desc
    where rownum <= 10
    for update of id_;
    --> ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc., SQL State: 42000, Error Code: 2014
    I have tried every single solution i could come up with.
    But nothing worked.
    My latest idea is to include a comment in the query and set up an ON SELECT trigger which evaluates the comment and enforeces the lock.
    But i'm not sure if this is even possible.
    I cannot split the statement into two because i need the lock immediately when the wanted rows are selected.
    One major criteria for the rows is the order by. Without it i get a random set of rows.
    And the rownum <= 10 is also needed because i don't want to lock the whole table but only the few needed rows.
    I tried row_number() over (order by ...) but this is considdered a window/group-function which disallows the for update as well as the order by.
    During these tests i noticed, that when using the row_number()-function the resultset is ordered automatically (without an additional order by clause).
    But this doesn't help anyway.
    I tried using piped functions to wrap the select to apply the rownum manually by cursor skip, but this doesn't work either. First of all i wasn't able to wrap the query the way i imagined and second the lock would be applied to the whole resultset anyway but only the reduced rows would be returned.
    I heared about LOCK-hints from other DBs, is there anything similar here?
    Any other solution??
    btw. it has to be high-performance after all.
    Greetings Finomosec;

    No, not perfect.
    This is the expected result (ordered by usage desc, id desc):
    ID     USAGE
    8     0.9
    7     0.7
    11     0.5
    6     0.4
    12     0.3
    10     0.3
    9     0.3
    5     0.2
    This ist the one produced by your statement:
    ID     USAGE
    5     0.2
    6     0.4
    7     0.7
    8     0.9
    9     0.3
    10     0.3
    11     0.5
    12     0.3
    Use limit 5 in your tests, and you will also notice that the following doesn't work either:
    select * from testtable ww where ww.id in
    select id from
    select tt.id, tt.usage
    from testtable tt
    where tt.usage > 0.1
    where rownum <= 5
    order by usage desc, id desc
    for update;
    It's because the order is not applied to the result.
    But the following modification works (at least principally):
    select * from testtable ww where ww.id in
    select id from
    select tt.id, tt.usage
    from testtable tt
    where tt.usage > 0.1
    order by usage desc, id desc
    where rownum <= 5
    order by usage desc, id desc
    for update;
    Thr problem here is:
    I need to expand the following Statement to the above form by (Java-) Code:
    -- statement-A
    select tt.id, tt.usage
    from testtable tt
    where tt.usage > 0.1
    order by usage desc, id desc;
    The main problem is:
    The order by clause needs to be duplicated.
    The problem here is, to identify it (if present) and NOT any order by in inner selects.
    I am using Hibernate and to implement this i have to modify the OracleDialect to solve this problem. I get the statement-A (see above) and have to apply the limit.
    Isn't there any other solution??
    Greetings Finomosec;

  • Select select order by

    Hi,
    If I have a table test_order_by with column c1, c2, c3, c4, for example. c1 and c2 together is primary key.
    If I run the following query,
    select * from test_order_by order by c1, c2;
    The result will be in the order of c1, c2.
    Now, If I run the following query:
    select * from (select * from test_order_by order by c1, c2);
    Will the result still be in the same order of c1, c2 ?
    Thank you.

    Hi,
    SQL> select * from emp order by deptno, empno;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7788 SCOTT      ANALYST         7566 09-DEC-82       3000                    20
          7876 ADAMS      CLERK           7788 12-JAN-83       1100                    20
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
    14 rows selected.
    SQL> select * from (select * from emp order by deptno, empno);
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7788 SCOTT      ANALYST         7566 09-DEC-82       3000                    20
          7876 ADAMS      CLERK           7788 12-JAN-83       1100                    20
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
    14 rows selected.SS

  • Select order by

    Hello everyone,
    I have an issue:
    I Know the aggregate function ORDER BY and I know we can specify the columns we need to put in order and if they have to be ASCENDING or DESCENDING
    But I'd like to create a "personal criterium", for example i have the rseg table and the field KSCHL, i want to order this field this way:
    KSCHL = ''
    KSCHL = FRA1'
    KSCHL = 'FRB1'
    KSCHL = 'ZK02'
    KSCHL = 'ZK05'
    KSCHL = 'ZFR2'
    KSCHL = 'ZIIP'
    KSCHL = 'ZII'
    I mean if I put DESCENDING or ASCENDING it won't be like this, but i need these last two types to be in the final and the type '' first.
    How can i achieve this?
    Thanks in Advance!

    I dont think so...that you can specify it in select statement....i.e. your own criteria..
    However what you can do is...
    Once you have the data in an internal table ....you need to loop it and transfer the data in another internal table which has one more field may be SORT_POSN...
    e.g. select*
          from dtable into gt_table.
    LOOP AT gt_table INTO gs_table.
    IF gs_table-kschl = ''.
        gs_final-SORRT_POSN = '1'.
    * Move all the other data from gs_Table into gs_final.
    APPEND gs_final TO gt_final.
    ENDIF.
    IF gs_table-kschl = 'FRA1'.
        gs_final-SORRT_POSN = '2'.
    * Move all the other data from gs_Table into gs_final.
    APPEND gs_final TO gt_final.
    ENDIF.
    IF gs_table-kschl = 'FRB1'.
        gs_final-SORRT_POSN = '3'.
    * Move all the other data from gs_Table into gs_final.
    APPEND gs_final TO gt_final.
    ENDIF.
    * Similarly do it for all other sort criterian...
    ENDLOOP.
    Now you have all the data in GT_FINAL..
    All you have to do now is, sort the internal table GT_FINAL BY SORT_POSN.
    Hope it helps!

  • SAP query field selection order and text

    Hello All,
       Is there any way I can change the position of fields on the selection screen of query. Also can I change the text of the selection fields. Thanks
    Atul

    In SQ01 enter your query name and go into change mode, on the menu click "Goto" , "Field Selection" then "Field Selection"
    in there change the text of selection field, to change to ordering just enter the number sequence in the "No" the order in which you want them to appear. Like
    Production Order 02
    Order Type       03
    Plant            01
    after you execute the query selection screen will appear like below
    Plant
    Production Order
    Order Type

Maybe you are looking for

  • Windows 8.0 Volume License machines reboot and windows 8.1 is installed??

    We are a small private university with 484 computers running Windows 8.0 with MAK key. This week we have had 2 Windows 8.0 computers spontaneously upgrade to Windows 8.1. Since we do have a windows 8.1 MAK key all we had to do was enter the correct k

  • Bubble chart - problem with overlaying bubble

    Hi all, I have problem with bubble chart. Two bubbles are overlaying, that wouldn't be a problem, but one of this two bubbles is bigger and other is smaller. This smaller is beneath bigger. Why smaller is not on top of bigger? How to solve this? Than

  • Cant start iTunes

    Hi, my problem is, that when I try to start iTunes, it says: "The application or DLL C:\Programme\Gemeinsame Dateien\Apple\Apple Application Support\CFNetwork.dll is no available Windows-Data. Check this with the Installitionsdiskette. My english isn

  • Referencing classes outside package definition

    Hi, I have a strange problem, and I dont know if its a limitation of Java or my IDE (Intellij IDEA using java 1.4.1). Basically I have a package structure /classes/com/foo/MyClass.java now from MyClass, I want to access another class file AnotherClas

  • Friends and Family--Restricted Calling

    When you have a number saved on your Friends and Family list, can you call it through a restricted number (*67) and still have it count towards your  "IN Calling"??