Sort-group in alv

hi wat r the possible values tht can be passed for sort-group variable in alv report

The only possible values for this field are.....
*     Page feed    (incl. underline)
UL     Underline
This comes directly from the domain SLIS_CTRLS which is tied to this field.
Regards,
Rich Heilman
Message was edited by:
        Rich Heilman

Similar Messages

  • ALV sort/group disfunction ?!

    Hi there,
    I'm a bit helpless because of the sort/group function my ALV should do. Current situation is that I'm using an CL_GUI_ALV_GRID.
    CALL METHOD gr_config_alv_1_2->set_table_for_first_display
        EXPORTING
          is_layout                     = ls_layout
        CHANGING
          it_sort                       = sort_table
          it_outtab                     = config_1_2_table
          it_fieldcatalog               = cat_config_fieldcat_alv
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3.
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
    So you can see that I'm using it_sort to tell the ALV how to sort the it_outtab. [Result looks like this|http://fabianvogt.com/alv_1.jpg].
    What the it_sort does is sorting the it_outtab ASCENDING for the coloum "GRP" (display-name: "Bezugstyp"). So far so good...But I know that CL_GUI_ALV_GRID normally does some kind of grouping by merging cells with the same content. [This would look like that|http://fabianvogt.com/alv_2.jpg].
    In my case it does not work and I don't have any idea why. I searched the CLASS for a hint or maybe an attribute which has to be filled/flagged to do this kind of grouping.
    Looking forword to your help!

    Hi everyone!
    I've checked BCALV_TEST_GRID. Basically they do it the same way I'm trying. I found out that I have the possibility to set ls_layout-no_merging to control, whether cells with the same content are merged or not. By default no_merging is set SPACE, so the cells should be merged - NOT in my case.
    Even if I set no_merging  =  '  ' (SPACE) manually, the merging won't be done.
    Running out ouf ideas ...
    NEWS:
    I did some kind of a workaround, in my opinion even a nicer way to realize my purpose. So take a look at what I did right now:
    (take a look at the screenshots in my previous posts for your better understanding)
    - The old 'GRP' field (old content: 'B',' K', 'M') is now filled with 'Belegbezug', 'Kundenbezug', 'Materialbezug' and is set NO_OUT (fieldcatalogue).
    - I insterted a field called 'CNT' type I, which i use to create Totals/Subtotals.
    - NO_TOTLINE  = 'X' (Layout) --> total line is not shown; only subtotals
    - TOTALS_BEF (Layout) --> subtotals are placed on top
    [So this is what I got now|http://fabianvogt.com/alv3.jpg]. Much better than before!!!
    My only problem is now, that the 'CNT' coloum looks pretty ugly and has no function except doing the sum thing.
    I tried to make it invisible using the fieldcatalogue (NO_OUT / TECH), but then the total lines disappear :/
    Any suggestions?
    Edited by: Fabian Vogt on Oct 4, 2010 4:35 PM

  • Problem in Grouping the ALV output

    Hi Experts
    I want to group the ALV Grid output Division wise
    for that I have written following code
      wa_sort-spos = '1'.
      wa_sort-fieldname = 'REGIOAREA' .
      wa_sort-tabname = 'IT_FINAL' .
      wa_sort-up = 'X'.
      wa_sort-group = '*'.
      wa_sort-subtot = 'X'.
      APPEND wa_sort TO it_sort .
      CLEAR  wa_sort.
    I m passing it_sort table in the FM for sorting but output is not getting grouped can you please
    tell me what is the problem ?
    How to group the report ?
    Helpful answers will be highly rewarded
    Regards
    Bikas

    Hi ,
           I also have the similar way coded .
      DATA: s_sort TYPE slis_sortinfo_alv.
      CLEAR s_sort.
      s_sort-fieldname = rv_fieldname.
      s_sort-spos = rv_spos.
      s_sort-up = c_x.
      s_sort-group   = c_underline.
      APPEND s_sort TO rt_sort.
      CLEAR  s_sort.
    I don't have a subtotal for that fiels .
    It works for me .

  • Sorting problem in ALV

    I am facing the following problem:
    I have an ALV list in the following format:
    fld1          fld2          fld3
    bb1          bb2          comp1
    <blank>          <blank>          comp2
    <blank>          <blank>          comp3
    aa1          aa2          comp4
    <blank>          <blank>          comp5
    <blank>          <blank>          comp6
    <blank>          <blank>          comp7
    <blank> - spaces are displayed
    where:
    comp1 ; comp2 ; comp3 -> belong to bb1 (fld1) field and
    comp4 ; comp5 ; comp6 ; comp7 -> belong to aa1 (fld1) field
    Now, when the user is sorting the ALV report by field: "Fld1" (by clicking on the ascending or descending sort buttons on ALV), the ALV list is displayed in the following format:
    fld1          fld2          fld3
    <blank>          <blank>          comp2
    <blank>          <blank>          comp3
    <blank>          <blank>          comp5
    <blank>          <blank>          comp6
    <blank>          <blank>          comp7
    aa1          aa2          comp4
    bb1          bb2          comp1
    where as, I was expecting the output to be in this format:
    fld1          fld2          fld3
    aa1          aa2          comp4
    <blank>          <blank>          comp5
    <blank>          <blank>          comp6
    <blank>          <blank>          comp7
    bb1          bb2          comp1
    <blank>          <blank>          comp2
    <blank>          <blank>          comp3
    Problem: The "<blanks>" in the ALV are also sorted and fld3 is not attached with fld1 and fld2.
    Is there any way by which I can avoid this problem??
    I am using "set_table_for_first_display" method to display the ALV report.
    I have already tried grouping fld3 (comp's) by fld1 and fld2 using nested internal table (both statically and using pointers) and passing it to ALV via. "r_alv_grid->set_table_for_first_display" method. However, this didnt work.
    Please help.

    REPORT ZBLOCK_ALV.
    CONSTANTS :
      c_x VALUE 'X'.
    Macro definition
    DEFINE m_fieldcat.
      ls_fieldcat-fieldname = &1.
      ls_fieldcat-ref_tabname = &2.
      ls_fieldcat-tabname = &3.
      append ls_fieldcat to lt_fieldcat.
    END-OF-DEFINITION.
    DEFINE m_sort.
      ls_sort-fieldname = &1.
      ls_sort-up        = c_x.
      append ls_sort to lt_sort.
    END-OF-DEFINITION.
    TYPE-POOLS: slis.                      " ALV Global types
    TYPES:
    1st Table
      BEGIN OF ty_kna1,
        kunnr TYPE kna1-kunnr,             " Customer number
        ernam TYPE kna1-ernam,             " Name of Person who Created
        erdat TYPE kna1-erdat,             " Creation date
        name1 TYPE kna1-name1,             " Name 1                    .
      END OF ty_kna1,
    2nd Table
      BEGIN OF ty_mara,
        matnr TYPE mara-matnr,             " Material number
        ernam TYPE mara-ernam,             " Name of Person who Created
        ersda TYPE mara-ersda,             " Creation date
        mtart TYPE mara-mtart,             " Material type
        matkl TYPE mara-matkl,             " Material group
      END OF ty_mara,
    3rd Table
      BEGIN OF ty_vbak,
        vbeln TYPE vbak-vbeln,             " Sales document
        vkorg TYPE vbak-vkorg,             " Sales organization
        vtweg TYPE vbak-vtweg,             " Distribution channel
        kunnr TYPE vbak-kunnr,             " Sold-to party
        erdat TYPE vbak-erdat,             " Creation date
      END OF ty_vbak.
    DATA:
      gs_layout TYPE slis_layout_alv,
      gt_kna1 TYPE TABLE OF ty_kna1,
      gt_mara TYPE TABLE OF ty_mara,
      gt_vbak TYPE TABLE OF ty_vbak.
    SELECTION-SCREEN :
      SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.    "#EC NEEDED
    PARAMETERS p_max(2) TYPE n DEFAULT '02' OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    INITIALIZATION.
      v_1 = 'Maximum of records to read'.
    START-OF-SELECTION.
    Read data
      SELECT kunnr ernam erdat name1
        FROM kna1
       UP TO p_max ROWS
        INTO TABLE gt_kna1.
      SELECT matnr ernam ersda mtart matkl
        FROM mara
       UP TO p_max ROWS
        INTO TABLE gt_mara.
      SELECT vbeln vkorg vtweg kunnr erdat
        FROM vbak
       UP TO p_max ROWS
        INTO TABLE gt_vbak.
    END-OF-SELECTION.
      PERFORM f_display_data.
          FORM USER_COMMAND                                             *
    FORM user_command USING u_ucomm     TYPE sy-ucomm
                            us_selfield TYPE slis_selfield.     "#EC CALLED
      DATA:
        ls_vbak TYPE ty_vbak.
      CASE u_ucomm.
        WHEN '&IC1'.                       " Pick
          CASE us_selfield-tabname.
            WHEN 'GT_MARA'.
            WHEN 'GT_KNA1'.
            WHEN 'GT_VBAK'.
              READ TABLE gt_vbak INDEX us_selfield-tabindex INTO ls_vbak.
              IF sy-subrc EQ 0.
                SET PARAMETER ID 'AUN' FIELD ls_vbak-vbeln.
                CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
              ENDIF.
          ENDCASE.
      ENDCASE.
    ENDFORM.                               " USER_COMMAND
          Form  f_display_data
    FORM f_display_data.
      DATA :
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv, " Field catalog
        ls_sort     TYPE slis_sortinfo_alv,
        lt_sort     TYPE slis_t_sortinfo_alv, " Sort table
        lt_events   TYPE slis_t_event,
        ls_event    TYPE slis_alv_event.
      gs_layout-group_change_edit = c_x.
      gs_layout-colwidth_optimize = c_x.
      gs_layout-zebra             = c_x.
      gs_layout-detail_popup      = c_x.
      gs_layout-get_selinfos      = c_x.
    Build field catalog and sort table
      m_fieldcat  'KUNNR' 'KNA1' 'GT_KNA1'.
      m_fieldcat  'ERNAM' 'KNA1' 'GT_KNA1'.
      m_fieldcat  'ERDAT' 'KNA1' 'GT_KNA1'.
      m_fieldcat  'NAME1' 'KNA1' 'GT_KNA1'.
      m_sort  'KUNNR'.
    Build Event Table
      MOVE        'TOP_OF_PAGE'        TO ls_event-name.
      MOVE        'TOP_OF_PAGE'        TO ls_event-form.
      APPEND ls_event TO lt_events.
      MOVE        'END_OF_LIST'        TO ls_event-name.
      MOVE        'END_OF_LIST'        TO ls_event-form.
      APPEND ls_event TO lt_events.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program      = sy-cprog
          i_callback_user_command = 'USER_COMMAND'
          it_fieldcat             = lt_fieldcat
          is_layout               = gs_layout
          it_events               = lt_events
          it_sort                 = lt_sort
          i_save                  = 'A'
        TABLES
          t_outtab                = gt_kna1.
    ENDFORM.                               " F_DISPLAY_DATA
          FORM top_of_page                                              *
    FORM top_of_page.                                           "#EC CALLED
      ULINE.
      WRITE : sy-uname, sy-title(56) CENTERED, sy-datum.
      ULINE.
    ENDFORM.                               " TOP_OF_PAGE
          FORM End_of_list                                              *
    FORM end_of_list.                                           "#EC CALLED
      DATA :
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv, " Field catalog
        ls_sort     TYPE slis_sortinfo_alv,
        lt_sort     TYPE slis_t_sortinfo_alv, " Sort table
        lt_events   TYPE slis_t_event,
        ls_event    TYPE slis_alv_event.
    Build field catalog and sort table
      m_fieldcat 'MATNR' 'MARA' 'GT_MARA'.
      m_fieldcat 'ERNAM' 'MARA' 'GT_MARA'.
      m_fieldcat 'ERSDA' 'MARA' 'GT_MARA'.
      m_fieldcat 'MTART' 'MARA' 'GT_MARA'.
      m_fieldcat 'MATKL' 'MARA' 'GT_MARA'.
      m_sort 'MATNR'.
    Build Event Table
      MOVE 'END_OF_LIST'   TO ls_event-name.
      MOVE 'END_OF_LIST_2' TO ls_event-form.
      APPEND ls_event TO lt_events.
      gs_layout-list_append = c_x.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = sy-cprog
          it_fieldcat        = lt_fieldcat
          is_layout          = gs_layout
          it_sort            = lt_sort
          it_events          = lt_events
          i_save             = 'A'
        TABLES
          t_outtab           = gt_mara.
    ENDFORM.                               " END_OF_LIST
          FORM End_of_list_2                                            *
    FORM end_of_list_2.                                         "#EC CALLED
      DATA :
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv, " Field catalog
        ls_sort     TYPE slis_sortinfo_alv,
        lt_sort     TYPE slis_t_sortinfo_alv, " Sort table
        lt_events   TYPE slis_t_event,
        ls_event    TYPE slis_alv_event.
    Build field catalog and sort table
      m_fieldcat 'VBELN' 'VBAK' 'GT_VBAK'.
      m_fieldcat 'VKORG' 'VBAK' 'GT_VBAK'.
      m_fieldcat 'VTWEG' 'VBAK' 'GT_VBAK'.
      m_fieldcat 'KUNNR' 'VBAK' 'GT_VBAK'.
      m_fieldcat 'ERDAT' 'VBAK' 'GT_VBAK'.
      m_sort 'VBELN'.
    Build Event Table
      MOVE 'TOP_OF_PAGE' TO ls_event-name.
      MOVE 'TOP_OF_PAGE' TO ls_event-form.
      APPEND ls_event TO lt_events.
      gs_layout-list_append = c_x.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = sy-cprog
          it_fieldcat        = lt_fieldcat
          is_layout          = gs_layout
          it_sort            = lt_sort
          it_events          = lt_events
          i_save             = 'A'
        TABLES
          t_outtab           = gt_vbak.
    ENDFORM.                               " END_OF_LIST_2

  • Disable sort option in ALV GRID DISPLAY

    Hi Experts,
    I have an Alv output with fixed layout, means user should not be allowed to edit/sort/toggle any of the columns, particularly sort functionality should be removed.
    I have already tried the function code logic with excluding table. That only makes the sort option disappear. Still when you select a particular column and right click, you will find that the Sort in Ascending order' and 'Sort in descending order' functions are still enabled. This was already raised as a thread but not answered.
    [alv sort option]
    Please help.
    Note: Disabling the icon doesnt help in disabling the functionality.

    Try by excluding the entire Sort group. Like:
    Data:
    t_toolbar_excld1 type ui_functions, "buttons to exclude
    wa_toolbar_excld&1 like line of t_toolbar_excld1.
    wa_toolbar_excld1 = cl_gui_alv_grid=>MC_FG_SORT.   " <<
    APPEND wa_toolbar_excld1 TO t_toolbar_excld1.
    CALL METHOD r_alv_grid1->set_table_for_first_display
      EXPORTING is_variant = w_is_variant1
         is_layout = w_is_layout1
         i_save = c_alv_save_cd
         it_toolbar_excluding = t_toolbar_excld1
      CHANGING it_outtab = my_table
        it_fieldcatalog = t_fieldcat1.
    Regards,
    Naimesh Patel

  • Sorting in Blocked ALV Report

    Hi Experts,
    Can i achieve sorting in Blocked ALV report as we can do in ALV Grid Display.???
    If so, how can this be achieved????
    For example, if there are 3 records with the same value for a field.....say thfreee rows with name 'Gaurav'.
    I want to show 'Gaurav' only in the first row and the other two rows must be empty.
    Gaurav 1 2 3
    Gaurav 4 5 6
    Gaurav 7 8 9
    Should be seen as
    Gaurav 1 2 3
               4 5 6
               7 8 9
    Thanks and regards
    Gaurav raghav

    Here is the code.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = sy-repid
          i_structure_name       = 'ZCRM_ACTIVITY_REPORT'
        CHANGING
          ct_fieldcat            = gt_fieldcatalog[]
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
      IF sy-subrc EQ 0.
          CLEAR gs_sort.
          gs_sort-fieldname = 'ORG'.
          gs_sort-tabname = 'GT_ITAB'.
          gs_sort-spos = '1'.
          gs_sort-up = 'X'.
          APPEND gs_sort TO gt_sort.
        CLEAR gs_sort.
        gs_sort-fieldname = 'EMPLOYEE'.
        gs_sort-tabname = 'GT_ITAB'.
        gs_sort-spos = '2'.
        gs_sort-up = 'X'.
        APPEND gs_sort TO gt_sort.
      ENDIF.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
          EXPORTING
            is_layout                  = gt_layout
            it_fieldcat                = gt_fieldcatalog
            i_tabname                  = 'GT_ITAB'
            it_events                  = gt_events
            it_sort                    = gt_sort
            i_text                     = 'Report 1 '
          TABLES
            t_outtab                   = gt_itab
          EXCEPTIONS
            program_error              = 1
            maximum_of_appends_reached = 2
            OTHERS                     = 3.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.

  • Sorting /Grouping Issue: Single Artist Compilation Album Doesn't Group

    iTunes 8 Sorting / Grouping Issue
    EXAMPLE
    • Album: Essential Willie Nelson
    • There are 22 songs on this Disc
    • 19 of them are labelled "Willie Nelson" in the artist field
    • 3 of them are lebelled "Willie Nelson Feat. Waylon Jennings" in the artist field
    PROBLEM
    • Album will not stay grouped together when in the standard "Sort by Artist" in Grid View. A very legitimate expectation to be able to have Willie's name listed along with his pals in the artist field and have them grouped together in one album within Willie's albums section. 19 songs group within one album in the Willie Nelson section and the other 3 are placed separately either in the compilation section or as separate albums within the regular artists grid view.
    I've read most if not all postings that suggest solutions but no matter what... they don't work. The only way that I know to work is to strip out all other names and leave only "Willie Nelson" in the Artist field. All other sorting and grouping options don't work for this issue... I've tied every combination. My opinion is that this is just a limitation at this time and there is no solution until future updates. I don't want a cheezy work-around either, that's very "unApple like". I assume it to be fixed in future updates.
    Bueller... Bueller?
    Anyone?

    There's a few other "goodies" I have found also but haven't had time to check out.
    If you have songs not in iTunes that you want to add to iTunes in a different format than the song is in...
    (This is carried over from at least 7.4)
    Set the Importing prefs to what you want the new file to be.
    Hold the Option key and go to menu Advanced and select *Convert selection to* AAC (or whatever is in the Import prefs}.
    This will add it to iTunes in the new format.
    Previously, you had to Import the file, change the prefs, go to Advanced - *Convert selection to*, convert the file, then delete the original from iTunes.
    This is new...
    In iTunes 8, go to to File - > *Show duplicates*. (moved from View menu).
    Now hold Option and go to to File and it now displays *Show exact duplicates*.
    Don't know what it means by *exact duplicate* though.

  • How to get the sorted Groups in Adminstration Portal

    after adding a Child Group to the parent Group the Child Groups are not sorted.So
    how to get the sorted list when any child group is added to a parent group.In
    which class we have to make the changes to get the sorted group.

    Hi  Manorama,
    1) If you have already created a portal system as mentioned in following blog
                  /people/marcel.salein/blog/2007/03/14/how-to-create-a-portal-system-for-using-it-in-visual-composer
    2) If not, then try to create the same. Do not forgot to give the Alias name .
    3) After creating a system, log on to the VC, Create one iView.
    4) Now Click on "Find Data" button from the list which you can view in right side to Visual composer screen.
    5) After clicking on "Find Data" button, it will ask for System. If you have created your system correctly and Alias name is given properly, then your mentioned Alias name is appeared in that list.
    6) Select your system Alias name and perform search.
    7) It will display all the BAPIs and RFCs in your systems.
    8) Select required BAPI and develop the VC application.
    Please let me know if you any further problems.
    Thanks,
    Prashant
    Do reward points for useful answers.

  • How can we sort records in alv, give example

    how can we sort records in alv, give example

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

  • How does the SORT function in ALV grid work?

    Hi,
    I have a report for which the o/p is displayed in ALV grid format.There is one column in the O/p strcuture which is "No of days".Based on certain conditions,i need to display the value for some of the days as Negative e.g. " - 45".Becasuse of this,I have declared the field for the "No of days" of the type "CHAR".
    Now when i sort(using ALV grid SORT function) the list on basis of this column,it doesnt give me the correct o/p.
    CAN anyone tell me how do i handle this?I want the list to be sorted correctly on basis of the "No of days" column.
    Thanks!

    This is your Fourth Cross Posting in last three days on same issue!!
    CHAR type column doesnt work for SORT function in ALV grid!
    How to sort a column of type CHAR
    I dont,ve link for your Fourth Thread on same,though i'm short memory loss.

  • 'HASH GROUP BY' and 'SORT GROUP BY' 11.2.0.2

    deleting this thread..
    Edited by: OraDBA02 on Oct 3, 2012 2:35 PM

    select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE 11.2.0.2.0 Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    Optimizer parameter
    NAME TYPE VALUE
    optimpeek_user_binds boolean FALSE
    filesystemio_options string setall
    object_cache_optimal_size integer 102400
    optimizer_capture_sql_plan_baselines boolean FALSE
    optimizer_dynamic_sampling integer 2
    optimizer_features_enable string 11.2.0.2
    optimizer_index_caching integer 0
    optimizer_index_cost_adj integer 100
    optimizer_mode string ALL_ROWS
    optimizer_secure_view_merging boolean TRUE
    optimizer_use_invisible_indexes boolean FALSE
    optimizer_use_pending_statistics boolean FALSE
    optimizer_use_sql_plan_baselines boolean FALSE
    db_file_multiblock_read_count integer 128
    optimizer_index_caching integer 0
    optimizer_index_cost_adj integer 100
    SQL
    SELECT sum(this_.AMOUNT) as y0_, count(this_.GC_ID) as y1_,count(distinct this_.GC_ID) as y2_, this_.GC_TRANSACTION_TYPE_ID as y3_
    from GC_TRANSACTIONS this_ where this_.MARKETPLACE_ID=:1 and this_.CUSTOMER_ID=:2 and this_.EXTERNAL_GC_TRANSACTION_ID=:3
    group by this_.GC_TRANSACTION_TYPE_ID;
    Indexes and Histograms
    INDEX_NAME LAST_ANALYZED COLUMN_NAME COLUMN_POSITION NUM_ROWS BLEVEL CLUSTERING_FACTOR DESCEND
    I_GCT_CUSMKTLSTUPD 17-jul-2012:00:15:09 CUSTOMER_ID 1 222812460 3 150983660 ASC
    MARKETPLACE_ID 2 3 150983660 ASC
    GC_TRANSACTION_TYPE_ID 3 3 150983660 ASC
    I_GCT_EXT_GC_TRANS_ID_EXE 17-jul-2012:00:17:35 EXTERNAL_GC_TRANSACTION_ID 1 234832560 3 165680180 ASC
    C_ID
    EXTERNAL_GC_EXECUTION_ID 2 3 165680180 ASC
    Histograms
    COLUMN_NAME NUM_DISTINCT NUM_NULLS LAST_ANALYZED SAMPLE_SIZE AVG_COL_LEN HISTOGRAM
    COLUMN_NAME NUM_DISTINCT NUM_NULLS LAST_ANALYZED SAMPLE_SIZE AVG_COL_LEN HISTOGRAM
    EXTERNAL_GC_EXECUTION_I 21657463 54047480 24.Jul.12/00:21:28 8788182 12 HEIGHT BALANCED
    D
    EXTERNAL_GC_TRANSACTION 20790576 0 24.Jul.12/00:21:28 11481216 18 HEIGHT BALANCED
    _ID
    CUSTOMER_ID 5130572 0 24.Jul.12/00:21:28 11483246 7 HEIGHT BALANCED
    MARKETPLACE_ID 6 0 24.Jul.12/00:21:28 11482295 4 FREQUENCY
    GC_TRANSACTION_TYPE_ID 21 0 24.Jul.12/00:21:28 11483039 3 FREQUENCY
    GC_TRANSACTION_ID 229686260 0 24.Jul.12/00:21:28 11484313 8 NONE
    Histograms distibution for MARKTEPLACE_ID
    Enter value for column_name: MARKETPLACE_ID
    COLUMN_NAME ENDPOINT_VALUE CUMMULATIVE_FREQUENCY FREQUENCY ENDPOINT_ACTUAL_VALU
    MARKETPLACE_ID 3 6543166 6543166
    MARKETPLACE_ID 4 11041781 4498615
    MARKETPLACE_ID 5 11459282 417501
    MARKETPLACE_ID 35691 11469536 10254
    MARKETPLACE_ID 44551 11475336 5800
    MARKETPLACE_ID 78931 11482295 6959
    6 rows selected.
    CBO switches between two plans
    plan-1
    Plan hash value: 2380563624
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | | | 13 (100)| |
    | 1 | HASH GROUP BY | | 1 | 42 | 13 (8)| 00:00:01 |
    | 2 | VIEW | VW_DAG_0 | 1 | 42 | 13 (8)| 00:00:01 |
    | 3 | HASH GROUP BY | | 1 | 43 | 13 (8)| 00:00:01 |
    |* 4 | TABLE ACCESS BY INDEX ROWID| GC_TRANSACTIONS | 1 | 43 | 12 (0)| 00:00:01 |
    |* 5 | INDEX RANGE SCAN | I_GCT_EXT_GC_TRANS_ID_EXEC_ID | 11 | | 4 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    4 - filter(("THIS_"."CUSTOMER_ID"=:2 AND "THIS_"."MARKETPLACE_ID"=:1))
    5 - access("THIS_"."EXTERNAL_GC_TRANSACTION_ID"=:3)
    Bind (child_curosr=1)
    select SQL_ID,CHILD_NUMBER,HASH_VALUE,NAME,DATATYPE,WAS_CAPTURED,LAST_CAPTURED,VALUE_STRING from V$SQL_BIND_CAPTURE where SQL_ID='&sql_id'
    order by LAST_CAPTURED;
    Enter value for sql_id: 1hc1r8qubfdnh
    1hc1r8qubfdnh 1 3031905936 :1 2 YES 24.Jul.12/00:52:29 3
    1hc1r8qubfdnh 1 3031905936 :2 2 YES 24.Jul.12/00:52:29 535098352
    1hc1r8qubfdnh 1 3031905936 :3 1 YES 24.Jul.12/00:52:29 203-2351701-6925919
    Plan-2
    Bind (child_curosr=6)
    Plan hash value: 700639342
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | | | 13 (100)| |
    | 1 | SORT GROUP BY | | 1 | 43 | 13 (8)| 00:00:01 |
    |* 2 | TABLE ACCESS BY INDEX ROWID| GC_TRANSACTIONS | 1 | 43 | 12 (0)| 00:00:01 |
    |* 3 | INDEX RANGE SCAN | I_GCT_EXT_GC_TRANS_ID_EXEC_ID | 11 | | 4 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - filter(("THIS_"."CUSTOMER_ID"=:2 AND "THIS_"."MARKETPLACE_ID"=:1))
    3 - access("THIS_"."EXTERNAL_GC_TRANSACTION_ID"=:3)
    bind values
    select SQL_ID,CHILD_NUMBER,HASH_VALUE,NAME,DATATYPE,WAS_CAPTURED,LAST_CAPTURED,VALUE_STRING from V$SQL_BIND_CAPTURE where SQL_ID='&sql_id'
    order by LAST_CAPTURED;
    Enter value for sql_id: 1hc1r8qubfdnh
    1hc1r8qubfdnh 6 3031905936 :1 2 YES 24.Jul.12/03:06:04 5
    1hc1r8qubfdnh 6 3031905936 :2 2 YES 24.Jul.12/03:06:04 1278126152
    1hc1r8qubfdnh 6 3031905936 :3 1 YES 24.Jul.12/03:06:04 171-5012459-0045134
    Why is CBO using two different 'HASH GROUP BY' with view 'VW_DAG_0' in first plan ?
    Is that due to difference in MARKETPLACE_ID =4 And 5 ?

  • Hash GROUP BY And Sort GROUP BY

    Can anyone please explain how does Hash GROUP BY And Sort GROUP BY exactly work ?
    Thank you.

    As the name suggests, SORT GROUP BY achieves the same goal by sorting.According to Tom SORT GROUP BY doesn't always sort correctly .. tried to understand his explanation as he said "It always did a BINARY SORT - not a character set sort. So the data would be sorted incorrectly if you use anything but very simple ASCII strings..."
    can you give me an example where binary value of a string A is greater than string B while ascii value of string B is greater than string A ?
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:75397449124988
    Thank you

  • Custom buttons in SORT FILTER  at  ALVs

    Hi all ,
    Please let me  know  how to  attach  custom   push buttons to the  Standard one  ( sort  , filter  in alvs  )
    Regards
    Aslam..

    Hi ,
    Please search SDN before posting.
    There are many threads on this topic.
    If you are using 'REUSE_ALV_GRID_DISPLAY'  then pass your PF status with desired functions to parameter i_callback_pf_status_set .
    In factory method
      CALL METHOD go_table->set_screen_status
        EXPORTING
          report        = gv_cprog
          pfstatus      = gc_gui_status
          set_functions = go_table->c_functions_all.
    Hope this helps you.
    Edited by: Harsh Bhalla on Jan 6, 2010 8:48 AM

  • TableSorter - Sorting grouped columns

    Hi,
    I am implementing a web dnypro application on NWDS 7.1.
    Is it possible to sort a grouped column with the TableSorter.java class?
    As mentioned in the below document, it should be possible.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/30291df2-b980-2a10-0884-839c4f7f147e
    I can sort single columns, but sorting grouped columns is not possible.
    Any idea about this?
    Thanks,
    Regards,
    Yasar

    Hi,
    Please go through
    Enhanced Web Dynpro Java TableSorter
    Enhanced Web Dynpro Java TableSorter for SAP NetWeaver 04s
    Regards
    Ayyapparaj

  • How to remove a Sort button from ALV List

    Hi Experts,
    How to remove sort button from ALV List.
    I have requirement where I need to remove the sort button from ALV list.
    Kindly give me useful clues.
    Higher points will be awarded for the useful inputs.
    Thanks in Advance,
    Dharani

    Hi dharani,
    1. UP and Down Sort Button will get removed.
    2. Important code is marked in bold
    3. Just copy paste.
    4.
    report abc.
    TYPE-POOLS : slis.
    DATA : alvfc TYPE slis_t_fieldcat_alv.
    DATA : alvfcwa TYPE slis_fieldcat_alv.
    <b>data : excl type SLIS_T_EXTAB.
    data : exclwa type SLIS_EXTAB.</b>
    data : begin of itab occurs 0.
            include structure usr02.
    data : end of itab.
    START-OF-SELECTION.
      select * from usr02
      into table itab.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = sy-repid
          i_internal_tabname     = 'ITAB'
          i_inclname             = sy-repid
        CHANGING
          ct_fieldcat            = alvfc
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
    <b>*----
    IMPORTANT
    fcodes to remove
    Up and Down Sort Button
    exclwa-fcode = '&OUP'.
    append exclwa to excl.
    exclwa-fcode = '&ODN'.
    append exclwa to excl.</b>
    Display
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          it_fieldcat   = alvfc
          <b>IT_EXCLUDING     = excl</b>
        TABLES
          t_outtab      = itab
        EXCEPTIONS
          program_error = 1
          OTHERS        = 2.
    regards,
    amit m.

Maybe you are looking for