Sorting of subtotal by descending  in alv_tree

Hello friends,
how do i achive the sorting of sub totals.
eq.
a/1/i
a             20
   1          20
       i        10
       ii        10
b             40
   1          40
       i        10
       ii        30
c             30
   1          30
       i        20
       ii        10
output : after i drop the tree output looks like
       a      20
       b      40
       c      30
here i would like to know , is it possible to have the output like
b   40    sorting by subtotal descending
c    30
a   20
thanks!!
kat

Hi,
data : gt_sort like slis_t_sortinfo_alv .
         gs_sort type slis_sortinfo_alv.
gs_sort-fieldname = 'Fieldname'.
gs_sort-sortup = 'X'.
gs_sort-subtot = 'X'.
append gs_sort to gt_sort.
Bhavana

Similar Messages

  • The formula field is not sorting both ascending and descending

    Dear All,
                   I am designing scoreboard the net amount contains the formula field, i sorted with asceding order by using sort,but it is not sorted both ascending or descending ,
                  Suppose if i used to sort the database field it is sorted properly  so any one help me very urgent
    Regards
    Selva.D
    Edited by: Rui Pereira on Aug 8, 2008 11:32 AM

    Dear Suda,
                     The scoreboard i designed via query print layout. So i calculated  by using formula field ie totalsales- sales return for that i used formula and i follow the below steps
    Choose repetitive area -
    > Right mouse click---> sort
    in the sorting i choose the formula uinque id and i choose Ascending then summary, after i click ok
    Suggest me the solution
    Regards
    Selva.D
    Edited by: Rui Pereira on Jul 8, 2008 5:18 PM

  • Reports with all functionality (sorting,total,subtotal,download)

    Hi,
    We require that all the actions which we can perform on the Reports available in SAP environment should also be available in the EP Platform.
    Eg
           sorting,total,subtotal,download.
    Thanks.

    Hi,
    We require that all the actions which we can perform on the Reports available in SAP environment should also be available in the EP Platform.
    Eg
           sorting,total,subtotal,download.
    Thanks.

  • How can I do sorting from ascending to descending then unsort?

    Hi all,
    Can anybody help on this issue?
    I have a bunch of numbers in a table, and I hope when I click the column header once, it will do ascending.
    Click again, do descending. Then click three times, become unsort (which is origially ordered in absolute value).
    I tried to add tree SortKeys in sorter, but it doesn't work:
    List<RowSorter.SortKey> sortKeys = new ArrayList<RowSorter.SortKey>();
    sortKeys.add(new RowSorter.SortKey(2, SortOrder.UNSORTED));      // 2 means it's the 3rd column I want to sort
    sortKeys.add(new RowSorter.SortKey(2, SortOrder.DESCENDING));
    sortKeys.add(new RowSorter.SortKey(2, SortOrder.ASCENDING));
    sorter.setSortKeys(sortKeys);Then I tried to implement my own Comparator, but will always get numbers ordered in absolute value.
            Comparator<Float> comparator = new Comparator<Float>() {
                public int compare(Float s1, Float s2) {
                    if (s1 < 0) s1 *= (-1);
                    if (s2 < 0) s2 *= (-1);
                    return s1.compareTo(s2);   
            sorter.setComparator(2, comparator);      // 2 means it's the 3rd column I want to sortThank you very much indeed in advance.
    Cheers,
    George

    Apologies for not saying it clearly.
    I can easily do ascending and decending by applying this:
            sorter = new TableRowSorter<TableModel>(table.getModel());
            table.setRowSorter(sorter);But I also need my data to be sorted by absolute value. That's why I tried to implement my own Comparator.
    However, it turned out that I will only have one sorting method, which is the absolute value as you have noticed.
    Hence I hope the result, if possible, would be if I first click the column header, ascending orders.
    Click the second time, decending orders. And then click the third time, absolute value orders.
    Cheers

  • How to sort projects by name descending?

    Is there any way of changing the default sorting by name ascending in projects view?
    Any help would be greatly appreciated.
    - Thomas

    Another often overlooked way to organize projects is to make use of the Project Description in the Project info window. The text entered is is then searchable in the project window search box.
    Wiht the text Swimming in the project description,  I can enter this into the search field and all projects with those word(s) in the description appear.

  • Sorting and subtotaling in webdynpro java

    Dear experts help me in the following problem,
    i need to sort the table based on att/abs type and display the total hours for each att/abs type in Approve/Review time sheets ivew of MSS.

    1. Implement class comparator wich will compare records according your sort preferencies,
    like this:
         public class record_Comparator implements Comparator{
              public int compare(Object emp1, Object emp2){
          // here is your code for return -1if 'before'  or 0 if equal or 1if 'after'
                   int stepId_1 = ((record)emp1).get_someValue();       
                   int stepId_2 = ((record)emp2).get_someValue();
                   if(stepId_1 > stepId_2)
                        return 1;
                   else if(stepId_1 < stepId_2)
                        return -1;
                   else
                        return 0;   
    than call method sort() with your collection of records,
    like this:
    Collections.sort(record_collection, new record_Comparator());

  • Photoshop Elements 11--want "My Files" sort order to be descending

    Is it possible to have to the ordering of "My Files" folders to be descending rather than ascending?

    You can edit a jpeg in the camera raw dialog. From the PSE Editor application click:
    File >> Open
    Navigate  to your jpeg
    Then choose Camera Raw from the file format pull down list
    Use the raw sliders and when done, click the Open Image button (bottom right) to send into the regular editor and re-save.

  • Field should not display in the subtotal row in ALV report after sorting .

    we have a requirement, after sorting and subtotaling, the output in ALV is -
    vbeln        amount1  amount2  amount3
    123           11              12            13
    123           12             13             14
    123           23             25             27 
    133           11              12            13
    133           12             13             14
    133           23             25             27
    Now the customer wants the ALV outpput in this fashion -
    123           11              12            13
    123           12             13             14
                     23             25             27    --->123 (vbeln) should not come in subtotaling row
    133           11              12            13
    133           12             13             14
                      23             25             27--->133(vbeln) should not come in subtotaling row

    Hi,
    if it helps you could create a hierachy. In this way you can define the field catalog for the lines and for the subtotal columns. The only thing is that you would always show the subtotal rows.
    You have references of hierachy alvs in
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c060fcb4-2c62-2b10-d2b2-f32407a5cc6f
    ALV Hierarchy
    alv hierarchy
    In this case it also sorts
    Sorting for ALV hierarchy
    I hope it helps.
    Edited by: Oscar Pecharroman on Aug 2, 2010 1:13 PM

  • How to sort data in descending order when user clicks on the column heading

    Hi
    I have a report called "Top customers", which shows the top customers for a specific product line. It displays the customer name and one column with the total amount spent in the period for each product line. By default, the leftmost product line is sorted in descending order.
    If the user wants to know who are the top customers for another product line, they simply click on the column heading to sort the list by that column.
    The problem is that when you click for the first time on a sortable column heading, Apex sorts it in ascending order; you need to click on the same column heading again to sort in descending order.
    Is it possible to change this behaviour and sort the data in descending order in the first click? So the users don't have to click twice...
    Thanks
    Luis
    PS: Apex 3 running on Oracle 10.2.0

    Luis,
    See: Can I "catch" a click on a sortable column header of a report?
    Take a look at Anton Nielsen's answer with regards to hiding a column and displaying its value instead of the sortable column.
    Asumming the following simple report query:
    select product,sales
    from <table>
    Change that into:
    select product
    ,sales*-1 as reverse_sales -- Select this one as an extra column
    ,sales -- Hide this column
    from <table>
    In your report column attributes (of column reverse_sales), html-expression, type #sales#. It then displays the normal sales. However apex will generate a 'order by 2 asc' for the first time. The '2' will refer to the sales*-1 value: sorting it asc, is the same as sorting sales descending...
    Toon

  • Permanent sorting the open items list by document number descending

    Hello,
    I want to store, that the "Sales -A/R - Sales Report - Open Items List"  is allways sorted by document number descending.
    I am able to sort the list, but the system doesn't store this configuration.
    Next time when I enter the list, I have to sort it again. We use B1 2007A SP01 Patch 7 Hotfix 1.
    Has any one an idea ?
    Regards.
    Michael

    Hi
    U can use Customised query Report to show ur report as per ur format and requirement. But in Normal Report u cant do this...always u have to sort there was no option in standard to save...
    Giri

  • Can you sort a multi value field in descending order on a BC?

    Hi
    We have a date field which is a multivalue field on our Enrolment BC. The field comes from our Attendance BC. The Enrolment BC has a one to many relationship with an Attendance BC.
    We would like to sort this date in descending order for use on the Enrolment BC. We tried this on the link using the associated list sort spec. However this did not work.
    The only way we could get the multi value field to sort by descending order on the Enrolment BC was to add a sort spec on the Attendance BC. That is Date (DESC).
    Is there any other to do this using configuration? We don't want to add a sort spec on the Attendance BC to do this. At the moment it looks we will need to use script on the Enrolment BC.
    Thanks for you help,
    Tim

    That is a good suggestion. It looks like we already have a couple of cloned "Attendance" BC's used by workflow / interfaces so maybe I can use one of these. Thanks!

  • ALV - Sort - Subtotal

    hi,
    Can u pls tell me what is the use of subtotal in sort exactly with an example of records..
    I need to work out with this..in ALV.
    will be rewarded.
    Thankx in adv

    REPORT ZALV.
    TYPE-POOLS: SLIS.
    DATA: G_REPID LIKE SY-REPID,
    GS_PRINT            TYPE SLIS_PRINT_ALV,
    GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
    GT_EVENTS           TYPE SLIS_T_EVENT,
    GT_SORT             TYPE SLIS_T_SORTINFO_ALV,
    GS_LAYOUT           TYPE SLIS_LAYOUT_ALV,
    GT_FIELDCAT         TYPE SLIS_T_FIELDCAT_ALV,
    FIELDCAT_LN LIKE LINE OF GT_FIELDCAT,
    COL_POS TYPE I.
    DATA: BEGIN OF ITAB,
      FIELD1(5) TYPE C,
      FIELD2(5) TYPE C,
      FIELD3(5) TYPE P DECIMALS 2,
    END OF ITAB.
    DATA: BEGIN OF ITAB1 OCCURS 0.
      INCLUDE STRUCTURE ITAB.
    DATA: END OF ITAB1.
    DATA: BEGIN OF ITAB_FIELDCAT OCCURS 0.
      INCLUDE STRUCTURE ITAB.
    DATA: END OF ITAB_FIELDCAT.
    Print Parameters
    PARAMETERS:
                P_PRINT  AS CHECKBOX DEFAULT ' ', "PRINT IMMEDIATE
                P_NOSINF AS CHECKBOX DEFAULT 'X', "NO SELECTION INFO
                P_NOCOVE AS CHECKBOX DEFAULT ' ', "NO COVER PAGE
                P_NONEWP AS CHECKBOX DEFAULT ' ', "NO NEW PAGE
                P_NOLINF AS CHECKBOX DEFAULT 'X', "NO PRINT LIST INFO
                P_RESERV TYPE I.                  "NO OF FOOTER LINE
    INITIALIZATION.
    G_REPID = SY-REPID.
    PERFORM PRINT_BUILD    USING GS_PRINT.      "Print PARAMETERS
    START-OF-SELECTION.
    TEST DATA
    MOVE 'TEST1' TO ITAB1-FIELD1.
    MOVE 'TEST1' TO ITAB1-FIELD2.
    MOVE '10.00' TO ITAB1-FIELD3.
    APPEND ITAB1.
    MOVE 'TEST2' TO ITAB1-FIELD1.
    MOVE 'TEST2' TO ITAB1-FIELD2.
    MOVE '20.00' TO ITAB1-FIELD3.
    APPEND ITAB1.
    DO 50 TIMES.
      APPEND ITAB1.
    ENDDO.
    END-OF-SELECTION.
    PERFORM BUILD.
    PERFORM EVENTTAB_BUILD CHANGING GT_EVENTS.
    PERFORM COMMENT_BUILD  CHANGING GT_LIST_TOP_OF_PAGE.
    PERFORM CALL_ALV.
    FORM BUILD.
    DATA FIELD CATALOG
    Explain Field Description to ALV
    DATA: FIELDCAT_IN TYPE SLIS_FIELDCAT_ALV.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME = 'FIELD1'.
    FIELDCAT_LN-TABNAME   = 'ITAB1'.
    *FIELDCAT_LN-NO_OUT    = 'X'.  "FIELD NOT DISPLAY, CHOOSE FROM LAYOUT
    FIELDCAT_LN-KEY       = ' '.   "SUBTOTAL KEY
    FIELDCAT_LN-NO_OUT    = ' '.
    FIELDCAT_LN-SELTEXT_L = 'HEAD1'.
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME = 'FIELD2'.
    FIELDCAT_LN-TABNAME   = 'ITAB1'.
    FIELDCAT_LN-NO_OUT    = 'X'.
    FIELDCAT_LN-SELTEXT_L = 'HEAD2'.
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME     = 'FIELD3'.
    FIELDCAT_LN-TABNAME       = 'ITAB1'.
    FIELDCAT_LN-REF_FIELDNAME = 'MENGE'. "<- REF FIELD IN THE DICTIONNARY
    FIELDCAT_LN-REF_TABNAME   = 'MSEG'.  "<- REF TABLE IN THE DICTIONNARY
    FIELDCAT_LN-NO_OUT        = ' '.
    FIELDCAT_LN-DO_SUM        = 'X'.   "SUM UPON DISPLAY
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    DATA SORTING AND SUBTOTAL
    DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD1'.
    GS_SORT-SPOS      = 1.
    GS_SORT-UP        = 'X'.
    GS_SORT-SUBTOT    = 'X'.
    APPEND GS_SORT TO GT_SORT.
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD2'.
    GS_SORT-SPOS      = 2.
    GS_SORT-UP        = 'X'.
    *GS_SORT-SUBTOT    = 'X'.
    APPEND GS_SORT TO GT_SORT.
    ENDFORM.
    FORM CALL_ALV.
    ABAP List Viewer
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = G_REPID
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    I_STRUCTURE_NAME = 'ITAB1'
    IS_LAYOUT =  GS_LAYOUT
    IT_FIELDCAT = GT_FIELDCAT[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
      IT_SORT = GT_SORT[]
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
      IT_EVENTS = GT_EVENTS[]
    IT_EVENT_EXIT =
      IS_PRINT = GS_PRINT
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    T_OUTTAB = ITAB1
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    ENDFORM.
    HEADER FORM
    FORM EVENTTAB_BUILD CHANGING LT_EVENTS TYPE SLIS_T_EVENT.
    CONSTANTS:
    GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
    *GC_FORMNAME_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE'.
      DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                I_LIST_TYPE = 0
           IMPORTING
                ET_EVENTS   = LT_EVENTS.
      READ TABLE LT_EVENTS WITH KEY NAME =  SLIS_EV_TOP_OF_PAGE
                               INTO LS_EVENT.
      IF SY-SUBRC = 0.
        MOVE GC_FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.
        APPEND LS_EVENT TO LT_EVENTS.
      ENDIF.
    define END_OF_PAGE event
    READ TABLE LT_EVENTS WITH KEY NAME =  SLIS_EV_END_OF_PAGE
                             INTO LS_EVENT.
    IF SY-SUBRC = 0.
      MOVE GC_FORMNAME_END_OF_PAGE TO LS_EVENT-FORM.
      APPEND LS_EVENT TO LT_EVENTS.
    ENDIF.
    ENDFORM.
    FORM COMMENT_BUILD CHANGING GT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
      DATA: GS_LINE TYPE SLIS_LISTHEADER.
      CLEAR GS_LINE.
      GS_LINE-TYP  = 'H'.
      GS_LINE-INFO = 'HEADER 1'.
      APPEND GS_LINE TO GT_TOP_OF_PAGE.
      CLEAR GS_LINE.
      GS_LINE-TYP  = 'S'.
      GS_LINE-KEY  = 'STATUS 1'.
      GS_LINE-INFO = 'INFO 1'.
      APPEND GS_LINE TO GT_TOP_OF_PAGE.
      GS_LINE-KEY  = 'STATUS 2'.
      GS_LINE-INFO = 'INFO 2'.
      APPEND GS_LINE TO GT_TOP_OF_PAGE.
    CLEAR GS_LINE.
    GS_LINE-TYP  = 'A'.
    GS_LINE-INFO = 'ACTION'.
    APPEND GS_LINE TO  GT_TOP_OF_PAGE.
    ENDFORM.
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
      WRITE: SY-DATUM, 'Page No', SY-PAGNO LEFT-JUSTIFIED.
    ENDFORM.
    FORM END_OF_PAGE.
      WRITE at (sy-linsz) sy-pagno CENTERED.
    ENDFORM.
    PRINT SETTINGS
    FORM PRINT_BUILD USING LS_PRINT TYPE SLIS_PRINT_ALV.
      LS_PRINT-PRINT              = P_PRINT.  "PRINT IMMEDIATE
      LS_PRINT-NO_PRINT_SELINFOS  = P_NOSINF. "NO SELECTION INFO
      LS_PRINT-NO_COVERPAGE       = P_NOCOVE. "NO COVER PAGE
      LS_PRINT-NO_NEW_PAGE        = P_NONEWP.
      LS_PRINT-NO_PRINT_LISTINFOS = P_NOLINF. "NO PRINT LIST INFO
      LS_PRINT-RESERVE_LINES      = P_RESERV.
    ENDFORM.
    *END OF ZALV PROGRAM
    Check this program...
    Regards,
    Pavan

  • Descending sorting

    Hi all, I encounter some sorting problems.
    Whenever, i sort these two in descending order, it give the same output as ascending order. The ascending works perfectly, only the descending giving me problem.
    E.g.1:  "IT1193-01" , "IT1193-02" , "IT1193-03" , "IT1193-04"
    public static final Comparator moduleGroup_Comparator = new Comparator()
    public int compare(Object o1, Object o2)
    Person mg1 = (Person)o1;
    Person mg2 = (Person)o2;
    return (mg1.getModuleGroup().compareTo(mg2.getModuleGroup()));
    public static final Comparator moduleGroup_Comparator_desc = new Comparator()
    public int compare(Object o1, Object o2)
    Person mg1 = (Person)o2;
    Person mg2 = (Person)o1;
    return (mg1.getModuleGroup().compareTo(mg2.getModuleGroup()));     
    E.g.2: "IT0401",  "IT0402",  "IT0403",  "IT0404"
    public static final Comparator tutorialGroup_Comparator = new Comparator()
              public int compare(Object o1, Object o2)
                   Person tg1 = (Person)o1;
                   Person tg2 = (Person)o2;
                   return (tg1.getTutorialGroup().compareTo(tg2.getTutorialGroup()));
         public static final Comparator tutorialGroup_Comparator_desc = new Comparator()
              public int compare(Object o1, Object o2)
                   Person tg1 = (Person)o2;
                   Person tg2 = (Person)o1;
                   return (tg1.getTutorialGroup().compareTo(tg2.getTutorialGroup()));
         };     I don't know where the error is. I have some other sorting as well, the rest works. Only this two give me problem. Hope u all can help. Thanks.

    I have just found my code for a reverse comparator that chains to a forward comparator
        public class ReverseComparator implements Comparator
            public ReverseComparator(Comparator chainComparator)
                this.chainComparator = chainComparator;
            public int compare(Object left, Object right)
                return chainComparator.compare(right, left);
            private Comparator chainComparator;
        }

  • Change the sort order (ascending/descending) based on parameter field

    I have created a formula on a subreport to change sorting based on variables.
    select {?Pm-@Sorting}
    case "property_type_desc ASC" :
    {owned_property.property_type_desc}
    case "property_type_desc DESC" :
    {owned_property.property_type_desc}
    default:
    ({owned_property.property_type_cd}; )
    how can I change the sort order ascending and descending using the formula??
    Thanks, Jessica

    Try this
    1. Create a parameter with 2 default values in the picklist: Descending and Ascending.
    NOTE:
    In Crystal Reports version 5 or 6, it is not possible to have a pick a parameter value from a list. The user must enter a specific value, guided by the prompting text. For example : To Sort in Ascending order type A, to sort in Descending order type D.
    u2022 On the 'Insert' menu, click 'Parameter', then click 'New'.
    u2022 Type the name and prompting text for the parameter in the corresponding boxes.
    u2022 In the 'Type' box, click 'String'.
    u2022 Click 'Set Default'.
    u2022 In the 'Value to add' box, type 'Descending' then click '>' to move it to the 'Default Values' list.
    u2022 Repeat the above step for 'Ascending'.
    u2022 Click 'OK', then click 'OK' again to return to the report.
    2. Create 2 formulas based on the field you want to change the sort direction on:
    u2022 On the 'Insert' menu, click 'Formula', then click 'New'.
    u2022 Create this formula:
    @Asc
    If {?Parameter} = "Ascending" then
    u2022 Save this formula and close the Formula Editor. This brings you back to the Formula tab of the Insert Fields dialog box.
    u2022 Click 'New' and create this formula:
    @Des
    If {?Parameter} = "Descending" then
    u2022 Save this formula and close the Formula Editor.
    u2022 Click 'Close' to return to the report.
    4. Sort the report based on these two formulas.
    u2022 On the 'Report' menu, click 'Sort Records'.
    u2022 In the 'Report Fields' list, click {@Asc} and move it to the 'Sort Fields' list.
    u2022 Under 'Sort Direction', click 'Ascending'.
    u2022 In the 'Report Fields' list, click {@Des} and move it to the 'Sort Fields' list.
    u2022 Under 'Sort Direction', click 'Descending'.
    u2022 Click 'OK' to return to the report.
    Once you preview the report you will be prompted to select a parameter value, which will determine how the report is sorted.
    Regards,
    Raghavendra

  • Adding row after subtotal in ALV

    Hi Guys,
    can we add one row after the subtotal in ALV.
    Like the below...
    field1 field2 field3 field4
    Sub total. 120 121 125 130
    Test 150
    can you help me about the above...
    Thanks,
    Lingesh

    Hi
    If you use GROUPLEVEL_CHANGE you have to creare a form like this:
    FORM GROUPLEVEL_CHANGE
                   USING P_LINEINFO TYPE SLIS_LINEINFO
                         LS_GROUPS   TYPE KKBLO_GROUPLEVELS.
    ENDFORM.                    "GROUPLEVEL_CHANGE
    In the P_LINEINFO you have details of row and in the LS_GROUPS details of level of sorting.
    For example I used it to re-write subtotal:
    FORM GROUPLEVEL_CHANGE USING P_LINEINFO TYPE SLIS_LINEINFO
                                LS_GROUPS   TYPE KKBLO_GROUPLEVELS.
      PERFORM WRITE_SUB_TOTAL USING LS_GROUPS.
    ENDFORM.                    "GROUPLEVEL_CHANGE
    FORM WRITE_SUB_TOTAL  USING    P_GROUPS TYPE KKBLO_GROUPLEVELS.
      DATA: TOT_SALDO_A     LIKE BSID-DMBTR,
            TOT_FATTURATO_A LIKE BSID-DMBTR,
            TOT_DSO_A       LIKE BSID-DMBTR.
      DATA: WA_GROUP        TYPE KKBLO_GROUPLEVELS.
      DATA: RUN_LEVEL       TYPE I.
      DATA: BEGIN OF T_LEVEL OCCURS 1,
              LEVEL       TYPE I,
              INDEX_FROM  TYPE I,
              INDEX_TO    TYPE I,
            END   OF T_LEVEL.
      T_LEVEL-LEVEL      = P_GROUPS-LEVEL.
      T_LEVEL-INDEX_FROM = P_GROUPS-INDEX_FROM.
      T_LEVEL-INDEX_TO   = P_GROUPS-INDEX_TO.
      APPEND T_LEVEL.
    Check livel:
      CALL FUNCTION 'ALV_GROUPLEVELS_GET'
       IMPORTING
         ET_GROUPS                 = GT_GROUP
        TABLES
          T_OUTTAB                  = <FS_OUTPUT>.
      RUN_LEVEL = P_GROUPS-LEVEL + 1.
      IF RUN_LEVEL <= LEVEL.
        DO.
          LOOP AT GT_GROUP INTO WA_GROUP
                    WHERE INDEX_FROM => P_GROUPS-INDEX_FROM
                      AND INDEX_TO   <= P_GROUPS-INDEX_TO
                      AND LEVEL      = RUN_LEVEL.
            T_LEVEL-LEVEL      = RUN_LEVEL.
            T_LEVEL-INDEX_FROM = WA_GROUP-INDEX_FROM.
            T_LEVEL-INDEX_TO   = WA_GROUP-INDEX_TO.
          ENDLOOP.
          IF SY-SUBRC = 0.
            APPEND T_LEVEL.
          ENDIF.
          RUN_LEVEL = RUN_LEVEL + 1.
          IF RUN_LEVEL > LEVEL. EXIT. ENDIF.
        ENDDO.
      ENDIF.
      SORT T_LEVEL BY LEVEL DESCENDING.
      LOOP AT T_LEVEL.
        TOT_SALDO_A = TOT_FATTURATO_A = 0.
        LOOP AT <FS_OUTPUT> INTO <FS_WA_OUT>
                            FROM T_LEVEL-INDEX_FROM
                              TO   T_LEVEL-INDEX_TO.
          ASSIGN COMPONENT 'ZSALDO'
              OF STRUCTURE <FS_WA_OUT> TO <FS_SALDO>.
          ASSIGN COMPONENT 'ZFATTURATO'
              OF STRUCTURE <FS_WA_OUT> TO <FS_FATTURATO>.
          TOT_SALDO_A     = TOT_SALDO_A     + <FS_SALDO>.
          TOT_FATTURATO_A = TOT_FATTURATO_A + <FS_FATTURATO>.
        ENDLOOP.
        TOT_SALDO     = TOT_SALDO     + TOT_SALDO_A .
        TOT_FATTURATO = TOT_FATTURATO + TOT_FATTURATO_A.
        PERFORM CALCULATE_DSO USING TOT_FATTURATO_A
                                    TOT_SALDO_A TOT_DSO_A.
        PERFORM WRITE_TOT_DSO
                      USING TOT_SALDO_A
                            TOT_FATTURATO_A TOT_DSO_A
                            T_LEVEL-LEVEL T_LEVEL-INDEX_FROM.
      ENDLOOP.
    ENDFORM.                    " WRITE_SUB_TOTAL
    Max

Maybe you are looking for

  • IPad Calendar sync with Microsoft Exchange problem

    I use Microsoft Exchange to sync my Google Calendars with my iPad & iPhone. I have a work, personal & business calendar. On my iPhone it sync all three calendars, but on my iPad it only sync my personal calendar. What can I do to fix this, if anythin

  • Blackberry ID Password reset email doesn't contain a link to reset password!

    I'm having the same issue that this guy had in this forum (which doesn't seem to have a solution?): http://supportforums.blackberry.com/t5/BlackBerry-PlayBook/Blackberry-ID-Password-Reset/m-p/1745415#... Basically, I'm trying to reset my Blackberry p

  • What to know the logic of this program :RV60SBAT

    i need to change this program based on my requirement , but i don't know the logic of this program ,there are some puzzles about the logic of the program. the requirement is that: when create the batchjob, the number of the batchjob is fixed , and th

  • A cool little find

    I was just mucking about in the environment and went to the new menu to create a Midi Monitor and noticed the quicktime synth. Plugged it all in and got myself a roland GS synth from Quicktime. Ok its not the most impressive plugin in the world but i

  • G5 dual 2.0 Triplets

    Hi all, I am itchin' to get a G5 and have done some research as to which I want. I'd like to run the latest OS(Leopard), and start dabbling into film making. With money constraints, I was looking at a used G5 dual system. I was thinking about the G5