Automatic Sort on dataTable affects other tables

Hi everybody,
I'm struggling a little bit with JSF as I have a special requirement - I need a dynamic display of some independently sortable dataTables below each other.
It works quite well, but the problem is, that if I sort one of the shown tables, it affects the other tables as well.
Hav a look on my page content:
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<f:view>
<html>
<body>
<h:form id="frm">
     <t:dataList value="#{bean.tablelist}" var="table">
               <t:dataTable value="#{table.data}" var="tablerow"
                         width="500" border="1"
                         sortable="true" sortColumn="#{table.sortColumn}"
                         sortAscending="#{table.sortAscending}"
                         preserveSort="false">
                    <t:column>
                         <f:facet name="header">
                                    <h:outputText value="column1"  />
                                </f:facet>
                         <h:outputText value="#{tablerow.col1}"/>
                    </t:column>
                    <t:column>
                         <f:facet name="header">
                                    <h:outputText value="column2"  />
                                </f:facet>
                         <h:outputText value="#{tablerow.col2}"/>
                    </t:column>
                    <t:column>
                         <f:facet name="header">
                                    <h:outputText value="column3"  />
                                </f:facet>
                         <h:outputText value="#{tablerow.col2}"/>
                    </t:column>
                    <t:column>
                         <f:facet name="header">
                                    <h:outputTextvalue="column4"  />
                                </f:facet>
                         <h:outputText value="#{tablerow.col4}"/>
                    </t:column>
                    <t:column>
                         <f:facet name="header">
                                    <h:outputText value="column2"  />
                                </f:facet>
                         <h:outputText value="#{tablerow.col5}"/>
                    </t:column>
               </t:dataTable>
     </t:dataList>
</h:form>
</body>
</html>
</f:view>I have checked the table.sortColumn value, it is changed just in one table, but it affects somehow the display of the others, too.
Just an example:
I have Table1, Table2 and Table3 that are displayed each inside of the dataList.
Every table has the same columns (column1 to 5).
By default, each table is sorted by column1.
If I click on the column2 header of Table2 to sort just Table2 by column2, Table1 and Table3 also get sorted by column2 (but have still the small arrow indicating that the sort is by column1).
It's a bit tricky to describe :)
I appreciate any help, maybe just a workaround.
Edited by: coppermine on Jul 10, 2008 4:13 PM

I have checked the table.sortColumn value, it is changed just in one table, but it affects somehow the display of the others, too.
alizia
[Wide Circles|http://www.widecircles.ca]

Similar Messages

  • Switch off automatic sorting in a Table

    Hi everybody,
    how is it possible to switch off the automatic sorting function of a database table? I don't want to lose the actuall order in my table.
    regards,
    Sid

    Sid,
    You should not rely on how the database stores data in the table. If you want to achieve some sort order, then you have to implement it by architecting the table that way. For example, you can add updated date and time and then sort by those fields.
    If you have some other sorting logic, then you may add a new column to the table and insert a sort number in it.

  • ADF treeTable automatic sort

    I have a treeTable whose value I supply with my own ChildPropertyTreeModel. For the nodeStamp facet column sortable="true" and sortProperty="name". When the tree table first appears, the tree is not sorted and when I click the up or down triangles in the first column header, it does not sort at all. When I set the ChildPropertyTreeModel treeModel.setSortCriteria(criteria), where criteria is ArrayList of one SortCriterion("name", true), the treeModel is always sorted ascending even when I click the down triangle in the first column header.
    Do I have to catch the up/down arrow event and modify my sort criterion myself, or is there a simple way to have the treeModel do it for me automcatically like a regular table does? If the former, how do I catch the event and determine the direction of the desired sort?
    Thanks in advance.

    As per - http://docs.oracle.com/cd/E12839_01/apirefs.1111/e12419/tagdoc/af_treeTable.html
    Unlike the Table, the TreeTable does not support automatic sorting. The underlying TreeModel must support sorting by implementing it's sorting logic in the setSortCriteria(List criteria) method of the TreeModelOne of the ways you can do it is here - ADF Sortable TreeTable

  • Why doesn't Numbers automatically sort?

    I have a slider on a table that updates numerical value in a cell which, in turn, automatically updates (via a calculation) a 2nd table on another sheet. I have a 3rd table (on a 3rd sheet) that is sorted by a value which is calculated partly with a value in the 2nd table. I'd like this 3rd table to automatically sort after I move that slider in cells on table 1. It doesn't!
    Anyone know why? how?

    If you want to sort that table automatically, you can do it in a fourth table or within Table 3. For the example below, I'm going to do it all in Table 3. It assumes you want to sort column B and there is another column, A, that needs to stay matched up with it. Personally, I'd do it in another table but it's less typing to give the example this way.
    We will use Column D to sort column B. To sort the column of numbers smallest to largest, use the SMALL function.
    D2=SMALL($B$2:$B$5,ROW()-1)
    D3=SMALL($B$2:$B$5,ROW()-1)
    D4=SMALL($B$2:$B$5,ROW()-1)
    D5=SMALL($B$2:$B$5,ROW()-1)
    To reorder Column A to match the newly sorted B column, use the LOOKUP function:
    C2=LOOKUP(D2,$B$2:$B$5,$A$2:$A$5)
    C3=LOOKUP(D3,$B$2:$B$5,$A$2:$A$5)
    C4=LOOKUP(D4,$B$2:$B$5,$A$2:$A$5)
    C5=LOOKUP(D5,$B$2:$B$5,$A$2:$A$5)
    You can do the same LOOKUP to re-order any other columns.
    EDIT: One major drawback in this is that the values in column B better be unique (i.e., no two alike). The sort of column B will go fine in any case but the matching up of the other columns will get hosed if B does not have uniques values. There may be a more robust way to do the matching besides LOOKUP.
    Message was edited by: Badunit

  • Sort B1 DataTable - Code Inside...

    Hi
    I hope this will help you ...
    In case you know a  better way to implement this - please post your code...
    [B1Listener(BoEventTypes.et_ITEM_PRESSED, false)]
            public virtual void OnAfterItemPressed(ItemEvent pVal)
                bool ActionSuccess = pVal.ActionSuccess;
                Form oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
                if (pVal.Row < 0)
                    //click on headers...
                    //call sort DT according to Col.
                    Grid oGrid = (Grid) oForm.Items.Item("CFLG").Specific;
                    DataTable oDT = oGrid.DataTable;
                    oForm.Freeze(true);
                    SortDT(ref oDT , pVal.ColUID);
                    oForm.Freeze(false);
            public static bool SortDT(ref DataTable oDT, string ColName)
                //Copy To System DT
                System.Data.DataTable oSysDT = new System.Data.DataTable();
                // Add Cols
                for (int iCol = 0; iCol < oDT.Columns.Count; iCol++)
                    oSysDT.Columns.Add(oDT.Columns.Item(iCol).Name);
                for (int iRow = 0; iRow < oDT.Rows.Count; iRow++)
                    System.Data.DataRow oRow =  oSysDT.NewRow();
                    for (int iCol = 0; iCol < oDT.Columns.Count; iCol++)
                        oRow[iCol] = oDT.GetValue(iCol, iRow);
                    oSysDT.Rows.Add(oRow);
                //Sort DT
                SortSystemDataTable(oSysDT, ColName);
                //Copy Sorted table to B1DT
                oDT.Rows.Clear();
                oDT.Rows.Add(oSysDT.Rows.Count);
                for (int iRowCount = 0; iRowCount < oSysDT.Rows.Count; iRowCount++)
                    for (int iColCount = 0; iColCount < oSysDT.Columns.Count; iColCount++)
                        string scol = oDT.Columns.Item(iColCount).Name;
                        int icol = oSysDT.Columns.IndexOf(scol);
                        string sValue = oSysDT.Rows[iRowCount].ItemArray[icol].ToString();
                        if (oDT.Columns.Item(iColCount).Type == BoFieldsType.ft_Date)
                            if (sValue.Length > 0)
                                DateTime dDate = DateTime.Parse(sValue);
                                oDT.SetValue(iColCount, iRowCount, dDate);
                        else
                            if (sValue.Length > 0)
                                oDT.SetValue(iColCount, iRowCount, sValue);
                return true;
            private static void SortSystemDataTable(System.Data.DataTable oDT, string Sort)
                System.Data.DataTable newDT = oDT.Clone();
                int rowCount = oDT.Rows.Count;
                System.Data.DataRow[] foundRows = oDT.Select(null, Sort); // Sort with Column name
                for (int i = 0; i < rowCount; i++)
                    object[] arr = new object[oDT.Columns.Count];
                    for (int j = 0; j < oDT.Columns.Count; j++)
                        arr[j] = foundRows<i>[j];
                    System.Data.DataRow data_row = newDT.NewRow();
                    data_row.ItemArray = arr;
                    newDT.Rows.Add(data_row);
                //clear the incoming dt
                oDT.Rows.Clear();
                for (int i = 0; i < newDT.Rows.Count; i++)
                    object[] arr = new object[oDT.Columns.Count];
                    for (int j = 0; j < oDT.Columns.Count; j++)
                        arr[j] = newDT.Rows<i>[j];
                    System.Data.DataRow data_row = oDT.NewRow();
                    data_row.ItemArray = arr;
                    oDT.Rows.Add(data_row);
    Enjoy,
    J.

    J,
    If you search the Business One SDK forum on this topic you will find many posts that may help you.  Here is one as an example ...
    Re: sorting db datatable
    HTH,
    Eddy

  • How do I stop iTunes from automatically sorting by Album Artist?  Driving me crazy.

    How do I stop iTunes from automatically sorting by Album Artist?  Driving me crazy.
    I listen to primarily classical music
    All of my music was very deliberatley titled by composers "Last Name, First Name" as the artist.
    iTunes is changing it to the Album Artist.  I have to go in and delete that information - AND THEN IT LATER REVERTS IT BACK!!!
    Hours have been wasted and I am feeling so ticked.
    Any help?

    Purchased or ripped media?
    If these are ripped mp3s then another possibility is multiple embedded tags. iTunes works best with a single ID3v2.3 tag. Some software creates both an ID3v1.0 and IDv2.x tag. With multiple tags it is not certain which iTunes reads or which it updates, and any device may choose differently. Once songs have the correct info. in iTunes you can use Convert ID3 Tags... None several times, then Convert ID3 Tags... v2.3. The process removes any embedded art but otherwise preserves the data that iTunes knows. You could use my script CreateFolderArt before and after to save and then restore the artwork.
    In the long run you may be better off populating Album Artist properly with a copy of whatever is currently in Artist. My script CopyArtistToAlbumArtist can do this effectively.
    tt2

  • How do I make a JTable's header sorting actually change the actual table?

    How do I make a JTable's header sorting actually change the actual table?
    Currently, I'm using
    table.setAutoCreateRowSorter(true);to allow the user to sort the table.
    However, I want to be able to load something based on the selected row's index. The problem is that when the table is rearranged, the change appears to only be local, in other words, the actual table isn't changing.
    For instance:
    index 0 "A"
    index 1 "B"
    index 2 "C"
    Sorted in reverse gives me
    "C"
    "B"
    "A"
    But C is still index 2 (instead of 0).
    Thanks in advance.

    Cross posted and answered in the Swing forum.
    [http://forums.sun.com/thread.jspa?threadID=5353865]
    I see this is not your first incidence of cross posting. In future, please post a question once only.
    db

  • Sorting of data in a Table

    Hi
    I am displaying some data in a table, but when i sort any column of the table output, it is giving preference to the rows which are in Capital letter then it is considering small.
    Eg:
    A
    B
    C
    a
    b
    c
    Is there any work around to make the sort as:
    A
    a
    B
    b
    C
    c
    Regards,
    Trikanth

    Hi Trikanth,
    Ok by default you can not sort it like you wanted. A workaround could a function module which sorts it like you want. When a user click on the sort function (table header) then it sorted based on ASCII that's correct. I'm sorry to say that it is not possible to disable the default sort function. This is something which I also need for some apps.
    Another question. Which data service returns you the data? If it is a RFC you can modify it, so that the data sorted as you want or otherwise you can modify the data, e.g. that everything is in lower case or in caps, therefore you can use a VC function UPPER().
    Best Regards,
    Marcel
    If this question is answered for you please mark the question as answered and reward points, otherwise ask me again.

  • ADF FACES: how to preserve the sort criteria for an af:table

    How can I preserve the sort criteria on an af:table across page invocations? I've searched all through the forum and I don't see anything on this topic.
    I simply want the sort criteria (from when the user clicks on a column header) to be remembered across multiple uses of the page. I know that the control handles this itself for multiple invocations of the same page (like when you page through the table). But I need to preserve the sort order so I can install it again when someone leaves the page and then returns to it.
    I've tried various attempts using a SortListener to record the sort criteria, but I can't figure out how to reinstall the criteria without generating exceptions from the table control.
    Any pointers on how to do this would be greatly appreciated.
    Thanks.
    Larry.

    Ok, I've solved the problems with the odd behavior by always creating a new model when the table data changes and copying the sort criteria into the new model, like this:
            // Construct our own CollectionModel from this result set
            if(_model == null) {
                // Construct the initial data model and set the starting sort criteria
                ListDataModel m = new ListDataModel(results);
                _model = new SortableModel(m);
                // Set the sort criteria to last name
                ArrayList criteria = new ArrayList();
                criteria.add(new SortCriterion("lastName", true));
                _model.setSortCriteria(criteria);
            } else {
                // Construct a new model so the table "sees" the change
                ListDataModel m = new ListDataModel(results);
                SortableModel sm = new SortableModel(m);
                sm.setSortCriteria(_model.getSortCriteria());
                _model = sm;
            }But, I end up with one final thing that doesn't work. In the "then" clause above, I try to set the initial sort criteria for the table - it has no effect. When the table is rendered, it is not sorted in any way.
    How can I specify an initial sort order for the table? Why is it ignoring the sort criteria on the model?
    Thanks.

  • Sorting & Filtering in the same table

    Hello,
    i had table with 5 entries in it.
    First Column  -     a, ba, ab, aa, bb
    Second Column - 4, 2, 1, 3, 5
    I had sucessfully implemented Sorting & Filtering functionality to that table.
    single Action:
    1) when I sort 'First' column, as expected it is sorting that column - display 5 rows
    2) when I filter 'First' column with value 'a', as expected it is filtering that column - display 4 rows (as 'a' is in 4 entries)
    Double Action:
    1) when I Filter 'First' column with value 'a', result displayed is 4 rows, then on that 4 entries when sorted the second column -- reuslt is good 4 entries (ie the sorting is done on the filtered entries)
    2)Vice vesa, when i sort 'Second' column & Filtered the first column - the displayed result is not correct
    First Option: (2 actions one after another) when sort second colum and then filtered the First column - result should be the sorted & filtered values of second column ignoring the first.(ie result should be -- a, aa, ab, ba, but filtering result is not sorted). How can i achive this?
    if first option is not possible then second option
    Second option: when i sort the second column & filter the first column,  then the result should be -- Filted the first column & sort the second column and then the result should display (it should be like sorting is done on the filtered values).
    Conclusion: If I filter a column, then filtered entries displayed should be in a sorting order (may be ascending).
    Thanks
    Maha
    Edited by: Maha Hussain on Aug 6, 2009 12:02 PM
    Edited by: Maha Hussain on Aug 6, 2009 12:18 PM
    Edited by: Maha Hussain on Aug 6, 2009 12:25 PM
    Edited by: Maha Hussain on Aug 6, 2009 12:56 PM

    Hi Maha,
    Please go through this pdf you will get the solution definitely,
    https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f024364b-3086-2b10-b2be-c0ed7d33fe65
    thanks,
    viswa

  • Want to change the default sort order of a Advanced table

    Hi all ,
    Hope all of you doing good.
    I am trying to change the deafult sort order of a " View Applicants" advanced table on Irecruitment selfservice page , using personalization feature but its not sorting as expected.
    The default sort order is asc by the name of the applicants. I wanted to override it by " Date Applied " desc using personalizing the advanced table.
    But its not sorting by Date applied and still shows the sort by applicant name.
    Any inputs will be greatly helpful
    I am using the Oracle Apps 11.5.10 version.

    Hey guys m I got the answer for the below question.
    Oracle have few Restriction and limitation on such Advanced table in sorting the data,
    Few of them are as mentioned below ...
    1. Sorting is not allowed for tables that allow inserts.
    2. Sorting is not supported for tables containing updateable columns
    3. Sorting is disabled when the Select column is checked for a row in a table or when Hide/Show is present in a table.
    Because of the above limitations , we cannot sort or override the existing alphabetical name sort order to Date applied sort order on the View Applicant advanced table.
    You can observe that , View Applicant page is having an option called "Update Status" which allow us to update applicant’s status or rating in the Advanced table.
    On such updatable advanced tables, oracle does not allow us to override the sort order on any of the table columns.
    Keeping it in a nutshell , I can say it's does not allow us to change the sort order of the view applicant advanced table ( which is having updateable columns ) to sort them in Date applied instead of Name( which is default ).

  • How to create an automatically increment column in Oracle DB Table?

    Hi To All
    Here I am trying to create a table in Oracle that creates an automatically increment column in Oracle DB Table. i searched almost all Forums.(Even in Oracle). They are saying that, that logic u must implement in Java Code.(*Takes Maximum no from table, add +1 to it, and store it back again)*. apart from this, while creating an table in Oracle, is there any facility like MySQL Database? please help me. Thanks in advance.

    Hi BalusC
    Thanks for Your Response and clue. with that, i succeeded in my application. Thank you very much. here i am giving you the details which i did.
    1. I Created a table named orders in Oracle like this.
       CREATE TABLE ORDERS (ORDER_ID NUMBER, CUSTOMER_ID NUMBER, ISBN NUMBER,
                                   DESCRIPTION NCHAR(5));
                       2. I created one sequence in Oracle like    CREATE SEQUENCE SEQ01 INCREMENT BY 1 START WITH 1000     3. Then i have written jdbc program like this
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    public class SequenceTest {
         public static void main(String[] args)throws Exception{
              try {
              Class.forName("oracle.jdbc.driver.OracleDriver");
              Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
              String cols[] = {"ORDER_ID", "DESCRIPTION"};
              PreparedStatement pstmt = con.prepareStatement("INSERT INTO ORDERS (ORDER_ID, CUSTOMER_ID, ISBN,DESCRIPTION) VALUES            (SEQ01.NEXTVAL, 104, 966431505,?)", cols);
              pstmt.setString(1,"Desc3");          
              pstmt.executeUpdate();
              ResultSet rs=pstmt.getGeneratedKeys();     
                    System.out.println("---- One Row Inserted ----");
              } catch (Exception e) {
                   System.out.println("---- Failed Due To "+e);               
       4. When i ran above program 5 times, i got the following Data into my Oracle Table (select * from orders)
      ORDER_ID CUSTOMER_ID       ISBN DESCR
          1000         101  966431502 Desc0
          1001         102  966431503 Desc1
          1002         103  966431504 Desc2
          1003         104  966431505 Desc3
          1004         104  966431505 Desc3
          1005         105  966431506 Desc4
    6 rows selected.
      But i dont know how to do this type of program with out using prepared statements. i tried, and i got exception *"Missing Expression"* .
    Once again Thank You very much for your clue.

  • Creating a master table and using it to populate other tables.

    Hi everyone.
    I am a novice at using Numbers and I need some direction.
    I am looking to create a master table with information for our summer camp. This table will include vital information such as name, address, etc. along with cabin assignments, tuitions received, and more.
    We will separate this information into smaller tables that different portions of that master table for specific use. Such as: names and addresses for leaders, names and tuitions for registration, etc.
    My goal is to type the information into the master table and have it update the other tables automatically. Can someone direct me how to format the master and sub tables so that this is possible?
    I would greatly appreciate it and it will greatly reduce the record-keeping time for our camp.
    Thank You!
    Roy

    Hi Roy,
    Welcome to the Numbers discussions. You are giving us a tall order, especially when we don't know your level of experience in programming spreadsheets.
    Here are a couple of basics to start the conversation...
    In normal spreadsheet programming, we Pull data from one location into another, we don't Push it or Send it. This should help you to understand that the hard work is done in the sub tables, not the master.
    You will use LOOKUP functions to pull the data to your sub tables. Download the Numbers User Guide and the Formulas and Functions User Guide and read up on them.
    In your master table, make sure you have one column that uniquely identifies each participant so it will be easy to reference that person in your sub tables.
    Regards,
    Jerry

  • To populate dynamically created int table with data from other table

    Hi everybody,
    I have already created an internal table dynamically, but now want to populate it with data from another IT depending on the plant name.
    My dynamic int table contains fields with plant name like '8001' ,'8002' and so on.
    no I want to read data from the other table and depending on bwkey which contains similar data like plant name , want to append to this new dynamic int table through read key statement.
    I cannot reference the field name hard coded as it does not allow field symbol reference to be hard coded.
    Pls help.

    Hi,
    Check the code below:
    REPORT  ztestdyn.
    TYPE-POOLS : slis.
    TABLES: yyle0003.
    DATA:
      g_exit    TYPE c,
      g_save    VALUE 'A',               "For parameter I_SAVE
      g_repid   LIKE sy-repid,           "For program name
      g_variant TYPE disvariant.         "For parameter IS_VARIANT
    *Tables
      DATA: d_ref TYPE REF TO data,
            d_ref1 TYPE REF TO data,
            i_alv_cat1 TYPE TABLE OF lvc_s_fcat,
            ls_alv_cat1 LIKE LINE OF i_alv_cat1.
      DATA: BEGIN OF total_tab OCCURS 0 ,
            tknum TYPE yyle0003-tknum,
            quantity TYPE p,  "yyle0003-QUANTITY,
            END OF total_tab.
      DATA: BEGIN OF g_scandata_tab OCCURS 0.
              INCLUDE STRUCTURE yyle0003.
      DATA: END OF g_scandata_tab.
      DATA: g_yyle0003_tab LIKE yyle0003 OCCURS 0 WITH HEADER LINE.
      DATA: g_itab1 TYPE TABLE OF yyle0003.
      DATA: wa_itab1 LIKE g_scandata_tab.
      TYPES: BEGIN OF itab2,
             tknum TYPE yyle0003-tknum,
             vhilm TYPE yyle0003-vhilm,
             quantity TYPE p,
             END OF itab2.
      DATA: g_itab3 TYPE TABLE OF itab2.
      DATA: wa_itab3 TYPE itab2.
      DATA: g_itab5 TYPE TABLE OF itab2.
      DATA: wa_itab5 TYPE itab2.
      DATA: g_itab4 TYPE TABLE OF itab2.
      DATA: wa_itab4 TYPE itab2.
      DATA: gv_wa TYPE REF TO data.
      DATA : wa_tab TYPE itab2.
      DATA: BEGIN OF itab6 OCCURS 0,
             vhilm TYPE yyle0003-vhilm,
             quantity TYPE p,
             END OF itab6.
    ******************Start of Internal Table Definition *******************
      DATA:
            g_custom_container_0100 TYPE REF TO cl_gui_custom_container,
            g_alv_grid_0100    TYPE REF TO cl_gui_alv_grid,
            g_container_0100   TYPE scrfname VALUE 'LIST',
            g_mylayout         TYPE lvc_s_layo,
            ok_code            LIKE sy-ucomm.
      FIELD-SYMBOLS :<f_fs> TYPE table,
                     <f_fs11> TYPE table,
                     <f_fs1> TYPE table,
                     <f_fs3> TYPE ANY,
                     <f_fs4> TYPE ANY,
                     <f_field> TYPE ANY,
                     <f_fs5> TYPE ANY.
      FIELD-SYMBOLS: <fs_wa> TYPE ANY.
      DATA: l_var TYPE i,
            l_i   TYPE i.
      DATA: l_var1 TYPE char20,
            l_var2 TYPE char20.
    DATA: l_TOTAL TYPE I,
          L_FILL TYPE i,
          L_TOT  TYPE I.
    DATA: l_int TYPE i,
           l_sum TYPE i.
    FIELD-SYMBOLS: <f_fs2> TYPE  itab2, "
                     <f_fs6> TYPE ANY,
                     <f_fs7> TYPE ANY.
      DATA: l_var3 TYPE char15.
      DATA: l_quant TYPE p.
    FIELD-SYMBOLS: <f_fs8> LIKE itab6, "
                     <f_fs9> TYPE ANY,
                     <f_fs10> TYPE ANY.
    FIELD-SYMBOLS : <f_fs12> TYPE ANY,
                      <f_fs13> TYPE ANY.
      SORT g_scandata_tab BY tknum vhilm.
      LOOP AT g_scandata_tab INTO wa_itab1.
        MOVE-CORRESPONDING wa_itab1 TO wa_itab3.
        APPEND wa_itab3 TO g_itab3.
      ENDLOOP.
      LOOP AT g_itab3 INTO wa_itab3.
        COLLECT wa_itab3 INTO g_itab4.
      ENDLOOP.
      LOOP AT g_itab4 INTO wa_itab4.
        MOVE-CORRESPONDING wa_itab4 TO wa_itab5.
        MOVE-CORRESPONDING wa_itab4 TO itab6.
        APPEND wa_itab5 TO g_itab5.
        COLLECT itab6.
      ENDLOOP.
      CLEAR wa_itab3.
      SORT g_itab4 BY tknum vhilm.
      DELETE ADJACENT DUPLICATES FROM g_itab4 COMPARING vhilm.
      DESCRIBE TABLE g_itab4 LINES l_var.
      l_i = '2'.
      ls_alv_cat1-fieldname = 'TKNUM'.
      ls_alv_cat1-col_pos = 1.
      ls_alv_cat1-coltext ='ShipmentNo.'.
      APPEND ls_alv_cat1 TO i_alv_cat1.
      DATA: l_var4(10) TYPE c,
            l_var5(10) TYPE c,
            l_fieldname(20) TYPE c..
      LOOP AT g_itab4 INTO wa_itab4.
        IF l_var >= 1.
          CONDENSE wa_itab4-vhilm NO-GAPS.
          ls_alv_cat1-fieldname = wa_itab4-vhilm. "l_fieldname.
          ls_alv_cat1-col_pos = l_i.
          ls_alv_cat1-coltext = wa_itab4-vhilm.
          ls_alv_cat1-do_sum  ='X'.
          APPEND ls_alv_cat1 TO i_alv_cat1.
          CLEAR : ls_alv_cat1, l_fieldname.
          l_i = l_i + 1.
        ENDIF.
        AT LAST.
          ls_alv_cat1-fieldname = 'TOTAL'. "l_fieldname.
          ls_alv_cat1-col_pos = l_i.
          ls_alv_cat1-coltext = 'TOTAL'.
          ls_alv_cat1-do_sum  ='X'.
          APPEND ls_alv_cat1 TO i_alv_cat1.
          CLEAR : ls_alv_cat1, l_fieldname.
        ENDAT.
        SORT i_alv_cat1 BY fieldname.
        DELETE ADJACENT DUPLICATES FROM i_alv_cat1.
      ENDLOOP.
      SORT i_alv_cat1 BY col_pos.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = i_alv_cat1
        IMPORTING
          ep_table = d_ref.
      ASSIGN d_ref->* TO <f_fs>.
      CREATE DATA gv_wa LIKE LINE OF <f_fs>.
      ASSIGN gv_wa->* TO <fs_wa>.
      DELETE ADJACENT DUPLICATES FROM <f_fs> COMPARING ALL FIELDS.
        LOOP AT itab6.
        CLEAR wa_itab5.
        wa_itab5-tknum = 'Total'.
        MOVE-CORRESPONDING itab6 TO wa_itab5.
        APPEND wa_itab5 TO g_itab5.
        CLEAR wa_itab5.
      ENDLOOP.
         DESCRIBE TABLE g_itab5 LINES L_TOT.
           LOOP AT TOTAL_TAB.
          L_TOTAL = L_TOTAL + total_tab-quantity.
         ENDLOOP.
      LOOP AT g_final ASSIGNING <f_fs2>.
        ASSIGN COMPONENT 'TKNUM' OF STRUCTURE <f_fs2> TO <f_fs6>.
        ASSIGN COMPONENT 'TKNUM' OF STRUCTURE <fs_wa> TO <f_fs7>.
        <f_fs7> = <f_fs6>.
        CONDENSE <f_fs2>-vhilm NO-GAPS.
        ASSIGN COMPONENT 'VHILM' OF STRUCTURE <f_fs2> TO <f_fs3>.
        ASSIGN COMPONENT 3 OF STRUCTURE <f_fs2> TO <f_fs4>.
        MOVE <f_fs3> TO l_var1.
        ASSIGN COMPONENT l_var1 OF STRUCTURE <fs_wa> TO <f_fs5>.
        <f_fs5> =  <f_fs4>.
        CLEAR total_tab-quantity.
        READ TABLE total_tab WITH KEY tknum = <f_fs6>.
        IF sy-subrc = 0.
          ASSIGN total_tab-quantity TO <f_fs12>.
          ASSIGN COMPONENT 'TOTAL' OF STRUCTURE <fs_wa> TO <f_fs13>.
          <f_fs13> = <f_fs12>.
        ENDIF.
        L_FILL = L_FILL + 1.
        IF L_FILL = L_TOT.
         ASSIGN L_TOTAL TO <f_fs12>.
          ASSIGN COMPONENT 'TOTAL' OF STRUCTURE <fs_wa> TO <f_fs13>.
          <f_fs13> = <f_fs12>.
        ENDIF.
        AT END OF <f_fs2>-tknum.
          APPEND <fs_wa> TO <f_fs>.
          CLEAR  <fs_wa>.
        ENDAT.
      ENDLOOP.
      CLEAR: <f_fs6>,
              <f_fs7>.
      CLEAR <fs_wa>.
    CALL SCREEN 0100.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'ZVKS'.
      SET TITLEBAR 'ZVKS'.
      CHECK sy-ucomm IS INITIAL.
      SORT g_scandata_tab BY tknum vhilm.
      CREATE OBJECT g_custom_container_0100
             EXPORTING container_name = g_container_0100
             EXCEPTIONS
               cntl_error = 1
               cntl_system_error = 2
               create_error = 3
               lifetime_error = 4
               lifetime_dynpro_dynpro_link = 5.
      CREATE OBJECT g_alv_grid_0100
             EXPORTING i_parent = g_custom_container_0100.
      g_mylayout-grid_title = 'Display Scanning data'.
      CALL METHOD g_alv_grid_0100->set_table_for_first_display
        CHANGING
          it_outtab                     = <f_fs>
          it_fieldcatalog               = i_alv_cat1
                    EXCEPTIONS
                      invalid_parameter_combination = 1
                      program_error                 = 2
                      too_many_lines                = 3
                      OTHERS                        = 4.
      IF sy-subrc <> 0.
                  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    Regards
    Kannaiah

  • Disable sorting and resizing columns on table view

    Is there a way to disable sorting and resizing columns on table view?
    Thanks

    Use
    setSortable(false)
    setResizable(false)
    on each TableColumn

Maybe you are looking for

  • Prevent Safari to automatically go to address bar on opening a new tab?

    I just got a mac and I absolutely love it, I have been equally impressed with safari. Yet, when I open a second tab in Safari it always seems to automatically go to the address bar instead of going to the google search field. This seems odd as openin

  • Why have some apps on my Ipad turned into a grey box with lines in it?

    3 apps on my ipad have turned from icons into grey boxes with lines in them. When I click on them, they try updating but it doesn't complete. What's going on here? Is this some kind of virus?

  • Drop down required for select-options

    drop down required for select-options as displayed in VT01N 'shipment type'.

  • What Cisco UC product can announce the caller ID?

    Is there a Cisco UC product that can announce the caller when the phone rings?  Can you pick and choose when to announce caller ID?  We just want to announce calls that are delivered to the IPCC extension only based on the incoming DNIS.  Environment

  • Distribution and Licensing

    I've built an air app for my customers to use. They login with a user and pass Now i'm at the stage of distributing the app, i think a secure download would be the best way. So how do i go about this? Does anyone have any experience of distributing a