Sorting Data in Tables

Hi anyone help with trying to resolve an issue with sorting data in a table I have created in Pages 08 v 3.0.2.
I have a table six columns across with rows down of data. I have so far entered 10 rows of data and wanted to sort the data based on column 1 then column 2 with the associated data in the other columns staying connected to column 2. Fairly straightforward stuff I thought so clicked the table header for column 1 then the ascending sort button in Inspector the results I got were not quite what I expected.
Here are three lines of data taken from columns 1 & 2. The sequence below is how I entered it. The data as you will see relates to classical music. In column 1 is the single word 'Mozart' all the other data is in column 2 on one line:
Mozart Symphony No 29 in A Major KV201
Mozart Symphony No 4 in D Major KV19
Mozart Symphony No 36 in C Major KV425 'Linz'
When I clicked the header for column 1 then the button in Inspector to sort the data ascending this is the result I got:
Mozart Symphony No 29 in A Major KV201
Mozart Symphony No 36 in C Major KV425 'Linz'
Mozart Symphony No 4 in D Major KV19
The first two entries are in the right order but the third one should obviously be first. Anyone know how I could resolve the issue I have with sorting data in the table I have created?
Thanks ....

Just to expand on Beatrice's answer, Pages (as most other word processors) sorts alphabetically. 4 comes after 39 alphabetically because the 4 comes after the 3. It doesn't think, "oh, that's the number 4 which is smaller than the number 39." By placing the leading 0 we wind up comparing 04 to 39 and yes, the zero is in front of the 3 so it gets placed ahead of it.

Similar Messages

  • Pb retrieving sorted data from Table in SQL.

    Hi,
    I get problem to retrieve data in the right order from table in database SQL.
    See code attached: code.png
    I want to sort data according to ID number And then to retrieve those data and fill out a ring control in the right order "descending" .
    But i got always ID 2 instead of 1. See attached  picture : control.png
    it seems that the select statement (see under) is not woking properly. But it is working well in a query in Access DataBase .  
    //Select statement
       hstmt = DBActivateSQL (hdbc, ("SELECT * FROM %s ORDER BY ID DESCENDING",szTableName));
       if (hstmt<= DB_SUCCESS) {ShowError(); goto Error;}
    Some idea ??
    Lionel.
    Attachments:
    code.PNG ‏39 KB
    control.png ‏32 KB

    Hello Lionel,
    According to the document Robert linked, the prototype of DBActivateSQL() is:
    int statementHandle = DBActivateSQL (int connectionHandle, char SQLStatement[]);
    For the 2nd parameter(SQLStatement), you're sending:
    ("SELECT * FROM %s ORDER BY ID DESCENDING",szTableName)
    Probably your intention is to substitute %s with szTableName, but that's not what it happens.
    By using comma operator, ("SELECT * FROM %s ORDER BY ID DESCENDING",szTableName) is evaluated to szTableName, so you call is equivalent to:
    hstmt = DBActivateSQL (hdbc, szTableName);
    In order to substitute %s with szTableName you need to first build the string you're passing as the 2nd parameter:
    char query[512];
    sprintf(query, "SELECT * FROM %s ORDER BY ID DESCENDING",szTableName);
    hstmt = DBActivateSQL (hdbc, query);

  • How can I Sort Data in table maintenance generator view

    Hi SAP Gurus,
    Please help me to know, In my view table I have data, time and open value and close value columns. In that I want to sort the data column in ascending order, how can I do that. Please suggest.
    Thanks and Regards
    Lakshmikanth

    Hi
    Thanks for the reply. That did not solved my problem.
    extract] = gt_ztest[ .
    gt_ztest] = extract[ .
    why the brackets r in this way??
    this is showing error, 'The field "EXTRACT[" is unknown, but there is a field with the similarname "EXTRACT". .'
    what can I do..
    Regards,
    Lakshmikanth

  • Sort data of pl/sql table

    how will i sort data of pl/sql table

    There is no such thing as a PL/SQL table.
    There is however such a thing as a PL/SQL array. And sorting it can be done using numerous of sorting algorithms like quick sort, bubble sort, binary sort and so on.
    The obvious question is though why go to all this problems when Oracle provides tables.. and the SQL language can do the sorting and filtering for you?
    What the heck is your data doing in an array then and why it it not in an Oracle table, or temp table?

  • How to stored data after clicking check box save in data base table

    TABLES:mseg,mard,mkpf.
    TYPE-POOLS:slis.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:smblnr FOR mseg-mblnr MODIF ID m1,
                   smatnr FOR mseg-matnr MODIF ID m2,
                   swerks FOR mard-werks MODIF ID m3,
                   slgort FOR mard-lgort MODIF ID m4,
                   slgpbe FOR mard-lgpbe MODIF ID m5,
                   scharg FOR mseg-charg MODIF ID m6,
                   sbwart FOR mseg-bwart MODIF ID m7,
                   skostl FOR mseg-kostl MODIF ID m8,
                   saufnr FOR mseg-aufnr MODIF ID m9,
                   srsnum FOR mseg-rsnum MODIF ID m10.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS:pre RADIOBUTTON GROUP radi USER-COMMAND ucomm DEFAULT 'X',
               pse RADIOBUTTON GROUP radi,
               bps RADIOBUTTON GROUP radi.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETER:layout TYPE i.
    SELECTION-SCREEN END OF BLOCK b3.
    DATA:BEGIN OF itab OCCURS 0,
         mblnr LIKE mseg-mblnr,
         matnr LIKE mseg-matnr,
         werks LIKE mard-werks,
         lgort LIKE mard-lgort,
         lgpbe LIKE mard-lgpbe,
         charg LIKE mseg-charg,
         bwart LIKE mseg-bwart,
         budat LIKE mkpf-budat,
         menge LIKE mseg-menge,
         meins LIKE mseg-meins,
         kostl LIKE mseg-kostl,
         aufnr LIKE mseg-aufnr,
         rsnum LIKE mseg-rsnum,
         checkbox TYPE c,
         END OF itab.
    DATA:  gt_fieldcat TYPE slis_t_fieldcat_alv,
           gw_fieldcat TYPE slis_fieldcat_alv,
           gt_layout TYPE slis_layout_alv.
    START-OF-SELECTION.
    SELECT msegmblnr msegmatnr mardwerks mardlgort mardlgpbe msegcharg msegbwart mkpfbudat
        msegmenge  msegmeins msegkostl msegaufnr mseg~rsnum
    INTO TABLE itab FROM
              mseg JOIN mard ON mardmatnr EQ msegmatnr
                   JOIN mkpf ON msegmblnr EQ mkpfmblnr
                   WHERE mseg~matnr IN smatnr.
      IF sy-subrc EQ 0.
        SORT itab BY matnr.
        PERFORM display_alv_output.
      ENDIF.
    *&      Form  display_alv_output
          text
    -->  p1        text
    <--  p2        text
    FORM display_alv_output.
      REFRESH gt_fieldcat.
      gw_fieldcat-fieldname = 'MBLNR'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 1.
      gw_fieldcat-seltext_m = 'material document'.
      gw_fieldcat-key = 'x'.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'MATNR'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 2.
      gw_fieldcat-seltext_m = 'material'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'WERKS'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 3.
      gw_fieldcat-seltext_m = 'plant'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'LGORT'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 4.
      gw_fieldcat-seltext_m = 'storage location'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'LGPBE'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 5.
      gw_fieldcat-seltext_m = 'storage bin'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'CHARG'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 6.
      gw_fieldcat-seltext_m = 'Batch number'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'BWART'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 7.
      gw_fieldcat-seltext_m = 'Movement Type (Inventory Management)'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'BUDAT'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 8.
      gw_fieldcat-seltext_m = 'Posting Date in the Document'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'MENGE'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 9.
      gw_fieldcat-seltext_m = 'QUANTITY'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'MEINS'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 10.
      gw_fieldcat-seltext_m = 'Basic unit of measure'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'KOSTL'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 11.
      gw_fieldcat-seltext_m = 'Cost center'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'AUFNR'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 12.
      gw_fieldcat-seltext_m = 'Order Number'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'RSNUM'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 13.
      gw_fieldcat-seltext_m = 'Number of Reservation / Depe'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-col_pos = 14.
      gw_fieldcat-fieldname = 'CHECKBOX'.
      gw_fieldcat-seltext_m = 'Compltd'.
      gw_fieldcat-checkbox = 'X'.
      gw_fieldcat-edit = 'X'.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM                = 'ZREPORT'
        IS_LAYOUT                         = gt_layout
        IT_FIELDCAT                       = gt_fieldcat
       TABLES
         t_outtab                          = itab
      EXCEPTIONS
        PROGRAM_ERROR                     = 1
        OTHERS                            = 2.
    ENDFORM.                    " display_alv_output
    this is mycode .
    send me replay.

    Hi Lakshmi,
           Can u explain briefly what is ur requirement. U mean to say that after clicking the checkbox in data base table or Screen?
    Regards,
      Jayaram...

  • How to delete data in table control

    Hi,
    I am doing module pool programming. After the user enters the data in table control after saving the data. if the user wants to  remove the line item the line item shd be removed from the screen and data base.
    Please Give me vaulable Suggestions
    Regards

    Hi,
    Screen 8002 (with table control) --> select records --> press delete button --> delete selected records
    Now you wan to delete those records selected by the user at runtime when DELETE button is clicked.
    Take another internal table and work area same as the initial internal table and work area used in screen 8002 which is to be used to delete the selected data.
    Take the names of the input/output fields as work_area-field_name and select column in table control as work_area-flag.
    Also take a flag field of size 1 datatype character as the last field in the internal table and work area while declaration.
    You must have passed a code in PBO of the screen for reading internal table into the table control.
    So it reads the internal table into the table control whenever you perform any action on use command.
    All you need to do is to write a code to modify the internal table form the table control while performing any user action.
    Remember to change the LINE SEL option in attributes of table control as MULTIPLE.
    At screen logic,
    PROCESS BEFORE OUTPUT.
      MODULE status_8002. "for pf-status
      LOOP WITH CONTROL po_tab. "po_tab is table control
        MODULE pass_data. "to pass data into table control from internal table
      ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE user_command_8002. "for user command(back and exit)
      LOOP WITH CONTROL po_tab.
        MODULE modify_data. "to modify data from table control into table control
      ENDLOOP.
      MODULE delete. "to delete the selected records
    In PBO,
    *&      Module  STATUS_8002 OUTPUT
    MODULE status_8002 OUTPUT.
      SET pf-status 'ZAB_PFSTA'. " pf-status
      DATA : line_count TYPE i.
      DESCIRBE TABLE it_ekpo
      LINES line_count.
      po_tab-lines = line_count + 10.
      " to make table control scrollable
    ENDMODULE.                 " STATUS_8002  OUTPUT
    *&      Module  PASS_DATA  OUTPUT
    MODULE pass_data OUTPUT.
      READ TABLE it_ekpo into wa_ekpo INDEX po_tab-current_line.
    ENDMODULE.                 " PASS_DATA  OUTPUT
    "it_ekpo is internal table and wa_ekpo is the work area
    In PAI,
    *&      Module  MODIFY_DATA  INPUT
    MODULE MODIFY_DATA INPUT.
      MODIFY IT_EKPO INDEX PO_TAB-CURRENT_LINE FROM WA_EKPO.
      "modify records from table control into the internal table
    ENDMODULE.                 " MODIFY_DATA  INPUT
    *&      Module  DELETE  INPUT
    MODULE DELETE INPUT.
      OK_CODE = SY-UCOMM.
      CASE OK_CODE.
        WHEN 'DELETE'. "when delete button is clicked
          SORT IT_EKPO BY FLAG DESCENDING. "sort by flag(selection column value)
          CLEAR WA_EKPO1.
          CLEAR WA_EKPO.
          REFRESH IT_EKPO1.
          LOOP AT IT_EKPO INTO WA_EKPO WHERE FLAG = 'X'.
            DATA : J TYPE I.
            CLEAR J.
            J = SY-TABIX. "assign index value if a record is selected
            MOVE-CORRESPONDING WA_EKPO TO WA_EKPO1. "append selected records to another
            "work area and append to another internal table to delete
            APPEND WA_EKPO1 TO IT_EKPO1.
            DELETE IT_EKPO. "delete the selected records from initial internal table
            " to reflect the changes on the table control
          ENDLOOP.
          IF J = 0.
            MESSAGE I006. "if no record selected
          ELSE. "if some records are selected
            DELETE ZEKPO FROM TABLE IT_EKPO1. "delete from database table
            COMMIT WORK.
            IF SY-SUBRC = 0.
              MESSAGE S007. "success message (records deleted)
            ENDIF.
          ENDIF.
      ENDCASE.
    ENDMODULE.                 " DELETE  INPUT
    Now at PAI, you have delete records and these changes are reflected back to the internal table.
    Now when PBO is executed it will again read the initial internal table and will not show the deleted records.
    Hope this solves your problem.
    Thanks & Regards,
    Tarun Gambhir

  • Sort the internal table based on the vendor field

    hello experts,
    I am stuck with a small problem...
    I am uploading the data for partner association for vendors through lsmw BI program.
    I am collecting all the records in the end of trasaction and downloading all those records on to the apps server.
    I declared one internal table as
    TYPES: BEGIN OF type_erecord,
            mesg(1000) TYPE c,
            END OF type_erecord.
    DATA: t_precord type standard table of type_erecord initial size 0,
                w_precord type type_erecord.
    I am concatenating all the fields and moving to the internal table..
    concatenate zvendor_master-source  zvendor_master-lifnr  blf00-lifnr                   
                      zvendor_master-lname    zvendor_master-parvw
                      zvendor_master-psource  zvendor_master-pname
                      zvendor_master-lifn2        bwyt3-lifn2
                      zvendor_master-ekorg      zvendor_master-werks   
                      w_PLANT-muplant           zvendor_master-defpa
                      v_message
          into w_precord-mesg separated by c_pipe.
          append w_precord to t_precord.
    now at the end I have to sort this internal table t_precord based on blf00-lifnr
    can any one guide me how to do it
    Thanks for your anticipation
    Nitesha

    OK...
    Than you can create one more table and do the process of sorting and than put data into the final table.
    TYPES: BEGIN OF type_erecord,
    mesg(1000) TYPE c,
    END OF type_erecord.
    DATA: t_precord type standard table of type_erecord initial size 0,
    w_precord type type_erecord.
    TYPES: BEGIN OF type_erecord_1,
    mesg(1000) TYPE c,
    lifnr type blf00-lifnr ,  "<<<
    END OF type_erecord_1.
    DATA: t_precord_1 type standard table of type_erecord initial size 0,
    w_precord_1 type type_erecord.
    I am concatenating all the fields and moving to the internal table..
    concatenate zvendor_master-source zvendor_master-lifnr blf00-lifnr
    zvendor_master-lname zvendor_master-parvw
    zvendor_master-psource zvendor_master-pname
    zvendor_master-lifn2 bwyt3-lifn2
    zvendor_master-ekorg zvendor_master-werks
    w_PLANT-muplant zvendor_master-defpa
    v_message
    into w_precord_1-mesg separated by c_pipe.
    w_precord_1-lifnr = blf00-lifnr .  " <<<
    append w_precord_1 to t_precord_1.   " <<<
    SORT T_PRECORD_1 by LIFNR.  " <<
    LOOP AT T_PRECORD_1 into w_precord_1.
      move-corresponing w_precord_1 to w_precord.
      append w_precord to T_PRECORD.
      clear  w_precord .
    endloop.
    Regards,
    Naimesh Patel

  • How to Insert data from Table A to Table B

    Hi,
    I have to insert data from Table A into Table B.
    Table A is having 100 records and table B is having 10000 records.
    Condition is if data in Table A is not in table B then I have to insert into Table B or else I have to skip that.
    Can anyone help me with sample code.
    Thanks in advance and points are awarded for usefull answers.
    Thanks,
    Kumar.

    Hello Kumar
    Assuming that tables A and B have the same structure you can use the same logic as change documents are prepared. Assuming both of your itabs are of structure struc_a. Then define the following type:
    TYPES: BEGIN OF ty_s_itab_di. 
    INCLUDE TYPE struc_a.
    TYPES: CHIND  TYPE bu_chind.
    TYPES: END OF ty_s_itab_di.
    TYPES: ty_t_itab_di  TYPE STANDARD TABLE OF ty_s_itab_di                     
    WITH DEFAULT KEY.
    DATA:    gt_itab_old  TYPE ty_t_itab_di,
    gt_itab_new TYPE ty_t_itab_di.
    Fill itabs gt_Itab_old with the corresponding data of itab1 and gt_itab_new with the corresponding data of itab2.
    Very important: sort you itabs either by all key fields or by all fields.
    Call function <b>CHANGEDOCUMENT_PREPARE_TABLES</b> with the following parameters:
    - CHECK_INDICATOR = ' '
    - TABLE_NEW = gt_Itab_new
    - TABLE_OLD = gt_itab_old
    The function module will remove identical lines from both itabs. New entries in gt_itab_New will have CHIND = 'I' and deleted entries in gt_itab_old will have CHIND = 'D'. Modified entries are indicated by CHIND = 'U'.
    Read the documentation of the function module and play around with it. You will see that this a quite easy yet powerful approach for comparing itabs.
    Regards
    Uwe

  • How do I sort data in columns using Pages

    How do I sort data in columns (alphabetically) using Pages?

    If you are referring to text or numbers in a column (not table), then get the free Service plug-in WordService, from Devon Technologies. Put it in the
    /Users/yourlogin/Library/Services folder location.
    Select your data to be sorted. From the Pages menu > Services > Sort Ascending will do the trick. This will work with Pages ’09 and Pages v5.2 or later, as well as Apple Mail, TextEdit, etc.
    The WordService files include a PDF (Read Me) that describes the services included with the package.
    The Service items will only appear in the Services submenu when you have selected your data prior to sort. If these WordService items do not appear in the Services menu as they should per the preceding sentence, then you will need to enable them.
    System Preferences > Keyboard > Shortcuts > Services. Scroll through the right hand list of services until you encounter Sort Ascending and ensure that it is selected.
    If you were referring to sorting a column of data in a table:
    Pages ’09
    Select all cells containing your unordered data. In the Table Inspector, under Edit Rows & Columns, choose Sort Ascending.
    Pages v5.2
    Select cells as before. In the Table heading (A, B, C, etc.) when you roll over the letter, a down-arrow appears. Click, and choose Sort Ascending from the drop down menu.

  • How to sort an internal table with a header line?

    hi all,
    i have declared table i_bseg type standard table of bseg with header line.
    now i have populated data in i_bseg.
    now i am sorting it by bukrs
    ie i am writing sort i_bseg by bukrs.
    before sorting all i_bseg-belnrs were populated...
    but after sorting the contents of  the i_bseg is changing.
    some of the belnrs are getting deleted..
    is there any special way to sort an internal table with header line...?

    hi,
    <b>SORT <itab> [ASCENDING|DESCENDING] [AS TEXT] [STABLE].</b>
    The statement sorts the internal table <itab> in ascending order by its key.<b> The statement always applies to the table itself, not to the header line</b>.
    If you have an internal table with a structured line type that you want sort by a different key, you can specify the key in the SORT statement:
    SORT <itab> [ASCENDING|DESCENDING] [AS TEXT] [STABLE]
                 BY <f1> [ASCENDING|DESCENDING] [AS TEXT]
                    <fn> [ASCENDING|DESCENDING] [AS TEXT].
    <b>this is your sort statement:  sort i_bseg by bukrs.
    you try with this statement:  sort i_bseg by bukrs STABLE.</b>
    regards,
    Ashokreddy

  • Problem with column sorting in af:table

    Hi,
    I am populating an af:table using programmatic view object. One of the columns of the table has its sorting set to true. However, when i click on the sort arrow in the column, no data is loaded, and it displays a message "No data to display."
    Kindly, help me in resolving the issue. Thanks in advance for yours assistance.
    Regards,
    Max.

    Hi all,
    I have an exact scenario what you explained. Let me explain my scenario and the way i implemented.
    Mine is also custom java data source implementation where i get data from a service. Followed the implementation details given in document.
    How the framework works:
    1. code to retrieve data from service is written inside executeQueryForCollection.
    2. hasNextForCollection returns true or false based on the no. of data fetched. setFetchComplete(true) is set when it reaches the end of retrieved data.
    3. createRowFromResultSet will be called until setFetchComplete is set to true.
    Worked fine and i am able to get the data in my view object.
    1st Issue:
    Since the code to retrieve data from service is written inside executeQueryForCollection, everytime it is getting executed whenever executeQuery is called (eg. in-memory filtering/sorting, table filtering, table sortine), which is a performance issue. I don't want to call my service often since i've retrieved all the data already.
    Tried:
    I added an if condition inside executeQueryForCollection to skip service call (skipped only service call but not hasNextForCollection() and super.executeQueryForCollection()) by adding a service call flag. Default flag value is false. Whenever we need service call, we need to set the flag (i.e. it is actually a property with setter and getter) to true, followed by executeQuery().
    2nd issue:
    when user performs table filtering/sorting, since i skipped the service call, since there is no rows to populate, createRowFromResultSet() will not be called and so i couldn't see any data in table at all. (I don't know why it expect me to give data.)
    Tried:
    To solve this, i added a local variable to keep the retrived data from service. Whenever i perform service call, i'll keep the data in a local variable. By doing this, whenever executeQueryForCollection is called, i'll check the service call flag. It will be false. In the else part i set the local variable data as user data for collection. The only difference in this implementation is that instead of serving the data from service, i serve data from the local variable. By doing this, filtering/sorting is working fine and i am able to avoid the service call too (but i am not able to avoid the createRowFromResultSet().)

  • Time Out Dump while extracting data from table CKIS

    Dear Friends,
    I am getting TIme Out dump for the below code, while extracting data from table CKIS.
    Table CKIS doesn't have any Indexes. Please guide me to resolve this.
    Regards,
    Viji.
    form get_keko_ckis.
      SELECT kalnr kalka kadky tvers bwvar matnr werks kokrs
             FROM keko
             INTO TABLE i_keko1
             FOR ALL ENTRIES IN i_final_modify
                 WHERE matnr = i_final_modify-main_f
                   AND werks = p_werks
                   AND kokrs = p_kokrs
                   AND kadat = p_kadat
                   AND bidat = p_bidat
                   AND bwdat = p_bwdat.
      IF sy-subrc = 0.
        SORT i_keko1 BY kalnr kalka kadky tvers bwvar.
        SELECT kalnr kalka kadky tvers bwvar posnr typps kstar
               matnr menge gpreis
               FROM ckis
               INTO TABLE i_ckis_temp
               FOR ALL ENTRIES IN i_keko1
               WHERE kalnr = i_keko1-kalnr
                 AND kalka = i_keko1-kalka
                 AND kadky = i_keko1-kadky
                 AND tvers = i_keko1-tvers
                 AND bwvar = i_keko1-bwvar.
            IF sy-subrc = 0.
              SORT i_ckis_temp BY kalnr kalka kadky tvers bwvar.
              LOOP AT i_ckis_temp INTO wa_ckis_temp.
                wa_ckis-kalnr  = wa_ckis_temp-kalnr.
                wa_ckis-kadky  = wa_ckis_temp-kadky.
                wa_ckis-posnr  = wa_ckis_temp-posnr.
                wa_ckis-typps  = wa_ckis_temp-typps.
                wa_ckis-kstar  = wa_ckis_temp-kstar.
                wa_ckis-matnr1 = wa_ckis_temp-matnr1.
                wa_ckis-menge  = wa_ckis_temp-menge.
                wa_ckis-gpreis = wa_ckis_temp-gpreis.
              CLEAR wa_keko1.
              READ TABLE i_keko1 INTO wa_keko1
                                 WITH KEY kalnr = wa_ckis_temp-kalnr
                                          kalka = wa_ckis_temp-kalka
                                          kadky = wa_ckis_temp-kadky
                                          tvers = wa_ckis_temp-tvers
                                          bwvar = wa_ckis_temp-bwvar
                                          BINARY SEARCH.
                 IF sy-subrc = 0.
                    wa_ckis-matnr = wa_keko1-matnr.
                    wa_ckis-werks = wa_keko1-werks.
                 ENDIF.
                 APPEND wa_ckis TO i_ckis.
                 CLEAR: wa_ckis_temp, wa_ckis.
              ENDLOOP.
            ENDIF.
        REFRESH: i_keko1, i_ckis_temp.
      ENDIF.
    endform.                    " get_keko_ckis

    Hi Try minimising the conditions in where clause
         SELECT fields..... FROM CKIS
         WHERE KALNR = KEKO-KALNR AND
                      KADKY = KEKO-KADKY AND
                      TVERS = KEKO-TVERS AND
                      TYPPS = 'M'.
        after this, deleting unwanted records from internal table as per pending conditions...
    Regds,
    Anil

  • How to sort data in Matrix report

    I've used Report6i and create report in Matrix format.I want the report to display data in sorting by data in cell. Anyone pls help me.
    --it's show this
    applicant_id/score Score
    08002 400
    08003 200
    08004 700
    08006 653
    08008 560
    08010 800
    -- but i want to see this
    applicant_id/score Score
    08010 800
    08004 700
    08006 653
    08008 560
    08002 400
    08003 200
    i tried to set the group's property( break order property ). It doesn't allow me to set break order property of applicant_id's group to none. And tried to write 'order by' in the SQL statement but it doesn't help.

    Hi,
    If Oracle can give you back the right sort order without any custom sorting,
    that means you should be able to get the same results in WebI.
    If the object that you pull from the universe is the wrong type (like numeric but you want it alphanumeric),
    then you can either request you designer to give you an object with the right data type,
    or you can change it by creating a report variable using
    FormatNumber([original object],"0")
    this will format the number to a number without leading zeroes, thousand separators or decimal point.
    Now you can use the object as if it came from the universe.
    So you can also use it on the x-axis of a chart.
    Btw. you can also do a custom sort on the x-axis(as long as it is an object or variable, not a formula)
    alternative, if you define a custom sort in a table block, you can state it should be used througout the document.
    (so also in the charts.
    Hope this helps,
    Marianne

  • Problem - Sort output in table (multiple columns)

    Dear all,
    First of all - Best wishes for 2008.
    I probably have an easy matter, but i can't figure it out, and on this forum very little is mentioned about the sort operator, so therefore this new post.
    I have a dashboard with some input fields (dropdown boxes).
    I have a table (as result of query) and this works fine. The table consists of several columns. (so far no rocket science).
    Generally the structure of the table is like:
    IM SBU | App. Request key | App. Request | etc....
    I want the IM SBU colum to be sorted (assending or decending doenst matter).
    But somehow the second column is the one where the data is sorted (standard).
    My guess this happends because its a key value? or its because it starts with an A (and the other with and I).
    So i insert the sort opperator, add an object (IM SBU) and select up. Then from that opperator i create a table.
    This results in a table with just 1 column (IM SBU).
    So i tried several things.
    I tried to sort on the IM SBU key (this gives the same result).
    I added all colums as an object of the sort opperator...but this still gives the same result of just 1 column.
    Any ideas?
    Regards.
    Bart

    Dear all.
    I'm wondering if  anybody else experienced errors with the sort and the amount of columns shown in a table????
    In general i have a query and want a table as output with 8 columns (sorted by 1 object). I figured out the following and will demonstrate it with 4 situations.
    Situation1 (auto fit table without sort)
    In the properties of the table i select 'frame style'= 'Primary frame' and "fit content" = 'auto'. I run the dashboard and the content of the query is good. All columns are shown and the chart width is auto determined.
    Situation 2 (auto fit table with sort)
    I want to sort on 1 object, so from query i insert a sort (select object), and from sort i create table. Then i select 'frame style'= 'Primary frame' and "fit content" = 'auto'. I run the dashboard and the content of the query is NOT good. I just get to see 1 column. But i selected 8 columns.
    Situation 3 (actual fit table with sort)
    I want to sort on 1 object, so from query i insert a sort, and from sort i create table. Then i select 'frame style'= 'Primary frame' and select "fit content" = 'actual size'. I run the dashboard and the content of the query is good (but not what i want). I get to see all 8 columns. But the table is smaller than i want. I doenst auto fit.
    Situation 4 (fit width table with sort)
    I want to sort on 1 object, so from query i insert a sort (select object), and from sort i create table. Then i select 'frame style'= 'Primary frame' and "fit content" = 'fit width'. I run the dashboard and the content of the query is NOT good. I just get to see 1 column (again). But i selected 8 columns.
    Any suggestions?
    Any known work arounds?
    Or is this an error in VC and should i request a note?
    Regards.
    Bart

  • Sorting the internal table I'm getting ......

    While sorting the internal table I'm getting one of the columns not sorted .... why is that? for example
    A   B   C
    9   2    11
    4   9    10
    8   3    7
    using ---> sort itab by A B C. gives me this
    A   B   C
    4   2    7
    8   9    10
    9   3    11
    please help?

    Hi,
    check this code,
    REPORT ZEX31 .
    data : begin of itab occurs 0,
           f1 type i,
           f2 type i,
           f3 type i,
           end of itab.
    itab-f1 = 9 .
    itab-f2 = 2.
    itab-f3 = 11 .
    append itab.
    clear itab.
    itab-f1 = 4 .
    itab-f2 = 9.
    itab-f3 = 10 .
    append itab.
    clear itab.
    itab-f1 = 8 .
    itab-f2 = 3.
    itab-f3 = 7 .
    append itab.
    clear itab.
    loop at itab.
      write : / itab-f1 , itab-f2 , itab-f3.
    endloop.
    sort itab by f1 f2 f3.
    skip 2.
    loop at itab.
      write : / itab-f1 , itab-f2 , itab-f3.
    endloop.
    sorting will be based on the order u give,
    if u give order f1 f2 f3 then first f1 will be checked and sorted in the order of it.
    o/p will be
    4  9  10
    8  3   7
    9  2  11

Maybe you are looking for

  • Windows 7 x64 USB AUDIO DEVICE - Device Not Working - Mac Pro

    I have a mac pro early 2009. I had vista x64 installed, everything was great. I had 2 audio devices under device manager, one was listed as HD (digital) and one device was listed as analog audio. When I played games and wanted the external speakers (

  • Trouble attaching photos....

    Hello, I am having an issue in being able to attach photos to emails. When using Mail, if I choose to attach files (photos) to the email, the following dialogue box appears (as expected!): However, there is no way to browse through and select differe

  • IDVD 6 archived project won't open

    I've created and burnt an iDVD6 project to DVD. I then archived (File>Archive project) the project (8.49GB) but afterwards it won't open (either by double-clicking or from iDVD>File>Open or from the splash window "Open an Existing Project") in iDVD6.

  • Thunderbird prefixes mail from BT yahoo email address with [SPAM]

    When I open Thunderbird to read mail from BT yahoo, the mail is prefixed with [SPAM]. This has happened in the last few days, BT maintain it is nothing to do with them and to my knowledge nothing has changed in the last months. The messages are not s

  • Change run failure: Master data still in M version

    Hi Experts, We have an attribute change run that failed. We checked the master data and there are still entries in M version. We have tried to execute change run manually, but the infoobject is not listed. Checking RSRV we have the error "value 1000