Grand Total on Top

Hi,
  I needed some suggestion as to how to get the Top 10 total and the Grand Total on top of the report table rather than at the bottom. Please advise.
Z

Hi,
when you click the grand total symbol it will ask u before or after, if we select before then the grand total will display on top, if we select after grand total will display in bottom.
Mark If Helpful/correct.
Thanks.

Similar Messages

  • Whether its possible for calculating Grand total the Top 20 records?how?plz

    Hi Experts,
    could you please let me know that whether the Grand total can be calculated by selecting the Top 20 records from the table.
    please....its urgent......

    I agree with Christian, we need additional clarification.
    If you are looking for a report which shows only the Top 20 records and a Grand Total, here are the steps you follow:
    1. From the Criteria tab in Answers, create a filter on the column you wish to show only the top 20 records.
    2. Set Operator to - "Is in top"
    3. Set Value to - "20"
    From there - go to the results tab. Locate the data column you would like to "count" and select the "total by" button. (Looks like an E)
    Hope this helps. If you are looking for something else, please provide us with a more detailed explanation.
    Thanks.

  • How to display subtotal and grand total with a top 10 condistion ?

    Hello,
    I would like to display a Top 10 list with subtotal for Top 10 and grand total for all the lines.
    I succeed to display top 10 subtotal with "calculations/total" parameter but my question is How to display also the grand total for all the lines ?
    Thank you in advance.
    Best regards
    Nicolas

    Calculate Results/not defined gives grand total and calculation / total gives top 10 sum. As far as I know, you can't display both at the same time.

  • MDX - TOP COUNT AND GRAND TOTALS

    I need to get ONLY the TOP 25 suppliers based on the NET Revenue, but I need also the GRAND TOTAL for all the suppliers.
    Is that possible to accomplish using an MDX query?

    thanks, but it is not what i want.
    here an example (with top 4 instead of 25)
    suppliers              Net Amt
    1054                    $500          visible
    1053                    $100        visible
    1058                    $50           visible
    1044                    $40           visible
    1022                    $20         NOT visible
    1045                    $20            NOT visible
    TOT                    $730  ------> this is the total I want
    I hope it is more clear
    mcrisf

  • Alv subtotals  and grand total for a field

    Hi friends,
    I Have an internal table ITAB1
    in that i have a senario as below.
    In my GRID display iam getting values in the layou as follows
    BUKRS =  1000
    LIFNR      MATNR     STCST
    100          abc            500,00
    100          pqr             400,00
    100          xyz            200,00
                        sub total
    200         pto              700,00
    200         vbr              900,00
                        sub total
    BUKRS =  2000
    LIFNR      MATNR     STCST
    150          abc            500,00
    150          pqr             400,00
    150          xyz            200,00
                        sub total
    260         pto              700,00
    260         vbr              900,00
                        sub total
              GRAND TOTAL = 
    Now my requirement is at the end of every vendor  i need sub total for STCST field.
    and at the end of every company code i need GRAND TOTAL for STCST field.
    Its alv grid display.
    how can i do that.
    Regards,
    Priyanka.

    Check this sample code may it will help u:
    *& Report  Z_ALV_SUBTOTAL
    REPORT z_alv_subtotal.
    *& Table declaration
    TABLES: ekko.
    *& Type pool declaration
    TYPE-POOLS: slis. " Type pool for ALV
    *& Selection screen
    SELECT-OPTIONS: s_ebeln FOR ekko-ebeln.
    *& Type declaration
    * Type declaration for internal table to store EKPO data
    TYPES: BEGIN OF x_data,
           ebeln  TYPE char30,  " Document no.
           ebelp  TYPE ebelp,   " Item no
           matnr  TYPE matnr,   " Material no
           matnr1 TYPE matnr,   " Material no
           werks  TYPE werks_d, " Plant
           werks1 TYPE werks_d, " Plant
           ntgew  TYPE entge,   " Net weight
           gewe   TYPE egewe,   " Unit of weight                          
           END OF x_data.
    *& Internal table declaration
    DATA:
    * Internal table to store EKPO data
      i_ekpo TYPE STANDARD TABLE OF x_data INITIAL SIZE 0,
    * Internal table for storing field catalog information
      i_fieldcat TYPE slis_t_fieldcat_alv,
    * Internal table for Top of Page info. in ALV Display
      i_alv_top_of_page TYPE slis_t_listheader,
    * Internal table for ALV Display events
      i_events TYPE slis_t_event,
    * Internal table for storing ALV sort information
      i_sort TYPE  slis_t_sortinfo_alv,
      i_event TYPE slis_t_event.
    *& Work area declaration
    DATA:
      wa_ekko TYPE x_data,
      wa_layout     TYPE slis_layout_alv,
      wa_events         TYPE slis_alv_event,
      wa_sort TYPE slis_sortinfo_alv.
    *& Constant declaration
    CONSTANTS:
       c_header   TYPE char1
                  VALUE 'H',                    "Header in ALV
       c_item     TYPE char1
                  VALUE 'S'.
    *& Start-of-selection event
    START-OF-SELECTION.
    * Select data from ekpo
      SELECT ebeln " Doc no
             ebelp " Item
             matnr " Material*
             matnr " Material*
             werks " Plant*
             werks " Plant*
             ntgew " Quantity
             gewei " Unit
             FROM ekpo
             INTO TABLE i_ekpo
             WHERE ebeln IN s_ebeln
             AND ntgew NE '0.00'.
      IF sy-subrc = 0.
        SORT i_ekpo BY ebeln ebelp matnr .
      ENDIF.
    * To build the Page header
      PERFORM sub_build_header.
    * To prepare field catalog
      PERFORM sub_field_catalog.
    * Perform to populate the layout structure
      PERFORM sub_populate_layout.
    * Perform to populate the sort table.
      PERFORM sub_populate_sort.
    * Perform to populate ALV event
      PERFORM sub_get_event.
    END-OF-SELECTION.
    * Perform to display ALV report
      PERFORM sub_alv_report_display.
    *&      Form  sub_build_header
    *       To build the header
    *       No Parameter
    FORM sub_build_header .
    * Local data declaration
      DATA: l_system     TYPE char10 ,          "System id
            l_r_line     TYPE slis_listheader,  "Hold list header
            l_date       TYPE char10,           "Date
            l_time       TYPE char10,           "Time
            l_success_records TYPE i,           "No of success records
            l_title(300) TYPE c.                " Title
    * Title  Display
      l_r_line-typ = c_header.               " header
      l_title = 'Test report'(001).
      l_r_line-info = l_title.
      APPEND l_r_line TO i_alv_top_of_page.
      CLEAR l_r_line.
    * Run date Display
      CLEAR l_date.
      l_r_line-typ  = c_item.                " Item
      WRITE: sy-datum  TO l_date MM/DD/YYYY.
      l_r_line-key = 'Run Date :'(002).
      l_r_line-info = l_date.
      APPEND l_r_line TO i_alv_top_of_page.
      CLEAR: l_r_line,
             l_date.
    ENDFORM.                    " sub_build_header
    *&      Form  sub_field_catalog
    *       Build Field Catalog
    *       No Parameter
    FORM sub_field_catalog .
    *  Build Field Catalog
      PERFORM sub_fill_alv_field_catalog USING:
         '01' '01' 'EBELN' 'I_EKPO' 'L'
         'Doc No'(003) ' ' ' ' ' ' ' ',
         '01' '02' 'EBELP' 'I_EKPO' 'L'
         'Item No'(004) 'X' 'X' ' ' ' ',
         '01' '03' 'MATNR' 'I_EKPO' 'L'
         'Material No'(005) 'X' 'X' ' ' ' ',
         '01' '03' 'MATNR1' 'I_EKPO' 'L'
         'Material No'(005) ' ' ' ' ' ' ' ',
         '01' '04' 'WERKS' 'I_EKPO' 'L'
         'Plant'(006) 'X' 'X' ' ' ' ',
         '01' '04' 'WERKS1' 'I_EKPO' 'L'
         'Plant'(006) ' ' ' ' ' ' ' ',
         '01' '05' 'NTGEW' 'I_EKPO' 'R'
         'Net Weight'(007) ' ' ' ' 'GEWE' 'I_EKPO'.
    ENDFORM.                    " sub_field_catalog
    *&     Form  sub_fill_alv_field_catalog
    *&     For building Field Catalog
    *&     p_rowpos   Row position
    *&     p_colpos   Col position
    *&     p_fldnam   Fldname
    *&     p_tabnam   Tabname
    *&     p_justif   Justification
    *&     p_seltext  Seltext
    *&     p_out      no out
    *&     p_tech     Technical field
    *&     p_qfield   Quantity field
    *&     p_qtab     Quantity table
    FORM sub_fill_alv_field_catalog  USING  p_rowpos    TYPE sycurow
                                            p_colpos    TYPE sycucol
                                            p_fldnam    TYPE fieldname
                                            p_tabnam    TYPE tabname
                                            p_justif    TYPE char1
                                            p_seltext   TYPE dd03p-scrtext_l
                                            p_out       TYPE char1
                                            p_tech      TYPE char1
                                            p_qfield    TYPE slis_fieldname
                                            p_qtab      TYPE slis_tabname.
    * Local declaration for field catalog
      DATA: wa_lfl_fcat    TYPE  slis_fieldcat_alv.
      wa_lfl_fcat-row_pos        =  p_rowpos.     "Row
      wa_lfl_fcat-col_pos        =  p_colpos.     "Column
      wa_lfl_fcat-fieldname      =  p_fldnam.     "Field Name
      wa_lfl_fcat-tabname        =  p_tabnam.     "Internal Table Name
      wa_lfl_fcat-just           =  p_justif.     "Screen Justified
      wa_lfl_fcat-seltext_l      =  p_seltext.    "Field Text
      wa_lfl_fcat-no_out         =  p_out.        "No output
      wa_lfl_fcat-tech           =  p_tech.       "Technical field
      wa_lfl_fcat-qfieldname     =  p_qfield.     "Quantity unit
      wa_lfl_fcat-qtabname       =  p_qtab .      "Quantity table
      IF p_fldnam = 'NTGEW'.
        wa_lfl_fcat-do_sum  = 'X'.
      ENDIF.
      APPEND wa_lfl_fcat TO i_fieldcat.
      CLEAR wa_lfl_fcat.
    ENDFORM.                    " sub_fill_alv_field_catalog
    *&      Form  sub_populate_layout
    *       Populate ALV layout
    *       No Parameter
    FORM sub_populate_layout .
      CLEAR wa_layout.
      wa_layout-colwidth_optimize = 'X'." Optimization of Col width
    ENDFORM.                    " sub_populate_layout
    *&      Form  sub_populate_sort
    *       Populate ALV sort table
    *       No Parameter
    FORM sub_populate_sort .
    * Sort on material
      wa_sort-spos = '01' .
      wa_sort-fieldname = 'MATNR'.
      wa_sort-tabname = 'I_EKPO'.
      wa_sort-up = 'X'.
      wa_sort-subtot = 'X'.
      APPEND wa_sort TO i_sort .
      CLEAR wa_sort.
    * Sort on plant
      wa_sort-spos = '02'.
      wa_sort-fieldname = 'WERKS'.
      wa_sort-tabname = 'I_EKPO'.
      wa_sort-up = 'X'.
      wa_sort-subtot = 'X'.
      APPEND wa_sort TO i_sort .
      CLEAR wa_sort.
    ENDFORM.                    " sub_populate_sort
    *&      Form  sub_get_event
    *       Get ALV grid event and pass the form name to subtotal_text
    *       event
    *       No Parameter
    FORM sub_get_event .
      CONSTANTS : c_formname_subtotal_text TYPE slis_formname VALUE
    'SUBTOTAL_TEXT'.
      DATA: l_s_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 4
        IMPORTING
          et_events       = i_event
        EXCEPTIONS
          list_type_wrong = 0
          OTHERS          = 0.
    * Subtotal
      READ TABLE i_event  INTO l_s_event
                        WITH KEY name = slis_ev_subtotal_text.
      IF sy-subrc = 0.
        MOVE c_formname_subtotal_text TO l_s_event-form.
        MODIFY i_event FROM l_s_event INDEX sy-tabix.
      ENDIF.
    ENDFORM.                    " sub_get_event
    *&      Form  sub_alv_report_display
    *       For ALV Report Display
    *       No Parameter
    FORM sub_alv_report_display .
      DATA: l_repid TYPE syrepid .
      l_repid = sy-repid .
    * This function module for displaying the ALV report
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = l_repid
          i_callback_top_of_page   = 'SUB_ALV_TOP_OF_PAGE'
          is_layout                = wa_layout
          it_fieldcat              = i_fieldcat
          it_sort = i_sort
          it_events                = i_event
          i_default                = 'X'
          i_save                   = 'A'
        TABLES
          t_outtab                 = i_ekpo
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
    *    MESSAGE i000 WITH 'Error in ALV report display'(055).
      ENDIF.
    ENDFORM.                    " sub_alv_report_display
    *       FORM sub_alv_top_of_page
    *       Call ALV top of page
    *       No parameter
    FORM sub_alv_top_of_page.                                   "#EC CALLED
    * To write header for the ALV
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = i_alv_top_of_page.
    ENDFORM.                    "alv_top_of_page
    *&      Form  subtotal_text
    *       Build subtotal text
    *       P_total  Total
    *       p_subtot_text Subtotal text info
    FORM subtotal_text CHANGING
                   p_total TYPE any
                   p_subtot_text TYPE slis_subtot_text.
    * Material level sub total
      IF p_subtot_text-criteria = 'MATNR'.
        p_subtot_text-display_text_for_subtotal
        = 'Material level total'(009).
      ENDIF.
    * Plant level sub total
      IF p_subtot_text-criteria = 'WERKS'.
        p_subtot_text-display_text_for_subtotal = 'Plant level total'(010).
      ENDIF.
    ENDFORM.                    "subtotal_text
    Edited by: Joyjit Ghosh on Aug 21, 2008 5:25 PM

  • I need the grand total for particular coulumn for ALV grid report(OOPs).

    Hello,
    I have used the following code,
    But i m not getting the grand total by default.No error but not getting the desired result.
    Could you please help me in this regard.
    FORM  display_simple_alv.
      DATA :  lr_msg  TYPE   REF   TO  cx_salv_msg.
      DATA : lv_header   TYPE   REF   TO  cl_salv_form_layout_grid,
             lv_h_label  TYPE   REF   TO  cl_salv_form_label,
             lv_h_flow   TYPE   REF   TO  cl_salv_form_layout_flow.
      DATA: gr_sorts TYPE REF TO cl_salv_sorts.
      DATA: gr_agg TYPE REF TO cl_salv_aggregations.
      TRY .
          cl_salv_table=>factory(  IMPORTING  r_salv_table = gr_salv_table
                                   CHANGING  t_table = gt_invdetails4 ).
        CATCH  cx_salv_msg  INTO  lr_msg.
      ENDTRY  .
    Display Basic Toolbar
      gr_functions = gr_salv_table->get_functions( ).
      gr_functions->set_all( abap_true ).
      TRY .
          gr_columns = gr_salv_table->get_columns(  ).
          gr_columns->set_optimize( ).
        CATCH  cx_salv_not_found.
      ENDTRY .
      TRY .
          gr_column ?= gr_columns->get_column(  'KUNNR'  ).
          gr_column->set_long_text(  text-009 ).
          gr_column->set_medium_text(  text-009 ).
          gr_column->set_short_text(  text-009 ).
          gr_column ?= gr_columns->get_column(  'NAME1'  ).
          gr_column->set_long_text(  text-010 ).
          gr_column->set_medium_text(  text-010 ).
          gr_column->set_short_text(  text-011 ).
          gr_column ?= gr_columns->get_column(  'AMOUNT'  ).
          gr_column->set_long_text(  text-012 ).
          gr_column->set_medium_text(  text-012 ).
          gr_column->set_short_text(  text-012 ).
          gr_column ?= gr_columns->get_column(  'TAX'  ).
          gr_column->set_long_text(  text-013 ).
          gr_column->set_medium_text(  text-013 ).
          gr_column->set_short_text(  text-013 ).
          gr_column ?= gr_columns->get_column(  'IVA'  ).
          gr_column->set_long_text(  text-014 ).
          gr_column->set_medium_text(  text-014 ).
          gr_column->set_short_text(  text-015 ).
          gr_column ?= gr_columns->get_column(  'TOTAL_AMOUNT'  ).
          gr_column->set_long_text(  text-016 ).
          gr_column->set_medium_text(  text-016 ).
          gr_column->set_short_text(  text-017 ).
          gr_column ?= gr_columns->get_column(  'CURRENCY'  ).
          gr_column->set_long_text(  text-018 ).
          gr_column->set_medium_text(  text-018 ).
          gr_column->set_short_text(  text-018 ).
          gr_column ?= gr_columns->get_column(  'ZINTERNAL_REFNO'  ).
          gr_column->set_long_text(  text-019 ).
          gr_column->set_medium_text(  text-019 ).
          gr_column->set_short_text(  text-019 ).
          gr_column ?= gr_columns->get_column(  'MATERIAL_AMOUNT'  ).
          gr_column->set_long_text(  text-020 ).
          gr_column->set_medium_text(  text-020 ).
          gr_column->set_short_text(  text-021 ).
          gr_column ?= gr_columns->get_column(  'LABOUR_VALUE'  ).
          gr_column->set_long_text(  text-022 ).
          gr_column->set_medium_text(  text-022 ).
          gr_column->set_short_text(  text-023 ).
          gr_column ?= gr_columns->get_column(  'FAILURE_COST'  ).
          gr_column->set_long_text(  text-024 ).
          gr_column->set_medium_text(  text-024 ).
          gr_column->set_short_text(  text-021 ).
          gr_sorts = gr_salv_table->get_sorts( ).
          gr_sorts->add_sort( columnname = 'AMOUNT' subtotal = abap_true ). "for subtotal
          gr_agg = gr_salv_table->get_aggregations( ).
          gr_agg->add_aggregation( 'AMOUNT' ).
        CATCH  cx_salv_not_found cx_salv_data_error cx_salv_existing.
      ENDTRY .
    Set top of page
      CREATE OBJECT lv_header.
      lv_h_label = lv_header->create_label( row =  1  column =  1  ).
      lv_h_label->set_text(  text-001  ).
      lv_h_label = lv_header->create_label( row =  1  column = 5  ).
      lv_h_label->set_text(  text-002  ).
      lv_h_label = lv_header->create_label( row =  1  column = 14  ).
      lv_h_label->set_text(  text-003  ).
      lv_h_flow = lv_header->create_flow( row =  3  column =  04  ).
      lv_h_flow->create_text(  text  =  text-004  ).
      lv_h_flow = lv_header->create_flow( row =  3  column =  05  ).
      lv_h_flow->create_text(  text  =  text-005  ).
      lv_h_flow = lv_header->create_flow( row =  3  column =  06  ).
      lv_h_flow->create_text(  text  =  name  ).
      set the top of list using the header for Online.
      gr_salv_table->set_top_of_list( lv_header ).
    ALV Display
      gr_salv_table->display( ).
    ENDFORM .                     " DISPLAY_SIMPLE_ALV

    Hi Sridevi,
    To get the grand total, you need to pass the SORT itab to the function module. You need to populate the internal table with the fields on which you want the total or subtotal. If you donu2019t pass this table, you wonu2019t get it.
    For ex:
       ls_sort_wa-spos = 1.
      ls_sort_wa-fieldname = gs_plant-werks.
      ls_sort_wa-up = 'X'.
      ls_sort_wa-subtot = 'X'.
      APPEND ls_sort_wa TO gt_sort.
    So the above code, gives the sub total plant wise.
    and if you want the sum(grand total) you can set the DO_SUM to u2018Xu2019 for that particular field in the field catalog.
    So with this approach, you can get the sub total and grand total for a particular field.
    If you donu2019t want the subtotal, just set DO_SUM, you will get the total.
    Thanks,
    Srini.

  • Alv grand total

    hi gurus pls help me on this issue....... i want grand total on each column of this report.
    for example field 'metric-safety'. if possbile try to edit this and send me.
    TYPE-POOLS : slis.
    Tables : Marc, " Plant Data for Material
    Mbew, " Material Valuation
    Ekpo, " Purchasing Document Item
    Eord, " Purchasing Source List
    Zpmt. " Purchasing Metric Table
    Internal Tables Declaration----
    Data : Begin of metric occurs 0,
    matnr like marc-matnr, " Material number
    werks like marc-werks, " Plant
    minbe like marc-minbe, " Recoder Point
    eisbe like marc-eisbe, " Safety Stock
    stprs like mbew-stprs, " Standard Price
    lifnr like eord-lifnr, " Vendor
    menge like ekpo-menge, " PO Quantity
    scalc type p decimals 2,
    safety(20) type c,
    tcalc type p decimals 2,
    Target(20) type c,
    acalc type p decimals 2,
    actual(20) type c,
    ecalc type p decimals 2,
    excess(20) type c,
    ucalc type p decimals 2,
    usafety(20) type c,
    *******Custom table
    inscr like zpmt-inscr, " Inventory Score
    stkot like zpmt-stkot, " Stock Out
    impct like zpmt-impct, " Impact
    nafta like zpmt-nafta, " %nafta
    stscr like zpmt-stscr, " Stock Out Score
    end of metric.
    Data : final like metric occurs 0 with header line.
    DATA: fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    **Data : Begin of output occurs 0,
    lifnr like eord-lifnr, " Vendor
    eisbe like marc-eisbe, " Safety Stock
    minbe like marc-minbe, " Re-order Point
    stprs like mbew-stprs, " Standard Price
    sstock(13) type c, " Value of Safety Stock
    Actual(13) type c, " Actual
    Excess(13) type c, " Excess Inv
    underSs(13) type c, " Under Safety Stock
    end of output.
    Data type Declaration----
    Data : a type c value '$'.
    Data : safety(20) type c,
    target(20) type c,
    actual(20) type c,
    excess(20) type c,
    usafety(20) type c,
    repid like sy-repid.
    data : i_pos type i.
    Selection Screen----
    selection-screen : begin of block b1 with frame Title tname.
    Select-options: Mat for marc-matnr, " Material Number Selection
    Plt for marc-werks, " Plant Selection
    Vdr for eord-lifnr. " Vendor Selection
    selection-screen : end of block b1.
    Initialization----
    initialization.
    tname = 'Purchasing Metric Report'.
    At Selection-Screen----
    At selection-screen.
    IF mat = ' ' and Plt = ' ' and Vdr = ' '.
    message e000.
    *elseif mat metric-matnr.
    *message e001.
    *elseif plt metric-werks.
    *message e002.
    *elseif vdr metric-lifnr.
    *message e003.
    endif.
    Start-of-Selection----
    Start-of-selection.
    *******For Data Retrival
    Perform Data_retrival.
    *******For Calculation
    Perform Calculation.
    *******For Building Fieldcatalog
    Perform Build_fieldcatalog.
    *******Alv Display
    Perform Alv_display.
    *& Form Get_Data
    text
    FORM Data_retrival .
    SELECT a~matnr
    a~werks
    a~eisbe
    a~minbe
    b~matnr
    b~stprs
    c~matnr
    c~lifnr
    d~matnr
    d~menge
    into corresponding fields of table metric from
    ( ( ( marc as a inner join mbew as b on bmatnr = amatnr )
    inner join eord as c on cmatnr = amatnr )
    inner join ekpo as d on dmatnr = amatnr )
    where amatnr in mat and awerks in plt and c~lifnr in vdr.
    if sy-subrc = 0.
    sort metric by matnr.
    endif.
    ENDFORM. " Get_Data
    *& Form Calculation
    text
    FORM Calculation .
    loop at metric.
    ******calculation for safety stock ( safety stock * standard price )
    metric-scalc = metric-eisbe * metric-stprs.
    move metric-scalc to safety.
    condense safety.
    concatenate a safety into metric-safety.
    ******calculation for target ( safety stock + standard price )
    metric-tcalc = ( metric-eisbe * metric-stprs ) + metric-stprs.
    move metric-tcalc to target.
    condense target.
    concatenate a target into metric-target.
    ******calculation for Actual ( Po quantity * standard price )
    metric-acalc = metric-menge * metric-stprs.
    move metric-acalc to actual.
    condense actual.
    concatenate a actual into metric-actual.
    ******calculation for Excess Inv ( Actual - Target )
    metric-ecalc = ( metric-menge * metric-stprs ) - ( ( metric-eisbe * metric-stprs ) + metric-stprs ).
    move metric-ecalc to excess.
    condense excess.
    concatenate a excess into metric-excess.
    ******calculation for Under Safety Stock ( actual < safety stock. then actual + safety stock (Else) zero )
    if actual < safety.
    metric-menge * metric-stprs < metric-eisbe * metric-stprs.
    metric-ucalc = ( metric-menge * metric-stprs ) + ( metric-eisbe * metric-stprs ).
    else.
    metric-ucalc = 0.
    endif.
    move metric-ucalc to usafety.
    condense usafety.
    concatenate a usafety into metric-usafety.
    collect metric into final.
    endloop.
    ENDFORM. " Calculation
    *--End-for-Selection--
    *end-of-selection.
    *loop at final.
    *write : / final-lifnr, final-safety, final-target, final-actual, final-excess, final-usafety.
    *endloop.
    *& Form Build_fieldcatalog
    text
    --> p1 text
    <-- p2 text
    FORM Build_fieldcatalog .
    fcat-fieldname = 'LIFNR'.
    fcat-seltext_m = 'Vendor'.
    fcat-col_pos = i_pos.
    fcat-outputlen = 10.
    fcat-emphasize = 'X'.
    fcat-key = 'X'.
    fcat-do_sum = 'X'.
    fcat-edit = 'X'.
    append fcat to fcat.
    clear fcat.
    i_pos = i_pos + 1.
    fcat-fieldname = 'SAFETY'.
    fcat-seltext_m = 'Safety Stock'.
    fcat-col_pos = 2.
    fcat-outputlen = 10.
    fcat-emphasize = 'X'.
    fcat-do_sum = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'ACTUAL'.
    fcat-seltext_m = 'Actual'.
    fcat-col_pos = 3.
    fcat-outputlen = 10.
    fcat-emphasize = 'X'.
    fcat-do_sum = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'TARGET'.
    fcat-seltext_m = 'Target'.
    fcat-col_pos = 4.
    fcat-outputlen = 10.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'EXCESS'.
    fcat-seltext_m = 'Excess Inv'.
    fcat-col_pos = 5.
    fcat-outputlen = 10.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'USAFETY'.
    fcat-seltext_m = 'Under Safety Stock'.
    fcat-col_pos = 6.
    fcat-outputlen = 20.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'INSCR'.
    fcat-seltext_m = 'Iventory Score'.
    fcat-col_pos = 7.
    fcat-outputlen = 20.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'STKOT'.
    fcat-seltext_m = 'Stock Out'.
    fcat-col_pos = 6.
    fcat-outputlen = 20.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'IMPCT'.
    fcat-seltext_m = 'Impact'.
    fcat-col_pos = 6.
    fcat-outputlen = 20.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'NAFTA'.
    fcat-seltext_m = '%Nafta'.
    fcat-col_pos = 6.
    fcat-outputlen = 20.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'STSCR'.
    fcat-seltext_m = 'Safety Out Score'.
    fcat-col_pos = 6.
    fcat-outputlen = 20.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    ENDFORM. " Build_fieldcatalog
    *& Form Alv_display
    text
    --> p1 text
    <-- p2 text
    FORM Alv_display .
    repid = sy-repid.
    *CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = repid
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    I_STRUCTURE_NAME =
    IS_LAYOUT =
    IT_FIELDCAT = fcat[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT =
    IS_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 = final
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2
    *IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    repid = sy-repid.
    call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
    i_callback_program = repid
    i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
    i_callback_user_command = 'USER_COMMAND'
    i_grid_title = outtext
    is_layout = gd_layout
    it_fieldcat = fcat[]
    it_special_groups = gd_tabgroup
    it_events = gt_events
    is_print = gd_prntparams
    i_save = 'X'
    is_variant = z_template
    tables
    t_outtab = final
    exceptions
    program_error = 1
    others = 2.
    if sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    thx in advance

    hi,
    for subtotal and grand total do the same thing like following,
    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.
    if uesful rewars points

  • Grand Total is Incorrect

    Hi,
    I am having some problems using Grand Total on calculated columns (presentation calculations) with a TOP 25 page filter.
    I basically have my calculated columns filtered by the Current Week repository variable, and then I want to add a filter to show only the top 25. That all works fine, but the grand total on my report is showing the total of all records, not just the top 25. If I add a normal (non-calculated) column from my subject area, the grand total works fine with the top 25 filter.
    Is there any explanation or workaround for this?

    Hello!
    I had the same problem, and this fix solve one part of my problem with grand totals.
    The other one is not solved:
    We have a strong request to compare total_year measures against part_year measures (dinamicaly navigated with dashboard prompt).
    I have a report in dashboard which includes 3 measures:
    - plan_year_total (which is created in admin as measure of sales and at time_dimension logical level is year - and this works ok)
    - sales_part_of_the year (which is navigated through dashboard prompt between)
    - plan_part_of_the_year (which is navigated through dashboard prompt between)
    Problem is when I want to show share in grand total row like:
    plan_year_total / sales_part_of_the year
    It gives out totaly wrong result.
    Is there any other idea or workaround?
    Gorazd

  • Grand Total & Headings as separate row

    Is it possible to put the grand total BEFORE in a table view?
    Can I display Table & Column Headings as separate rows in a pivot table?
    I initially wanted to use a table view because I also need the Table & Column Heading to be displayed as separate row on top...(column properties in Table View: Display Column & Table Headings= As separate rows)...
    but I also need the Grand Total to be on top (Before) but the only option in Table View is None & After.
    I've seen that the Grand Total BEFORE is available in Pivot table view, but in Pivot I can't display column & table headings as separate rows.
    Any idea how to have that 2? (Grand Total Before & Display Column & Table Headings as separate rows)
    Thanks,
    Janne

    Hiey Kishore,
    Here is the problem which I have. I have the table with 6 columns first 4 columns have details and last 2 columns have measures. I can apply color to Label and Measure. but the problem is that the whole line color does not change it just changes color of the column which has the label and the color of the Measures.. inbetween 3 column gets the default light blue color. Is there is a way to change that?
    Thanks

  • Grand Total Level in OBIEE 11g

    Hi ,
    I had a report with product name , order number , order quantity , order amount as columns .
    Now i want add a new column at the bottom level as grand total for ordered amount.
    Can some one please tell me how to do that ,,,I am in hurry
    Thank you

    Hi,
    If you already had the aggregation rule of the ordered amount as sum, then in the table, you can enable row level summation. In the table editor, just on top of the rows section, there is a summation icon that you can click on and set the option as 'after'.
    If you have already tried this thing and if it does not work then you may want to try the narrative view option. Here are steps for it.
    1. Create a new column.
    2. Change the function as RSUM(order quantity).
    3. In the narrative view use this column as @5 (I think you already have 4 columns and hence this might be 5th column)
    Hope this helps.
    Thank you,
    Dhar

  • OBIEE Avg Issue on Grand Total

    Hello Experts,
    I'm having an issue while calculating the grand total for the AVG measure.This is the scenario
    1)I have the show count for  the top three tiles for the rolling 13 weeks and only for the weekends and for a particular group of theaters.I have a 13 week indicator and weekend indicator in the filter.
    2) I have the show count to which is using ((showcount/3(top 3 titles))/ 3(3 days in the week)) = ShowCount/9
    3) now when i'm doing the grand total in the pivot rules summation after ,then it is showing sum of all the averages......but this is not my case...my case should be it has to show the avg of all the theaters that are in group of theaters.
    how can i resolve this issue?
    Any help is greatly appreciated.

    Hi User,
    This report is corrupted. You can rebuild or re copy the xml from 10g to 11g and see if it works.
    Thanks,
    Amol
    (Please mark this answer, if you find helpful)

  • Urgent Grand total Issue

    Hi Experts,
    In my Dashboard has 5 different table report with a Filter option, when I click the clear filter option it affect all the (5) reports.
    1. But I want to clear filter for each reports separately, is it possible means pls tell me how to fix this issue.
    2. Then I want display Grand total at the top of the Table report ie First Grant total then Table report (Usually table report has Grant total is in bottom of that report)
    Thanks in advance
    Balaa...

    1. I donot think this is possible.
    2. This is possible in Pivot but not possible in normal Tabular view. When you click on the 'Sigma' signs there is an option that enables you to specify the position of the Grand Total
    Regards

  • Grand Total Title

    Hi Experts,
    In answers in table view , i've grand total that displays sum for one columns and average for another column. My problem is in the Grand total label,
    Is it possible to have more then one label ?
    thx

    hi,
    you got it ready...
    you tick
    Horizontal axis---> dimension
    Vertical axis-------> measure
    Legend axis -----> max(rsum(amount))
    you click above the previous in Additional Charting Options-->Legend--->Location = top
    and you are ok.
    read from the blog i send you ...there are many interesting things there!(min,max values...and others...)
    hope i helped....
    http://greekoraclebi.blogspot.com/
    ///////////////////////////////////////

  • How to find grand total

    Hi experts,
    I have one internal table containing 2 fields quantity and amount.In the output i want to show total quantity and total amount. How can i achive it..?
    something like this
    qty  amt
    1     10
    2     20
    3     30
    6     60
    reward guaranteed
    thanks
    Kaki

    hi asit
    iam not able to get the totals correctly....can u see this code....every thing is correct except grand totals..
    REPORT  YVFJAUD_BILLDET no standard page heading
            line-size 200
            line-count 65
            message-id Z1.
    *-- Table Declaration
    TABLES: ZFJAUD_BILL,RLGRAP.
    DATA: BEGIN OF T_BILL OCCURS 0,
            VBELN LIKE ZFJAUD_BILL-VBELN,   " Billin Doc number
            POSNR like ZFJAUD_BILL-POSNR,   " Billing item
            CHARG like ZFJAUD_BILL-CHARG,   " Batch Number
            FKDAT like ZFJAUD_BILL-FKDAT,   " Posting date
            FKART like ZFJAUD_BILL-FKART,   " Billing type
            KUNAG like ZFJAUD_BILL-KUNAG,   " Customer(Sold-to-party)
            MATNR like ZFJAUD_BILL-matnr,   " Material number
            FKIMG like ZFJAUD_BILL-FKIMG,   " Batch Quantity
            NETWR like ZFJAUD_BILL-NETWR,   " Amount
            WAERK like ZFJAUD_BILL-WAERK,   " Currency
            VERPR like ZFJAUD_BILL-VERPR,   " TP
            BNAME like ZFJAUD_BILL-BNAME,   " End customer
            AUGRU_AUFT like ZFJAUD_BILL-AUGRU_AUFT, "Order reason
          END OF T_BILL.
    select-options : s_vtweg for ZFJAUD_BILL-vtweg obligatory,
                     s_vkbur for ZFJAUD_BILL-vkbur,
                     s_kunag for ZFJAUD_BILL-kunag,
                     s_matnr for ZFJAUD_BILL-matnr,
                     s_prodh for ZFJAUD_BILL-prodh,
                     s_erdat for ZFJAUD_BILL-erdat obligatory,
                     s_werks for ZFJAUD_BILL-werks,
                     s_lgort for ZFJAUD_BILL-lgort.
    selection-screen begin of block blk1 with frame title text-002.
    parameters : p_file like rlgrap-filename
                              default 'C:\yvfjaud_billdet.xls'.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS : p_flag AS CHECKBOX DEFAULT ' '.
    selection-screen end of block blk1.
    START-OF-SELECTION.
      perform collect_data.
      perform display_data.
      if p_flag = 'X'.
        perform download_to_localpc.
      endif.
    TOP-OF-PAGE.
      perform set_page_header.
    *&      Form  collect_data
          text
    FORM collect_data .
      SELECT VBELN POSNR CHARG FKART KUNAG MATNR FKDAT
             FKIMG NETWR WAERK NETPR VERPR BNAME AUGRU_AUFT BNAME
             FROM ZFJAUD_BILL
             INTO CORRESPONDING FIELDS OF TABLE T_BILL
             WHERE
             vtweg IN s_vtweg AND
             vkbur IN s_vkbur AND
             kunag IN s_kunag AND
             matnr IN s_matnr AND
             prodh IN s_prodh AND
             erdat IN s_erdat AND
             werks IN s_werks AND
             lgort IN s_lgort.
    ENDFORM.                    "collect_data
    FORM download_to_localpc .
      call function 'WS_DOWNLOAD'
        EXPORTING
          filename = p_file
          filetype = 'DAT'
        TABLES
          data_tab = t_bill.
      if sy-subrc <> 0.
        message E000 with 'Download not successful'.
      endif.
    ENDFORM.                    " download_to_localpc
    FORM display_data .
      sort t_bill by vbeln.
      loop at t_bill.
        if t_bill-AUGRU_AUFT = '100' OR
           t_bill-AUGRU_AUFT = '101' OR
           t_bill-AUGRU_AUFT = '102'.
          t_bill-FKIMG = '0.00'.
        endif.
        write :/1  t_bill-VBELN ,
                15 t_bill-POSNR,
                25 t_bill-CHARG,
                40 t_bill-FKDAT,
                55 t_bill-FKART,
                70 t_bill-KUNAG,
                85 t_bill-matnr,
                100 t_bill-FKIMG,
                115 t_bill-NETWR,
                140 t_bill-WAERK,
                145 t_bill-VERPR,
                165 t_bill-BNAME.
      endloop.
    data: line line like t_bill occurs 0 with header line.
      loop at t_bill into line.
        write:/ line-FKIMG,line-netwr.
        AT END OF FKIMG.
          SUM.
          ULINE.
          WRITE: / line-FKIMG, line-netwr.
          SKIP.
        ENDAT.
        AT LAST.
          SUM.
          ULINE.
          WRITE: / line-FKIMG, line-netwr.
        ENDAT.
      endloop.
    ENDFORM.                    " display_data
    FORM set_page_header .
      call function 'Z_REPORT_TITLE'
        EXPORTING
          line_size       = sy-linsz
          sy_title        = 'Billing Details with Cost'
          uline           = 'X'
          first_page_only = ' '.
      write :1(15)  'Billing Doc'        color col_heading,
             15(15) 'Item'               color col_heading,
             25(15) 'Batch'              color col_heading,
             40(15) 'Posting Date'       color col_heading,
             55(15) 'Billing Type'       color col_heading,
             70(15) 'Sold-to-party'      color col_heading,
             85(30)  'Material'          color col_heading,
             110(15) 'Qty'               color col_heading,
             125(15) 'Amount'            color col_heading,
             140(15) 'Currency'          color col_heading,
             155(15) 'TP'                color col_heading,
             165(15) 'End Customer'      color col_heading.
    ENDFORM.                    " set_page_header

  • Grand Total with Count Distinct

    Hi,
    I want to use grand total to count distinct my data,
    I had physical map ActivityId into my fact and set count distinct to its aggregation rules.
    then when i create my report the anwser is OK.(count distinct ActivityID). But in grandtotal is sum.
    The aggregation Rules in BI Awnser is set it Default.
    [Pic >> http://image.ohozaa.com/i/866/tablecountdisctinct.jpg ]
    i don't know why , i try to set many thing but it isn't work
    Thank ,Regard.
    And sorry about my English Language.

    couple of things required here..
    how did you build this measure in rpd?
    Is that physical mapped or logical mapped column(derived column)?
    Map it as physically and apply aggregation rule on top of it to: CountDistinct
    Now, pull the column in front-end it has to give you proper sub-total/total..
    Or, Try putting the formula in front-end in fx of the column and try..

Maybe you are looking for

  • Uninstall/Install Hootenanny

    Think i messed things up real good here. A few weeks ago, i got a trojan virus on my system. Was able to remove it and do a system restore to an earlier date. Issues were fixed with system. Then i attempted to edit some HTML files in dream weaver and

  • Not updating RG1

    Hi every one, By using T.code- J1I5,I am not able to update Rg1 register.Can any body tell me the reason.It's urgent. Regards Prem

  • Two FI documents for one MIRO invoice

    Hi, I would like to now why for some invoices SAP generates two FI documents. For example: I got two FI docs. generated to one invoice, first document has normal line items like almost all FI docs for MIRO invoices but the second one has just two ite

  • Error when installing java

    i downloaded java from www.java.com and when i tried to install it i got this error: "error 1101.error reading from file: c:\windows\temp\_is63b4\1033.MST. verify that the file exists and you can access it."" can someone please help?

  • Can shared actions reset with drag and drop?

    I'm currently creating an interactive module where the learner will need to drag and drop grey squares to the correct area on the screen.  If you see my picture below, I have a possible 20 grey squares needing to be dragged and dropped for each termi