Use of Subtotals?

Can anybody throw some light on the use of various subtotals available in a Pricing Procedure and how can these be leveraged best for BI and Invoice output reporting. I see that there are some standard sub totals available from 1 thru 9 and also A thru Z.
Any documentation on the same would be welcome.I would reward handsomely to those giving good information.
Thanks

Hi,
Subtotals available in Pricing procedure if properly will help a lot for BI and Invoice output reporting. By assigning proper subtotals required for Invoice output and BW/BI, it will get stored in tables (mostly VBAP - order item table or VBRP - invoice item table). For example subtotal 1 (Carry over value to KOMP-KZWI1) will be stored in VBAP-KZWI1 and VBRP-KZWI1 (when Invoice is created). Similarly 7 ( Carry over value to  KOMP-BONBA) will be stored in VBRP-BONBA (rebate basis). For reporting, we may need various subtotals. If it is not stored in a SAP table, we will have to calculate this subtotals by adding up the condition values which is cumbersome and has performance issues. For ex. Invoice output may require the total freight charges as a single line. We will have to add values from different conditions types which make up the freight cost and display if subtotal is not assigned for  freight condition types.
So prudent use of subtotals will help a lot (esp. where performance of the program is important) for reporting.
Regards
Anil

Similar Messages

  • Use of Subtotals in the pricing procedure

    Dear All,
    I am aware of Subtotals. But not in deep.
    For example, Subtotal "A" is taken as a base for "Credit Management".
    Similarly, can anyone explain me the use of remaining Subtotals.
    If possible, please send some document link also.
    Regards,
    Mullairaja

    Closing the thread

  • How to create new dynamic subtotals in pricing

    Hello All,
    Could any of you advice how to create a new dyncamic subtotals. I know how to create regular subtotals in KOMP but was wondering how create dynamic subtotals which can be used during the pricing runtime?
    Some of the dynamioc subtotals are like XWORKI & XWORK J
    Thanks,
    Vinay

    Based on a OSS note looks like these dynamic/auxiliary subtotals are initialized in LV61AA55. I think I might have to initialize some more if I need some.
    However I see there are some IS-OIL subtotals like Y & Z. Can I use them to populate my condition value & subsequently use to calculate some pricing formulas. Would it have any impact if I am using those subtotals for calculation purposes only
    Any help is appreciated
    Thanks,
    Vinay

  • Grand Total formula different from Subtotals

    Hi,
    i've a question. Suppose i have a normal table (No pivot) with 2 columns: Month and Salary percentage on Month.
    In addition i have subtotals on Month column and a Grand Total. I have a situation like this:
    Month Salary percentage on Month
    30
    January 20
    50
    January Subtotal 100
    20
    February 70
    10
    February Subtotal 100
    Grand Total 200
    In Salary percentage on Month field I have as aggregation rule Sum because i want that subtotals are the sum of single rows of the month.
    But i don't want this for grand total. It should be 100 (max of subtotals).
    Is it possible specify a different formula for Grand Total respect to that used for Subtotals?
    Thanks
    Giancarlo

    If your formula already contains any summarized fields then you cannot summarize that formula. Try creating a mannual running total like this
    whileprintingrecords;
    numbervar i;
    i:=i+@formula;
    Now place this formula in group footer or header and suppress this formula. Create a new formula like
    whileprintingrecords;
    numbervar i;
    Place this in report footer which shows the grand total.
    Reagrds,
    Raghavendra

  • Chart creation using multiple series with same name

    I'm new to Numbers and to chart creation in general, so I'm not sure if Numbers is capable of what I need. But if so, I'd like to know how...
    I have a large spreadsheet with hundreds of lines of expense data, wherein each line item falls into one of a dozen categories of expense types. I would like to create a pie chart by expense type (ie, Healthcare, Automotive, Travel, etc), but Numbers wants to treat each line item as a separate expense, even though many of them share the same name. So I'm getting multiple pie slices that all say "Travel" and so forth. I really just want one pie slice for Travel, one for Auto, etc.
    So how can I make Numbers calculate the subtotals for each expense type and use those subtotals to create the chart? Is there a way to do this within the chart function or do I need to create a separate table for just the subtotals (not sure how to do that either) or what?
    Thanks!

    It appears that I missed your question.
    Here is a way to treat the problem:
    In Tableau 2 column B the formula is:
    =SUMIF(Tableau 1 :: B,A,Tableau 1 :: C)
    The column A of Tableau 2 is a header.
    Yvan KOENIG (from FRANCE lundi 14 avril 2008 14:26:37)

  • To find sum in an internal table - Bit urgent

    Hi SAP experts,
    I have an internal table with the following fields and data :
    Emp_number    Section    Days   
       1                      A           10
       1                      B           20
       3                      A           20
       3                      B           10
       2                      A           20
       2                      B           10
    Now I want to calculate the total days for each employee which is a sum of days of section A and days of section B.
    I want the data as below  into another internal table
    Emp_number    Total_days
        1                      30
        2                      30
        3                      30
    Could any one tell the code for the same.
    Useful answers wud be rewarded.
    Vishnu.

    Hi Vishwanath,
    In this case you have to use CONTROL BREAK STATEMENTS.
    1.At first
    2.At new
    3.At end
    4.At last
    1.At first is going to trigger at the 1st loop of the internal table.From the 2nd loop it is not going to trigger.
    It is mainly used for sub headings.
    2.At new is going to trigger at the new value of the internal table.
    3. At end is going to trigger at the end of the new value of a particular field.
    It is mainly use for subtotals.
    4.At last is going to trigger at the last loop of the internal table.
    It is mainly use for grand totals.
    So you gothrough the above 4 statements.
    In your case you have to use the third statement i.e., At end.
    At end
    ur logic
    endat.

  • Summing up a Column in ALV report

    Hi All,
    I have developed an ALV Report which will display Invoices and other details.
    Now i need to display the sum of NETWR column, if user wish to select that column and click the "SUM" icon.
    As of now, if i select the NETWR column and click 'SUM" column, i am getting Runtime error.
    How to resolve this issue?
    Regards
    Pavan

    Hi Pavan,
    ALV GRID CONTROL:
    This task is performed by the SAP Control Framework.
    The R/3 System allows you to create custom controls using ABAP Objects. The application server is the Automation Client, which drives the custom controls (automation server) at the front end.
    If custom controls are to be included on the frontend, then the SAPGUI acts as a container for them.
    Custom controls can be ActiveX Controls or JavaBeans.
    The system has to use a Remote Function Call (RFC) to transfer methods for creating and using a control to the front end.
    ABAP objects are used to implement the controls in programs.
    An SAP Container can contain other controls (for example, SAP ALV Grid Control, Tree Control, SAP Picture Control, SAP Splitter Control, and so on). It administers these controls logically in one collection and provides a physical area for the display.
    Every control exists in a container. Since containers are themselves controls, they can be nested within one another. The container becomes the parent of its control. SAP containers are divided into five groups:
    SAP custom container: Displays within an area defined in Screen Painter on screens or sub screens.
    Class: CL_GUI_CUSTOM_CONTAINER
    SAP dialog box container: Displays in a modeless dialog box or as a full screen. Class:
    CL_GUI_DIALOGBOX_CONTAINER
    SAP docking container: Displays as docked, resizable sub-window with the option of displaying it as a modeless dialog box. Class: CL_GUI_DOCKING_CONTAINER
    SAP splitter container: Displays and groups several controls in one area - that is, splits the area into cells Class: CL_GUI_SPLITTER_CONTAINER
    SAP easy splitter container: Displays controls in two cells, which the user can resize using a split bar. Class: CL_GUI_EASY_SPLITTER_CONTAINER.
    In the control, you can adjust the column width by dragging, or use the 'Optimum width' function to adjust the column width to the data currently displayed. You can also change the column sequence by selecting a column and dragging it to a new position.
    Standard functions are available in the control toolbar. The details display displays the fields in the line on which the cursor is positioned in a modal dialog box.
    The sort function in the ALV Control is available for as many columns as required. You can set complex sort criteria and sort columns in either ascending or descending order.
    You can use the 'Search' function to search for a string (generic search without *) within a selected area by line or column.
    You can use the 'Sum' function to create totals for one or more numeric columns. You can then use the "Subtotals" function to set up control level lists: You can use the 'Subtotal' function to structure control level lists: select the columns (non-numeric columns only) that you want to use and the corresponding control level totals are displayed.
    For 'Print' and 'Download' the whole list is always processed, not just the sections displayed on the screen.
    You can define display variants to meet your own specific requirements. For information on saving variants, see 'Advanced Techniques'.
    The ALV grid control is a generic tool for displaying lists in screens. The control offers standard functions such as sorting by any column, adding numeric columns, and fixed lead columns .
    Data collection is performed in the program (with SELECT statements, for example) or by using a logical database. The data records are saved in an internal table and passed on to the ALV control along with a field description.
    The field description contains information about the characteristics of each column, such as the column header and output length. This information can defined either globally in the Dictionary (structure in the Dictionary) or in the field catalog in the program itself. You can also merge both techniques.
    The ALV link is a standard function of Query and QuickViewer. If multiline queries or Quick View lists have been defined, they will automatically be compressed to a single line and output in the ALV control as a long, single line list.
    Use Screen Painter to create a sub screen container for the ALV grid control. The control requires an area where it can be displayed in the screen. You have to create a container control that determines this area.
    Use the corresponding icon in the Screen Painter layout to create the container control. The size of area "MY_CONTROL_AREA" determines the subsequent size of the ALV control.
    The valid GUI status must be set at the PBO event in the flow logic of the ALV subscreen container.
    The OK_CODE processing for the cancel functions must be programmed at the PAI event.
    The reference variables for the custom container and the ALV grid control must be declared.
    To create reference variables, use ABAP statement TYPE REF TO .
    The global classes you need to do this are called cl_gui_custom_container (for the custom container control) and cl_gui_alv_grid (for the ALV grid control).
    The global classes are defined in the Class Builder. You can use the Class Builder to display information for the methods, their parameters, exceptions, and so on.
    Use ABAP statement CREATE OBJECT to create the objects for the container and the ALV control. Objects Are instances of a class.
    When an object is created (CREATE), method CONSTRUCTOR of the corresponding class is executed. The parameters of method CONSTRUCTOR determine which parameters have to be supplied with data when the object is created. In the above example, object alv_grid is given the name of the container control (g_custom_container) in exporting parameter i_parent, which links the two controls. For information on which parameters method CONSTRUCTOR possesses and which of these parameters are required, see the Class Builder.
    Objects should only be created once during the program. To ensure that this is the case, enclose the CREATE OBJECT statement(s) in an IF IS INITIAL. ... ENDIF clause. The objects must be generated before the control is displayed for the first time - that is, during the PBO event of the ALV subscreen container.
    To display the requested dataset in the ALV control, the data must be passed on to the control as an internal table, and a field description must exist indicating the order in which the columns will be output.
    In the simplest case, the field description can use a structure from the Dictionary. The Dictionary also determines the technical field attributes like type and length, as well as the semantic attributes like short and long texts. The ALV control uses this information to determine the column widths and headers. The column sequence is determined by the field sequence in the structure.
    If no suitable structure is active in the Dictionary, or you want to output internal program fields in the control, then you will have to define information like the output length and column header in the field catalog.
    In a typical program run, the dataset is read first (SELECT ....), the internal table is filled with the data to display (... INTO TABLE ...), and ABAP statement CALL SCREEN is then used to call the ALV sub screen container.
    The data transfer to the ALV control takes place during the call of method
    set_table_for_first_display from class cl_gui_alv_grid. The method call must be programmed at the PBO event of the ALV subscreen container.
    The name of the Dictionary structure that supplies the field description is specified in exporting parameter i_structure_name. The name of the internal table that contains the data records to display is specified in changing parameter it_outtab.
    The field description for the ALV control can be ta ken from an active Dictionary structure (fully automatic), by passing a field catalog (manual), or through a mixture of the two options (merge).
    The field catalog is in internal table with type lvc_t_fcat. This type is defined globally in the Dictionary.
    Each line in the field catalog table corresponds to a column in the ALV control.
    The field characteristics (= column characteristics) are defined in the field catalog. The field catalog is in internal table with type lvc_t_fcat. Each line that is explicitly described in the ALV control corresponds to a column in the field catalog table.
    The link to the data records to output that are saved in internal table is established through field name . This name must be specified in column "fieldname" in the field catalog.
    This field can be classified through a Dictionary reference (ref_table and ref_field) or by specifying an ABAP data type (inttype).
    Column headers and field names in the detail view of an ALV control line can be determined in the field catalog in coltext and seltext, respectively.
    The position of a field during output can be determined with col_pos in the field catalog.
    If you want to hide a column, fill field no_out with an "X" in the field catalog. Hidden fields can be displayed again in a user display variant.
    Icons can be displayed in the ALV control. If you want a column to be interpreted as an icon, then the icon name must be known to the program (include .) and icon = "X" must be specified for this column in the field catalog.
    The above example shows a semi-automatic field description: Part of the field description comes from the Dictionary structure (sflight), while another part is explicitly defined in the field catalog (gt_fieldcat).
    The field catalog (internal table) is filled in the program and is passed on together with the name of the Dictionary structure during the method call. The information is merged accordingly in method set_table_for_first_display.
    For a user to save display variants, parameters is_variant and i_save must be passed on during method call set_table_for_first_screen. To assign display variants uniquely to a program, at least the program name must be supplied in the transferred structure (gs_variant).
    Program names can be up to 30 characters long.
    If you only pass on the current parameters for is_variant, then existing variants can be loaded, but no new ones can be saved. If you use parameter i_save, you must pass on a variant structure with is_variant.
    I_SAVE = SPACE No variants can be saved.
    I_SAVE = 'U' The user can only save user-specific variants.
    I_SAVE = 'X' The user can only save general (shared) variants.
    I_SAVE = 'A' The user can save both user-specific and general (shared) variants.
    You can use parameter is_layout of method set_table_for_first_display, for example, to define the header in the ALV control and the detail display.
    To do this, define a query area in the program in accordance with Dictionary structure lvc_s_layo, and pass on the text to display in field -grid_title or -detailtitl.
    If you want to create print lists with zebra stripes, set field -zebra to "X". You can display a print preview for print lists by requesting standard function "Print".
    All parameters of method SET_TABLE_FOR_FIRST_DISPLAY from global class
    CL_GUI_ALV_GRID are defined in the Class Builder.
    Events are defined in global class cl_gui_alv_grid; you can use these events to implement user interaction within the program. To respond to a double -click on a table line, you must respond to event DOUBLE_CLICK.
    You receive control in the program, allowing you to implement interactive reporting - such as a full screen details list. The events for cl_gui_alv_grid are located in the Class Builder.
    To define an implement a local class in the program, you use a handler method. In this handler method, you program the functionality to trigger by a double -click in the output table.
    To activate a handler method at runtime, a class or an object from that class registers itself with an event using command SET HANDLER. The names of the IMPORTING parameters in the handler method correspond to the names of the EXPORTING parameters of the related event.
    In the above example, the local class is LCL_ILS and the handler method is ON_DBLCLICK. An object - ALV_DBLCLICK - is created and registers itself for event DOUBLE_CLICK.
    You can query parameter e_row-index to determine which output line was requested by the double -click. This parameter corresponds to the line number of the output table (internal table with the data records to output). If you need information for the selected line, you have to read it with READ TABLE itab INDEX e_row-index.
    This subsequent read in the output table generally corresponds to the HIDE area in conventional reporting. You first have to make sure that the user has double -clicked a line in the output table (similar to the valid line selection with the HIDE technique).
    A field group can contain global data objects, but not data objects that have been defined locally in a subroutine or function module.
    You can use INSERT to specify both fields and field symbols. This makes it possible to dynamically insert a data object referred to by a field symbol into a field group at runtime. Any field symbols that have not been assigned are ignored, which means no new field is inserted into the field group.
    The EXTRACT statement writes all the fields of a field group as one record to a sequential dataset (transport takes place with similarly named fields). If a HEADER field group is defined, then its fields are placed ahead of each record as sort keys. You can then sort the dataset with SORT and process it with LOOP ...ENDLOOP. In this case, no further EXTRACT is possible.
    The INSERT statement is not a declarative statement: This means field groups can also be expanded in the program flow section.
    As soon as the first dataset of a field group has been extracted with EXTRACT, that field group can no longer be expanded with INSERT. In particular, the HEADER field group cannot be expanded after the first EXTRACT (regardless of the field group).
    When the GET events are processed, the logical database automatically writes hexadecimal zeros in all the fields of a node when it returns to an upper-level node in the hierarchy. Since the HEADER normally contains sort fields for all field groups, these hexadecimal zeros in the HEADER serve as a type of hierarchy key: The more zeros there are, the further up in the control level hierarchy you go.
    The SORT statement sorts the extract dataset in accordance with the defined field sequence in field group HEADER. The addition BY ... sets a new sort key.
    Each must be either a field of field group HEADER or a field group that consists only of fields of the field group HEADER. You can use the additions ASCENDING and DESCENDING to determine whether the fields are sorted in ascending (default) or descending order.
    Fields containing X'00' in the logical databases are always displayed before all other values during a SORT.
    Processing of an extract dataset always takes places within a LOOP. The contents of the extract dataset field are placed in program fields with the same names.
    The group change always involves the fields of the HEADER. Single record processing for extract datasets is performed using language element AT ( = field group).
    CNT() is not a statement, but instead a field that is automatically create d and filled when is a non-numeric field from field group HEADER and is part of the sort key. At the end of the group, CNT() contains the number of different values that the field recorded in this group level.
    SUM() is not a statement, but instead a field that is automatically created and filled when is a numeric field of an extract dataset. At the end of the group, SUM() contains the control total of field .
    *** and CNT are only available at the end of the group level or at AT LAST.
    Single record processing for extract datasets AT WITH is only performed when field group is immediately followed by field group in the temporary dataset.
    Loops over an extract dataset cannot be nested. However, several contiguous loops are permitted.
    The sequence of the control level changes within the LOOP must correspond to the sort sequence.
    Totals can only be calculated within control footer processing.
    Extracts allow only appends (EXTRACT), sorting (SORT) and sequential processing (LOOP).
    Once a SORT or LOOP has occurred, the intermediate dataset is frozen and cannot be expanded with EXTRACT. Operations that insert into or delete from EXTRACT datasets are not supported.
    Extracts allow for several record types (FIELD-GROUPS) with fields that can be set dynamically (INSERT is not a declarative statement!). Internal tables have a single, statically-defined line type.
    Internal tables use the sequence of table fields according to the declaration for the hierarchy of the control leve l. The control level structure for internal tables is therefore static, and is independent of which criteria were used to sort the internal table.
    Extracts do not depend on the field sequence for control level processing: a re-sort or a completely different control level process can take place. The control level structure for extract datasets is therefore dynamic. It corresponds exactly to the sort key of the extract dataset. The sort key is the sequence of fields from the field group HEADER, and is used to sort the extract dataset.
    Extracts rely on the compiler to determine which combinations of group levels and a cumulating field the control level totals desire. The desired control level totals are determined by the processing of LOOP ... ENDLOOP blocks. Internal tables build the control level total with the SUM statement.
    This procedure leads to high resource depletion for totaling control levels in internal tables.
    Regards,
    Chandru

  • ALV Grid: method double_click provides wrong information with 'totals line'

    Hi together,
    I´m using 'method double_click' with an ALV grid...like:
    CLASS lcl_events IMPLEMENTATION.
      METHOD double_click.
        READ TABLE it_outtab INDEX e_row-index INTO s_datatab.
    Everything works perfect as long as I don´t use totals with it.
    Using totals /subtotals lines 'READ TABLE...' provides a wrong row-index.
    Any idea how to resolve this problem?
    Thanks for any help

    Hi, this is a big problem when you use OO to build an ALV, to resolve your problem, you have to implement an event TOOLBAR_BUTTON_CLICK to get button function, when your code pass by this method you have to use the method
    CALL METHOD gcl_grid->set_function_code
        CHANGING
            c_ucomm = l_ucomm.
    l_ucomm is the function code of button, the method set_function_code sort your internal table dynamically and you get the correct index when you use double_click.
    Regards.
    David Carballido
    PD: Sry for my bad english ^^

  • How to see the values of subtotal

    Hi Gurus,
    I have a small doubt regarding pricing procedure. In pricing procedure we have a column called Condition subtotal, it stores the value in the table and we can call this value whenever we required.
    My question is here where we can see the subtotal value and how. I tried to view this value in table but it is a structure that is the reason i could not view it.
    Please respond to this thread.
    Thanks in advance.
    Venkat.

    Hi:
    What you can do is to used subtotals on to the pricing procedure. If you uses subtotals 1 to 6 this will be store on table VBAP on field KZWI1 to KZWI6. You can also used other subtotals D to M is you want to used formulas.
    Best Regards,
                         Federico

  • +/- symbol in output screen for the amount

    Hi,
    I am using ALV GRID,
    In this i wld like to add +/- symbol to amount which is to used calculate subtotals
    to display output.
    regards
    RAj.

    Hi,
    I am using ALV GRID,
    In this i wld like to add +/- symbol to amount which is to used calculate subtotals
    to display output.
    regards
    RAj.

  • How to calculate the subtotals using reuse_alv_grid_display_lvc

    Hi folks,
    How to get the subtotals of shipped quantity monthly wise using reuse_alv_grid_display_lvc.
    Thanks in Advance
    Rao

    Hi,
    As per the standard SAP, it is not possible to display the subtotal in a different field. The solution is remove the subtotal field from the internal table.
    In the slis_t_sortinfo_alv table pass the kunnr field with subtot = 'X'.
    I hope this will solve your query.
    Reward all useful answers.
    Thank you.

  • How can I obtain column subtotals in a spreadsheet already sorted by catagory. Using version 3. Was fairly straight forward in previous version.

    How can I obtain numeric subtotals in a spredsheet already sorted by catagory? Am using version 3. This process was fairly straight forward in previous versions.

    SUMIF or SUMIFS function?

  • Subtotals in dynamic internal table using alv grid

    hi experts i have created one dynamic table.  The requirement is to display the subtotals in the output using reuse_alv_grid.
    Dynamic itab (field-symbols) and ALV event BEFORE_LINE_OUTPUT
    the above is the thread related and could any one please provide the sample code for this task.
    can any one post the solution for that.
    rewards points will be awarded.
    khazi

    * ASSINING STRUCTURE FOR FILD CATLOGS
    DATA: DYN_TABLE    TYPE REF TO DATA,
          DYN_LINE     TYPE REF TO DATA,
          LS_FIELDCAT TYPE LVC_S_FCAT,
          LT_FIELDCAT TYPE LVC_T_FCAT.
      LOOP AT LT_DMTAB INTO LS_DMTAB.
        CLEAR LS_FIELDCAT.
        LS_FIELDCAT-FIELDNAME = LS_DMTAB-SDATE .
        LS_FIELDCAT-DATATYPE  = 'DEC'.
        LS_FIELDCAT-INTTYPE   = 'P'.
        LS_FIELDCAT-INTLEN    = '16' .
        LS_FIELDCAT-DECIMALS  = '03'.
        LS_FIELDCAT-JUST      = 'C'.
        APPEND LS_FIELDCAT TO LT_FIELDCAT.
      ENDLOOP.
    *& For grouping the table rows for Under Line
      LS_FIELDCAT-FIELDNAME = 'ULFIELD' .
      LS_FIELDCAT-DATATYPE  = 'INT'.
      LS_FIELDCAT-INTTYPE   = 'P'.
      LS_FIELDCAT-INTLEN    = '2' .
      LS_FIELDCAT-DECIMALS  = ''.
      APPEND LS_FIELDCAT TO LT_FIELDCAT.
      "* Create dynamic internal table and assign to Field-Symbol
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
          IT_FIELDCATALOG = LT_FIELDCAT
        IMPORTING
          EP_TABLE        = DYN_TABLE.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      ASSIGN DYN_TABLE->* TO <LT_AREA_F>.
      "* Create dynamic work area and assign to Field Symbol
      CREATE DATA DYN_LINE LIKE LINE OF <LT_AREA_F>.
      ASSIGN DYN_LINE->* TO <LS_AREA_F>.
    You check in Field cat level you will get  Check Sub total field will exist
    Thanks and regards
    Jogu

  • Obtaining subtotals based on 2 fields.(ALV using oops concept)

    Need help on how to apply sort on 2 fields and obtain subtotals.For example if I have some records for similar tax code and some more records  for a similar tax jurisdiction (under which all tax codes come).I need to calculate subtotals for same tax code as well as same tax jurisdiction code.Currently I am able to generate subtotals by sorting on 1 field only ,using OOPs concept.How do I apply for both the fields? This is what is being done currently with regard to sorting and subtotaling : 
    METHOD set_sorts.
    lr_sorts = gr_alv_data->get_sorts( ).
    TRY.
            lr_sorts->add_sort( 'TXJCD' ). ---sorting based on tax jurisdiction
          CATCH: cx_salv_not_found,
                cx_salv_existing,
                cx_salv_data_error.
        ENDTRY.
        TRY.
            lr_sorts->add_sort( columnname = 'MSKWZ'
                                        subtotal = if_salv_c_bool_sap=>true ).
          CATCH cx_salv_data_error cx_salv_not_found
                cx_salv_existing.                          
        ENDTRY.
      ENDMETHOD.                    "set_sorts
    Thanks & Regards,
    Savitha

    Hi Savitha,
    Use the other paramenters like POSITION, SEQUENCE, SUBTOTAL for both fields like as follows. Then it will work fine.
    TRY.
    lr_sorts->add_sort( columnname = 'TXJCD'
    sequence = 1
    Position = 1
    subtotal = if_salv_c_bool_sap=>true ).
    CATCH cx_salv_data_error cx_salv_not_found
    cx_salv_existing.
    ENDTRY.
    TRY.
    lr_sorts->add_sort( columnname = 'MSKWZ'
    sequence = 2
    Position = 1
    subtotal = if_salv_c_bool_sap=>true ).
    CATCH cx_salv_data_error cx_salv_not_found
    cx_salv_existing.
    ENDTRY.

  • ALV subtotals using methods

    Hi
    Please provide me sample code for subtotals using methods.
    The code is
    DATA: ls_sort TYPE lvc_s_sort.
    ls_sort-spos = '1' .
    ls_sort-fieldname = 'BWART'.
    ls_sort-up = 'X'.
    ls_sort-subtot = 'X'.
    *ls_sort-group = 'UL'.
    APPEND ls_sort TO p_gt_sort.
    endform
    but it is not working
    Please help me

    Hi,
    this is how you should do...
    CLASS lcl_event_handler DEFINITION DEFERRED.
    DATA: dg_events_receiver TYPE REF
                                TO lcl_event_handler.  "event receiver
    *       CLASS lcl_event_handler DEFINITION
    *       For Event handling                                             *
    CLASS lcl_event_handler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
           subtotal_text        FOR EVENT subtotal_text
                             OF cl_gui_alv_grid
                             IMPORTING es_subtottxt_info
                                       ep_subtot_line
                                       e_event_data.
    ENDCLASS.                    "VERIFY_EVENT_HANDLER DEFINITION
    *       CLASS lcl_event_handler IMPLEMENTATION
    *       Implementation of event handler method                        *
    CLASS lcl_event_handler IMPLEMENTATION.
      METHOD subtotal_text.
        PERFORM d0100_event_subtotal_text USING es_subtottxt_info
                                                ep_subtot_line
                                                e_event_data.
      ENDMETHOD.                    "subtotal_text
    ENDCLASS.                    "lcl_event_handler IMPLEMENTATION
    *--set event handler
      PERFORM set_event_handler.
      CALL METHOD dg_grid->set_table_for_first_display
        EXPORTING
          is_layout                     = ds_layout
        CHANGING
          it_outtab                     = <fs_f>
          it_fieldcatalog               = dt_alv_cat
          it_sort                       = dt_sort
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4.
      IF sy-subrc <> 0.
        MESSAGE i000 WITH
             'Error in calling SET_TABLE_FOR_FIRST_DISPLAY'(026).
      ENDIF.
    *&      Form  set_event_handler
    *       event handler
    *  -->  p1        text
    *  <--  p2        text
    FORM set_event_handler .
      CREATE OBJECT dg_events_receiver.
      SET HANDLER dg_events_receiver->subtotal_text
                  FOR dg_grid.
    ENDFORM.                    " set_event_handler
    *&      Form  d0100_event_subtotal_text
    *       To handle subtotal text event
    *      -->P_ES_SUBTOTTXT_INFO  text
    *      -->P_EP_SUBTOT_LINE  text
    *      -->P_E_EVENT_DATA  text
    FORM d0100_event_subtotal_text  USING
                            p_es_subtottxt_info TYPE lvc_s_stxt
                           p_ep_subtot_line TYPE REF TO data
                           p_e_event_data TYPE REF TO cl_alv_event_data .
      FIELD-SYMBOLS: <fs> TYPE ANY.
      ASSIGN p_e_event_data->m_data->* TO <fs>.
      <fs> = 'TOTAL'(027).
    ENDFORM.                    " d0100_event_subtotal_text
    Regards
    vijay

Maybe you are looking for

  • Doubt on Depreciation in Fixed Assets Module

    Dear Members, When we run depreciation we have an option to select the "Close Period" check box and Oracle Standard user guide says that "Depreciation can be run as many times as needed in the current period as long as it is not closed". Now when we

  • JasperReport for EBS 11i

    Hi Our developers is using 3rd party report generator JasperReport. And she encountered the ff. error: "ORA-01652 unable to extend temp segment by 425984 in tablespace system" Do I need to add tablespace or Do I need to tune the report program? Thank

  • Should I link to my RSS feed or to the iTunes page from my website?

    On A Story For Bedtime I want to put a link to a podcast of the stories, should I link to the apple iTunes music store magic launching URL like this or should I link directly to my XML like this . A fair percentage of my audience will not have a clue

  • File formats for pictures

    I e-mailed myself  a picture, from my cell.  When I went to download it, I noticed it was a .png.  I have checked settings & read the manual & can't find how to change this.  Does anyone know? I had been trying to post a photo to an app & continue to

  • Edit existing Site

    Can I edit an existing website created with Dreamweaver using the free trial Dreamweaver.