DATA_PACKAGE:  SORT & ( INSERT or  APPEND ) ?

Hello Folks,
<u>Problemdescription:</u>
I need two compare to consecutiv records in a DataPackage
to a give sort order
and upon the result of the comparison
I need to insert an new record.
<u>Question:</u>
Can I <b>SORT</b> a DATA_PACKAGE with a given sort order
( like in SQL ...ORDER BY .... ) and how ?
Can I <b>APPEND</b> or<b> INSERT</b> a new userdefined Dataset (=Record) to a DATA_PACKAGE and how ?
Thank You  !
Martin Sautter

Hi Martin,
in your start routine, you can sort a data_package with
sort data_package by <component name1>.... <component name n>.
Additionally you can append new records to it with
append <specified workarea> to data_package.
Please check out the F1-help for the statements additionally. You get a lot more information about the use of the statements.
kind regards
Siggi

Similar Messages

  • Insert with APPEND hint

    Hello,
    I have insert statment with APPEND hint. Here statment is as follows.
    INSERT /*+ APPEND */ INTO TEST SELECT * FROM EMP;
    The TEST table is in NOLOGGING mode.
    The table has FK constraint, trigger, index too. Obvisiouly, it would not write the data in redo log. Still does it insert the data above HWM.
    Thanks.

    When you use APPEND hint with INSERT, oracle never bother about the free blocks which are below HWM. It always writies in new blocks, i.e. above HWM.
    Jaffar

  • Insert using APPEND and NOLOGGING

    Hi
    I want to know that if we use INSERT with hint APPEND and NOLOGGING, then is the data written to rollback segment.
    Please tell me how can we avoid writing to rollback segment as i am having a lot of data to insert and want to do it using select insert and not by using bulk insert.
    Thanks,
    Manish
    Message was edited by:
    user532526

    is there any way that if some error occurs then the data should be rollled back If an exception occurs during the insert, the work will be rolled back automatically.
    as with 20 lakh records the rollback segment will overflow.Are you sure? Have you tried it?

  • Error when inserting or changing in a sorted table

    Hi Experts,
    When i am executing a webdynpro application it says Error when inserting or changing in a sorted table. Can any one help for this.
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: GET_CATEGORY_LIST of program /1BCWDY/F9XHYWN4WKNMG4CDUGA8==CP
    Method: IF_COMPONENTCONTROLLER~GET_CATEGORY_LIST of program /1BCWDY/F9XHYWN4WKNMG4CDUGA8==CP
    Method: WDDOMODIFYVIEW of program /1BCWDY/F9XHYWN4WKNMG4CDUGA8==CP
    Method: IF_WDR_VIEW_DELEGATE~WD_DO_MODIFY_VIEW of program /1BCWDY/F9XHYWN4WKNMG4CDUGA8==CP
    Method: DO_MODIFY_VIEW of program CL_WDR_DELEGATING_VIEW========CP
    Method: MODIFY_VIEW of program CL_WDR_VIEW===================CP
    Method: DO_MODIFY_VIEW of program CL_WDR_CLIENT_COMPONENT=======CP
    Method: DO_MODIFY_VIEW of program CL_WDR_WINDOW_PHASE_MODEL=====CP
    Method: PROCESS_REQUEST of program CL_WDR_WINDOW_PHASE_MODEL=====CP
    Method: PROCESS_REQUEST of program CL_WDR_WINDOW=================CP
    in ST22
    Object Definition
      DATA: lo_node                   TYPE REF TO if_wd_context_node,
            lo_node_info              TYPE REF TO if_wd_context_node_info,
            lo_element                TYPE REF TO if_wd_context_element.
    Additional Data declarations
      DATA: lv_key TYPE string.
    Get context node.
      lo_node = wd_context->get_child_node( name = 'DROPDOWNLISTS' ).
      lo_node_info = lo_node->get_node_info( ).
    Call method to fetch the categories.
      CALL METHOD cl_hap_wd_start_page_ui=>category_get_list
        EXPORTING
          add_on_application = add_on_application
        IMPORTING
          t_categories       = lt_categories.
    Append Default selection entry 'All'.
      lw_category-category_id = '00000000'.
      lw_category-category_name = 'All'.
      APPEND lw_category TO lt_categories.
    Sort table after appending the new entry.
      SORT lt_categories ASCENDING.
    Loop through the category list and populate key(category_id) value(category_name) pair for
      LOOP AT lt_categories INTO lw_category.
        lw_key_value-key = lw_category-category_id.
      625     lw_key_value-value = lw_category-category_name.
    >>>>>     APPEND lw_key_value TO lt_key_values.------>Here it throws an error
      627     CLEAR: lw_key_value, lw_category.
      628   ENDLOOP.
      629
      630 * Bind the category key-value pair to the context attribute.
      631   CALL METHOD lo_node_info->set_attribute_value_set
      632     EXPORTING
      633       name      = 'CATEGORY_LIST'
      634       value_set = lt_key_values.
      635
      636 * Make the entry 'All' as default selected.
      637   CALL METHOD lo_node->set_attribute
      638     EXPORTING
      639       value = '00000000'
      640       name  = 'CATEGORY_LIST'.
      641
      642 ENDMETHOD.
      643
      644 method GET_EMPLOYEES.
      645

    Hello Durga,
    from the error what I understood is lt_key_values is a sorted table and you are trying append a new line to it. Incase of sorted table you need to use the INSERT statement and not the APPEND statement.
    INSERT lw_key_value INTO table lt_key_values.
    BR, Saravanan

  • Runtime error in sorted itab

    Q2]]  A runtime error occurs if you violate the sort order of a sorted table by appending to it -
    WHY?

    Hi,
    First of all you should try and understand the meaning of Append and Insert.
    Append always adds a new line to the end of the internal table.If the table is empty,then it would add it as the first line.
    Insert always inserts the row according to the sorting or if you have given any condition then accordingly.
    Modify can play the role of either the Append or Insert depending on the type of the table.
    Hence,if you try to use Append in a sorted table, it adds a new row at the end of the table and disturbs the sorting.Insert on the other hand includes the row at a place according to the sorting.
    In case you have any further clarifications,do let me know.
    Regards,
    Puneet Jhari.

  • Inserting records in the ABAP exit function (hashed table XTH_DATA)

    Hi all,
    I want to add records in the logic of an ABAP exit function. Due table XTH_DATA being a hashed table the normal insert or append is not possible.
    My logic MUST move the data to a temporary table (ITAB) where the logic is executed (modifying KYF values and creating new records.
    In order to quickly get to a result I have solved the problem in an awful way through hardcoding the structure of ITAB to be the same as XTH_DATA is in this specific case.
    I would like to know if someone has an exmaple of a nice way to dynamically create an ITAB with the structure of XTH_DATA?
    At the end it should be possible to do: XTH_DATA[] = itab[].
    Greetings,
    Martin

    Hi Martin,
    the only way I know is to solve this problem with sort of pointers, field symbols. Roughly spoken the idea is you lookup the structure of xth_data in table dd03l. you define an internal table of type any. you loop around your xth_data table and assign the value of each column of xth_table to your internal table. then you do your your adding. Hopefully then you can simply assign xth_data to your itab.
    regards,
    Jürgen

  • Direct Path Inserts = By DBWR or by Shadow Process

    Hello guys,
    if i use the append hint (direct path inserts) - which process is writting the data to the datafile?
    In the documentation of oracle:
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96524/c21dlins.htm#10778
    Oracle appends the inserted data after existing data in the table. Data is written directly into datafiles, bypassing the buffer cache Ok that is clear - but who is writing down the data? The shadow process which is handling the insert statement or is it given to the dbwr and it flushes the data directly to the datatfile without putting it into the buffer cache.
    And another question regarding direct path inserts:
    http://sai-oracle.blogspot.com/2006/03/parallel-query-is-it-good-or-bad.html
    If you want to do direct path insert in parallel, you would block all other non direct path insert operations on that table. This is because direct path insert would append above highwater mark, and no other process is allowed to update HWM until your operation is doneIf i insert data in serial with direct path insert... i also write data behind the High-HWM .. why is it only locked in parallel mode?
    And why does oracle not check if there is enough space in some other blocks below the High-HWM and using these blocks for "normal" inserts?
    Regards
    Stefan

    It's the server process that's responsible for writing direct path blocks to disk.
    DBWR only ever flushes out of the buffer cache.
    You do NOT write "data behind the HWM" in direct path mode, ever. Direct path works so fast because all you do is slam whole blocks of data onto disk ABOVE the high water mark. You can slam whole blocks down without worrying about what you're over-writing precisely because the blocks are above the HWM and thus cannot possibly be in use by anyone for anything. Under the HWM and you have to start worrying about locking and contention and stuff like that.
    Parallel operations (or simultaneous serial operations by two different users) inevitably have to block each other for this sort of thing: if I am busy writing to blocks above the HWM, great. But if you want to do it too... well, what's to stop us from over-writing each other's blocks?! Nothing, actually. So Oracle simply has to lock the entire table from any other direct path operation to make the situation manageable.

  • APPEND (direct path) - redo size

    I am sure, I might be missing something obvious. I am under the impression that DIRECT PATH loads (such as inserts with APPEND hint )would generate less redo. But, not sure why I am seeing this...
    Regular Insert (Not direct path):
    ====================
    SQL> insert into c2 Select * from dba_objects where rownum < 301;
    300 rows created.
    Statistics
    10 recursive calls
    74 db block gets
    353 consistent gets
    1 physical reads
    *31044 redo size*
    821 bytes sent via SQL*Net to client
    752 bytes received via SQL*Net from client
    3 SQL*Net roundtrips to/from client
    2 sorts (memory)
    0 sorts (disk)
    300 rows processed
    Direct Path Insert
    ===========
    SQL> insert /*+ APPEND */ into c2 Select * from dba_objects where rownum < 301;
    300 rows created.
    Statistics
    8 recursive calls
    13 db block gets
    346 consistent gets
    1 physical reads
    *39048 redo size*
    809 bytes sent via SQL*Net to client
    770 bytes received via SQL*Net from client
    3 SQL*Net roundtrips to/from client
    1 sorts (memory)
    0 sorts (disk)
    300 rows processed
    Not sure, why am I seeing more redo being generated with DIRECT PATH .... either I am missing something obvious or got the DIRECT PATH load completely wrong...would really appreciate any help with this.

    Hello,
    Check out this thread:
    [http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:3224814814761]
    Additionally, if you were to switch off logging at the table level, before the INSERT, you should see a (further) reduction in redo:
    ALTER TABLE your_table NOLOGGING;

  • To make an insert run faster

    Hi,
    There is an sql statement which inserts 10 million records everyday and is taking 1.5 hours to run.The table is truncated and the data is loaded everyday.The constraints are disabled before inserting the records.The following options are tried
    table created in nologging
    truncate table with reuse storage
    diable constraints
    insert with append hint
    enable constraints
    table created in nologging
    truncate table with resue storage
    drop constraint
    insert with append hint
    add constraint
    But there is no significance improvement in the timings of the load.Can anyone assist in this?

    Though well experts are handling and looking your issue; I just wish to draw your attention on questions raised in previous replies; so that you may find the solution in questions itself:
    1.     Check if there are lots of indices on the table?
    2.     How quickly do you need this process to run?
    3.     How much data are you trying to load (bytes, not rows)?
    4.     How long does each step of the process take?
    5.     Are you primarily spending time loading the data?
    6.     Could you redesign the process so you only had to handle an incremental data feed every day?
    7.     tablespace where you perform the insert is ASSM?
    8.     Did you trace your session see if nologging really taking effect?
    9.     How you constructed your insert statements?
    10.     Have you consider parallel processing?
    11.     Is the table looks to participate in some sort of ETL process?
    12.     Have you considered using table partitioning?
    13.     Are you building the index in parallel?
    14.     What is data management where you have to insert 10 million rows change every day?
    I don’t think now there is question left to find / explore the solution. I have just paste the questions at a glance so that you may find helpful yourself to explore the issue.
    Regards
    Girish Sharma

  • Using APPEND hints

    Hi ,
    i know that the APPEND hints is to prevent logging
    and it works only if you use a select * from tbl
    i.e insert /*+ APPEND */ into tbl2 select * from tbl1 ??
    IF you use
    insert /*+ APPEND */ into tbl2 select a.col1 , a.col2 from tbl1 a it WILL BE LOGGED ??
    pls advise
    tks & rdgs

    from what i see in fact the 3rd option is writting even lesser to the redo log ?No, 2nd and 3rd options are exactly the same. In previous example, the difference was due to extent management operations I believe (when more space is needed, Oracle allocates new extents as we add more and more rows to our table).
    Consider:
    SQL> create table big as select owner, object_name from all_objects;
    Table created.
    SQL> -- Let's create initially large table segment, to postpone its extending ...
    SQL> create table test STORAGE (INITIAL 20M) as select * from big where 1 = 0;
    Table created.
    SQL> set autot traceonly stat
    SQL>
    SQL> insert into test select * from big;
    46660 rows created.
    Statistics
              2  recursive calls
           1878  db block gets
            451  consistent gets
            196  physical reads
        1725756  redo size
            791  bytes sent via SQL*Net to client
            815  bytes received via SQL*Net from client
              4  SQL*Net roundtrips to/from client
              2  sorts (memory)
              0  sorts (disk)
          46660  rows processed
    SQL> rollback;
    Rollback complete.
    SQL> insert /*+ APPEND */ into test select * from big;
    46660 rows created.
    Statistics
              0  recursive calls
             10  db block gets
            200  consistent gets
              0  physical reads
            504  redo size <==
            774  bytes sent via SQL*Net to client
            829  bytes received via SQL*Net from client
              4  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
          46660  rows processed
    SQL> rollback;
    Rollback complete.
    SQL> insert /*+ APPEND */ into test select a.owner, a.object_name from big a;
    46660 rows created.
    Statistics
              0  recursive calls
             10  db block gets
            200  consistent gets
              0  physical reads
            504  redo size <==
            776  bytes sent via SQL*Net to client
            852  bytes received via SQL*Net from client
              4  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
          46660  rows processedSo, as far as I can see, they're the same.
    ... my dba told me that a insert with Append hints MUST use a select * in order not to cause loggingI guess your dba is smoking something :)

  • Problem in insert

    Hi All,
    I have a query mentioned below.
    I am taking values from XML for some fields.The problem is while inserting some of the columns(XML) are null and only the last column(XML) has values. But when I execute the select statement alone, all the columns(XML) has values.
    I created another table with just three columns and tried to insert values from XML all the fields are having values.
    Kindly suggest me on this issue.
    Structure of the table
    IB_BR_ID NUMBER(20)
    IB_BR_MITTENTE VARCHAR2(50)
    IB_BR_RICEVENTE VARCHAR2(50)
    IB_BR_IMPORTO VARCHAR2(25)
    IB_BR_DATA_VALUTA DATE
    IB_BR_DATA_VALUTA_D DATE
    IB_BR_DATA_REGIME DATE
    IB_BR_DATA_ORDINE DATE
    IB_BR_DATA_CONTABILE DATE
    IB_BR_CRO VARCHAR2(20)
    IB_BR_O_ANAG VARCHAR2(50)
    IB_BR_O_COD VARCHAR2(30)
    IB_BR_D_ANAG VARCHAR2(50)
    IB_BR_D_COD VARCHAR2(30)
    IB_BR_D_IND VARCHAR2(4000)
    IB_BR_D_LOC VARCHAR2(35)
    IB_BR_CAUSALE VARCHAR2(50)
    IB_BR_DIVISA VARCHAR2(5)
    IB_BR_CAUSALE_SIA VARCHAR2(20)
    INSERT INTO /*+ append */ IBG_MA_BONIFICI_RETE (
                   IB_BR_MITTENTE,           --1
                   IB_BR_RICEVENTE,           --2
                   IB_BR_IMPORTO,               --3
                   IB_BR_DATA_VALUTA,          --4
                   IB_BR_DATA_VALUTA_D,     --5
                   IB_BR_DATA_REGIME,           6
                   IB_BR_DATA_ORDINE,          --7
                   IB_BR_DATA_CONTABILE,     --8
                   IB_BR_CRO,               --9
                   IB_BR_O_ANAG,               --10
                   IB_BR_O_COD,                --11
                   IB_BR_D_ANAG,                --12
                   IB_BR_D_COD,               --13
                   IB_BR_D_IND,                --14
                   IB_BR_D_LOC,                --15
                   IB_BR_CAUSALE,                --16
                   IB_BR_DIVISA,                --17
                   IB_BR_CAUSALE_SIA          --18
              SELECT DS_ABI_BANCA_PROP,
                        DS_ABI_BANCA_DESTINATARIA,
                        LTRIM( TO_CHAR(DS_IMPORTO, '9999999999999999990D90', 'NLS_NUMERIC_CHARACTERS='',.''')) || '/C' as x,
                        TRUNC(DS_DATA_VALUTA_ADDEBITO) as y,
                        TRUNC(DS_DATA_VALUTA_BENEF_CLIENTE) as z,
                        --NULL,                         
                        TRUNC(DS_DATA_ESECUZIONE) as xx,     
                        TRUNC(DS_DATA_INIZIO_STATO) as yy,
              SUBSTR(DS_RIF_UNIVOCO,1,20) as one,
                        SUBSTR(XMLTYPE(DS_DETTAGLI_XML).EXTRACT('/DISPOSIZIONE_PC_DETAILS/@DENOMINAZIONE_ORDINANTE').getStringVal(),1,50) as two,
         SUBSTR(XMLTYPE(DS_DETTAGLI_XML).EXTRACT('/DISPOSIZIONE_PC_DETAILS/@CODICE_FISCALE_ORDINANTE').getStringVal(),1,30) as three,
         SUBSTR(XMLTYPE(DS_DETTAGLI_XML).EXTRACT('/DISPOSIZIONE_PC_DETAILS/@DESCRIZIONE_DESTINATARIO').getStringVal(),1,50) as four,
    SUBSTR(DS_CONTO_DESTINATARIO, 5, 8) as five, --13
              SUBSTR(to_char(XMLTYPE(DS_DETTAGLI_XML).EXTRACT('/DISPOSIZIONE_PC_DETAILS/@INDIRIZZO_DESTINATARIO').getStringVal()),1,20) as six,
         SUBSTR(DS_LOCALITA_BENEF,1,35) as seven, --15
         SUBSTR(XMLTYPE(DS_DETTAGLI_XML).EXTRACT('/DISPOSIZIONE_PC_DETAILS/@DESCRIZIONE_RIFERIMENTO_OPERAZIONE').getStringVal(),1,50),
                        DS_ISO_DIVISA_ADDEBITO, --17
         SUBSTR(DS_CAUSALE,1,20)
                   FROM PRG_TR_DISPOSIZIONE
                   WHERE DS_ABI_BANCA_PROP = '03268'
                   AND DS_STATO = 'ESAUR'
                   AND DS_TIPO_INTERNO IN ('BSI','BAII')
                   AND TRUNC(DS_data_inizio_stato) between trunc(to_date('01-01-2006','dd/mm/yyyy'))
    and trunc(to_date('02-01-2006','dd/mm/yyyy')) and rownum < 2;
    Thanks in advance,
    Jaggy

    Hi,
    Sorry, if my posting is not clear.
    I need to insert only one row. So I used rownum to restrict.
    My question is I am executing a query, say which is having 8 columns. When I execute the select statement I can see the values for all the columns. But when I tried to use insert into .. 0select statement, only some of the columns has values and remaining columns are null. This happens only for those columns for whcih I populate value from XMLTYPE.
    Out of 8 columns 5 columns are being populated from XML. Say a,b,c,d,e are those columns except e other columns are loaded as null. I am sure that all the columns has got value.
    I hope You understand my Question now.
    Thank You
    Jaggy

  • Suggestions to improve the INSERT performance

    Hi All,
    I have a table which has 170 columns .
    I am inserting huge data 50K and more records into this table.
    my insert would be look like this.
    INSERT INTO /*+ append */ REPORT_DATA(COL1,COL2,COL3,COL4,COL5,COL6)
    SELECT  DATA1,DATA2,DATA3,DATA4,DATA5,DATA5 FROM TXN_DETAILS
    WHERE COL1='CA';
    Here i want to insert values for only few columns.Hence i specifies only those column names in insert statement.
    But when huge data(50k+) returned by select query then this statement taking   very long time to execute(approximately 10 to 15 mins).
    Please  suggest me to improve this insert statement performance.I am also using 'append' hint.
    Thanks in advance.

    a - Disable/drop indexes and constraints - It's far faster to rebuild indexes after the data load, all at-once. Also indexes will rebuild cleaner, and with less I/O if they reside in a tablespace with a large block size.
    b - Manage segment header contention for parallel inserts - Make sure to define multiple freelist (or freelist groups) to remove contention for the table header. Multiple freelists add additional segment header blocks, removing the bottleneck.  You can also use Automatic Segment Space Managementhttp://www.dba-oracle.com/art_dbazine_ts_mgt.htm (bitmap freelists) to support parallel DML, but ASSM has some limitations
    c - Parallelize the load - You can invoke parallel DML (i.e. using the PARALLEL and APPEND hint) to have multiple inserts into the same table. For this INSERT optimization, make sure to define multiple freelists and use the SQL "APPEND" option. If you submit parallel jobs to insert against the table at the same time, using the APPEND hint may cause serialization, removing the benefit of parallel jobstreams.
    d - APPEND into tables - By using the APPEND hint, you ensure that Oracle always grabs "fresh" data blocks by raising the high-water-mark for the table. If you are doing parallel insert DML, the Append mode is the default and you don't need to specify an APPEND hint. Also, if you're going w/ APPEND, consider putting the table into NOLOGGING mode, which will allow Oracle to avoid almost all redo logging."
    insert /*+ append */ into customer values ('hello',';there');
    e - Use a large blocksize - By defining large (i.e. 32k) blocksizes for the target table, you reduce I/O because more rows fit onto a block before a "block full" condition (as set by PCTFREE) unlinks the block from the freelist.
    f - Use  NOLOGGING
    f - RAM disk - You can use high-speed solid state disk (RAM-SAN) to make Oracle inserts run up to 300x faster than platter disk.

  • Truncate Table before Insert--Performance

    HI All,
    This post is in focus of special requirement where a table is truncated before inserting records in the table.
    Now, when a table is truncated the High Water Mark(HWK) is reset to lowest memory allocated for table in tablespace. After this, would insert with append can boost the performance of the insert query?
    In simple insert query, the oracle engine consults the free list to look for free spaces.
    But in insert with apppend, the engine starts above the HWM. And the argument is when truncate has been executes on table, would the freelist be used in simple insert.
    I just need to know if there are any benefits of using append insert on truncated table or simple insert would be same in term of performance with respect to insert with append.
    Regards
    Nits

    Hi,
    if you don't need the data truncate the table. There is no negativ impact whether you are using an conventional path or a direct path insert.
    If you use append less redo is written for the table if the table is in NOLOGGING mode, but redo is written for all indexes. I would recommand to create a full backup after that (if needed), because your table will not be recoverable after that (no REDO Information).
    Dim

  • Sorting a Linked list.

    Hi, I'm not much good at the coding and require some help, i looked through past posts and haven't found much help.
    public class Queue2
    private node start,last;
    private static class node
    private int nPriority;
    private String todo;
    private node link;
    public Queue2()
    start = null; last = null;
    public void add(int key, String todo)
    node temp = new node();
    temp.nPriority = key;
    temp.todo = todo;
    temp.link = null;
    if (start != null)
    last.link = temp;
    last = temp;
    else
    start = temp;
    last = temp;
    public int remove()
    if (last != start)
    int x = start.nPriority;
    start = start.link;
    return x;
    else if (start != null)
    int x = start.nPriority;
    start=null; last =null;
    return x;
    else return -1;
    public void print()
    node curr = start;
    if (curr == null)
    System.out.println("No Tasks");
    else
    node temp = start;
    System.out.println("List of tasks todo :-");
    while (temp !=null)
    System.out.print(temp.nPriority + " : " + temp.todo + "\n");
    temp = temp.link;
    System.out.println();
    Theres my code atm, I guess I need to either alter the add() method to put new objects into the list in order or to add a sort() method.
    I need the list to be output in order of the lowest int in nPriority first.
    Any help will be very much appreciated.

    First of all, you post your code the wring way so it is hard to read. Use tags. (http://forum.java.sun.com/faq.jsp#format)
    Second, I think you lack curly braces in the 'else' in the end.
    Third, as far as I can see your whole logic is very far from the mark. (But that may be just me being unable to grasp the way you try to do it. (Which again may be caused by #1 above)) Here's some rough (pseudo)code for a sorted insert: void sortedInsert(Node newNode) {
        //special case, insert in beginning:
        if (newNode.pri < list.first.pri) {
            newNode.next = list.first;
            list.first = newNode;
        else {
            Node previous = null;
            Node current = list.first;
            while (current.next != null) {
                previous = current;
                current = current.next;
                if (newNode.pri < current.pri) {
                    //insert before current
                    previous.next = newNode;
                    newNode.next = current;
                    return;
            //other special case: Insert at the end
            current.next = newNode;

  • Subtotal in alv after sort

    i have six fields,
       based upon the sorting of all 5 fields, i should get the subtotal for sixth field in the alv list report(i have used func module alv_list_display').
    How can I set the sorting sequence in IT_SORT?
    and display the sub-total.

    Hai
    Go through the following Example Code
    Refer to this similar thread.
    alv Display :Total and subtotal
    for sub totals you have to use
    sort table.
    sort-fieldname = 'VBELN'.
    sort-tabname = 'ITAB'.
    sort-up = 'X'.
    sort-subtot = 'X'.
    append sort to it_sort.
    Or
    Define SORT table and FIELDCATALOG table .
    Data :i_field type slis_t_fieldcat_alv,
    w_field like line of i_field,
    i_sort type slis_t_sortinfo_alv,
    w_sort like line of i_sort.
    2.Grand Total
    While buildingfieldcatalog,We have to set DO_SUM = 'X' for quantity field .
    ex.
    w_field-fieldname = 'MENGE'.
    w_field-tabname = 'I_TAB'.
    w_field-DO_SUM = 'X'.
    append w_field to i_field.
    clear w_field.
    3.Subtotal
    Whenever WERKS is changed Subtotal is displayed .
    Build sort table .
    Clear: w_sort,i_sort[].
    w_sort-spos = 1.
    w_sort-fieldname = 'WERKS'.
    w_sort-up = 'X'.
    w_sort-subtot = 'X'.
    append w_sort to i_sort.
    clear w_sort.
    4.
    Pass this I_SORT table thru REUSE_ALV_LIST_DISPLAY function module ..like fieldcatalog table.
    Or
    For sub totals you need to sort and pass the sort table to FM.
    But for total you need to pass to field catalog like below
      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.
    Thanks & regards
    Sreeni

Maybe you are looking for

  • I can't install Windows 7

    I ordered this PC a few days ago: 'HP Beats Special Edition 15-p099no' and received it today. I absolutely hate Windows 8, so I tried installing my lovely Windows 7. No luck. I pressed ESC when the computer was starting up, and then F9. Out of these

  • OS X Tiger - Help!!!!!!

    Hi I've got an old G4 Powerbook which I don't use anymore and I'm planning to give it to my Dad to mess about on now he's retired. Thing is this: I bought it from my bro 4 years ago without any discs, he bought it from someone without same. An old fr

  • Bridge CC slow/reloading thumbnails every time it opens

    I'm suddenly having a ton of problems with Bridge running very slow. I was using CS6 but couldn't get it to batch rename some files I'm working with so I switched over to CC (after enough updates, Bridge CC works on my machine now--it used to just cr

  • How to get the price of applying plug in signature?

    Hello: I have developed a pdf reader plugin,and intend to apply a singnature. But I want to how much should I pay.I need some information about signature price,but I don't know where can I get the need information. Please help me.

  • Game apps won't appear in Apps store in Itunes

    I connected my iTouch to Itunes and I usually go check the new released game apps on Itunes, but when I select the games from the dropdown menu, it won't even connect to it. It just becomes a blank white page. I tried just click on App Store and it w