How to calculate of 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 on Month
January 2000,3000,5000
January Subtotal 10000
February 7000,1000,2000
February Subtotal 10000
Grand Total 20000
I need to add a colum where I show the percentage based on the subtotal and not Grand Total
Month Salary Salary %
January 2000 20%
3000 30%
5000 50%
Subtotal 10000 100%
How can i calculate the % of each Salary based on the Subtotal?
Thanks
G.

Not clear on your exact requirement from how you word the question, but I understand you correctly try (or variant of this logic if I have not understood you)
salary / sum(salary by month)
You will have to change the above for the full "Dimension"."Field Name" syntax - but that is pretty much it...
regards,
Robert.

Similar Messages

  • 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 to calculate the subtotals in smartform

    hi all
    can any body tell me how can i display teh subtotals in smartform, please tell me the steps how to do that and aslo is there any special events in smartforms that are helpfull in getting and displaying the subtotals in smartforms
    thanks in advance

    Hi,
    For doing subtotal calculation in SMARTFORMS, do like this.
    Create one "Program Lines" to your main window table row.
    Already you are maintaing "Internal table" for you table in main window.
    Before that, sort the particular internal table with key fields through which you want to find out the sub total, now within the program lines code, first identify how many quantity and currency fields are there.
    Declare respective temporary variables for each and every quantity and currency field.
    then write logic like this.
    at new matnr.
    v_menge = wa_out-menge + v_menge.
    v_netwr  = wa_out-netwr + v_netwr
    end at.
    Also dont forget to declare character variables for quantity and currency fields. We cannot directly display them in smartforms. we need to pass them to the respective quantity and currency fields.
    After end at statement write like this,
    write: / v_menge decimals 2 to v_mengetext,
              v_netwr   decimals 2 to v_netwrtext.
    after this dont forget to clear,
    clear: v_menge, v_netwr.
    no populate v_mengetext and v_netwrtext in your text elements.
    Regards,
    Santosh Kumar M.

  • How to calculate the subtotals in alv for curr field(bsik-wrbtr)

    I want to calculate subtotal for netamt for every new lifnr(vendor )
    this is my program
    REPORT  Z23PRAC1.
    *& Report  ZRFI_AP_AGING_REPORT
    TABLES : lfa1,lfb1.
    CONSTANTS : gc_linedat(1) TYPE c VALUE 'X',
                gc_duedate(1) TYPE c VALUE 'X',
                gc_koart(1) TYPE c VALUE 'K',
                gc_tname(9) TYPE c VALUE 'GT_OUTPUT'.
    TYPE-POOLS: slis.
    TYPES: BEGIN OF ty_output,
           bukrs    TYPE bsik-bukrs,                  "Company Code
           lifnr    TYPE bsik-lifnr,                  "Vendor Account
           blart    TYPE bsik-blart,                  "Document Type
           name1    TYPE lfa1-name1,                  "Vendor Name
           ktokk    TYPE lfa1-ktokk,                  "Account Group
           belnr    TYPE bsik-belnr,                  "Invoice
           ebeln    TYPE bsik-ebeln,                  "Purchasing Order
           bldat    TYPE bsik-bldat,                  "Document Date
           netdt    TYPE bsega-netdt,                 "Due Date
           wrbtr1   TYPE bsik-wrbtr,                            "Aged 1-30
           wrbtr2   TYPE bsik-wrbtr,                            "Aged 31-60
           wrbtr3   TYPE bsik-wrbtr,                            "Aged 61-90
           wrbtr4   TYPE bsik-wrbtr,                  "Aged Over 90
           grossamt TYPE bsik-wrbtr,                  "Gross Amount Due
           psskt    TYPE regup-psskt,                 "Discount
          netamt(13)   TYPE P decimals 2,                  "Net Amount Due
           NETAMT   TYPE BSIK-WRBTR,
           END OF ty_output.
    TYPES: BEGIN OF ty_vendor1,
           lifnr   TYPE lfa1-lifnr,
           name1   TYPE lfa1-name1,
           ktokk   TYPE lfa1-ktokk,
    END OF ty_vendor1.
    TYPES :BEGIN OF ty_vendor,
          bukrs   TYPE bsik-bukrs,                   "COMPANY CODE
          lifnr   TYPE bsik-lifnr,                   "CUSTOMER ACCOUNT
    END OF ty_vendor.
    TYPES :BEGIN OF ty_ekko,
          bukrs   TYPE ekko-bukrs,                   "COMPANY CODE
          lifnr   TYPE ekko-lifnr,                   "CUSTOMER ACCOUNT
          ebeln    TYPE ekko-ebeln,
    END OF ty_ekko.
    DATA: gt_output   TYPE TABLE OF ty_output,        "OUTPUT TABLE
          gt_lineitem TYPE TABLE OF bapi3008_2,       "LINE ITEMS TABLE
         gt_custdet  TYPE TABLE OF ty_custdet,       "CUSTOMER ACCOUNT VALIDATION
          gt_fieldcat TYPE slis_t_fieldcat_alv,       "FIELD CATALOG
          gt_events   TYPE slis_t_event,              "EVENTS CATALOG
          gt_sort     TYPE slis_t_sortinfo_alv,       "SORT CATALOG
          gt_text_top_of_page TYPE slis_t_listheader, "TOP OF THE PAGE
          gt_vendor1 TYPE TABLE OF ty_vendor1,
          gt_vendor TYPE TABLE OF ty_vendor,
          gt_ekko   TYPE TABLE OF ty_ekko.
    DATA: st_output   TYPE ty_output,                 "OUTPUT WORK AREA
          st_lineitem TYPE bapi3008_2,                "LINE ITEMS WORK AREA
         st_custdet  TYPE ty_custdet,                "CUSTOMER ACCOUNT VALIDATION
          st_faede    TYPE faede,                     "DUE DATE CALCULATION
          st_fieldcat LIKE LINE OF gt_fieldcat,
          st_events   LIKE LINE OF gt_events,
          st_sort     LIKE LINE OF gt_sort,
          st_text_top_of_page LIKE LINE OF gt_text_top_of_page,
          st_vendor1 TYPE ty_vendor1,
          st_vendor TYPE ty_vendor,
          st_ekko   TYPE ty_ekko.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS : s_lifnr FOR lfa1-lifnr,
                     s_bukrs FOR lfb1-bukrs,
                     s_ktokk FOR lfa1-ktokk.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS : p_astid TYPE rfpdo-allgstid DEFAULT sy-datum.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETERS: p_summed AS CHECKBOX,
                p_linedt AS CHECKBOX DEFAULT gc_linedat.
    SELECTION-SCREEN END OF BLOCK b3.
    SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-004.
    PARAMETERS: p_docdat AS CHECKBOX,
                p_duedat AS CHECKBOX DEFAULT gc_duedate.
    SELECTION-SCREEN END OF BLOCK b4.
    START-OF-SELECTION.
      SELECT lifnr name1 ktokk FROM lfa1
                                    INTO TABLE gt_vendor1
                                    WHERE lifnr IN s_lifnr.
      SELECT bukrs
               lifnr
               ebeln
               FROM ekko
               INTO TABLE gt_ekko
               WHERE bukrs IN s_bukrs
               AND lifnr IN s_lifnr.
    IF s_bukrs IS NOT INITIAL AND s_lifnr IS NOT INITIAL.
      SELECT bukrs
             lifnr
             FROM lfb1
             INTO TABLE gt_vendor
             WHERE bukrs IN s_bukrs
             AND lifnr IN s_lifnr.
    *LOOP AT GT_OUTPUT INTO ST_OUTPUT.
    *endif.
      LOOP AT gt_vendor INTO st_vendor.
        READ TABLE gt_vendor1 INTO st_vendor1 WITH KEY lifnr = st_vendor-lifnr.
        READ TABLE gt_ekko INTO st_ekko WITH KEY lifnr = st_vendor-lifnr
                                                     bukrs = st_vendor-bukrs.
        CALL FUNCTION 'BAPI_AP_ACC_GETOPENITEMS'
          EXPORTING
            companycode = st_vendor-bukrs
            vendor      = st_vendor-lifnr
            keydate     = p_astid
          TABLES
            lineitems   = gt_lineitem.
        LOOP AT gt_lineitem INTO st_lineitem.
          st_faede-shkzg = st_lineitem-db_cr_ind.
          st_faede-koart = gc_koart.
          st_faede-zfbdt = st_lineitem-bline_date.
          st_faede-zbd1t = st_lineitem-dsct_days1.
          st_faede-zbd2t = st_lineitem-dsct_days2.
          st_faede-zbd3t = st_lineitem-netterms.
          st_faede-rebzg = st_lineitem-inv_ref.
          st_faede-rebzt = st_lineitem-nxt_doctyp.
          st_faede-bldat = st_lineitem-doc_date.
          CALL FUNCTION 'DETERMINE_DUE_DATE'
            EXPORTING
              i_faede                    = st_faede
            IMPORTING
              e_faede                    = st_faede
            EXCEPTIONS
              account_type_not_supported = 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.
          st_output-bukrs = st_vendor-bukrs.
          st_output-lifnr = st_vendor-lifnr.
          st_output-name1 = st_vendor1-name1.
          st_output-ktokk = st_vendor1-ktokk.
          st_output-blart = st_lineitem-doc_type.
          st_output-belnr = st_lineitem-doc_no.
          st_output-ebeln = st_ekko-ebeln.
          st_output-bldat = st_faede-bldat.
          st_output-netdt = st_faede-netdt.
          DATA : lv_date TYPE i.
          IF p_docdat = 'X'.
            lv_date = p_astid - st_output-bldat.
            IF lv_date < 30 .
              st_output-wrbtr1 = st_lineitem-amt_doccur.
            ELSEIF lv_date < 60 .
              st_output-wrbtr2 = st_lineitem-amt_doccur.
            ELSEIF lv_date < 90 .
              st_output-wrbtr3 = st_lineitem-amt_doccur.
            ELSEIF lv_date > 90 .
              st_output-wrbtr4 = st_lineitem-amt_doccur.
            ENDIF.
          ELSE.
            lv_date = p_astid - st_output-bldat.
            IF lv_date < 30 .
              st_output-wrbtr1 = st_lineitem-amt_doccur.
            ELSEIF lv_date < 60 .
              st_output-wrbtr2 = st_lineitem-amt_doccur.
            ELSEIF lv_date < 90 .
              st_output-wrbtr3 = st_lineitem-amt_doccur.
            ELSEIF lv_date > 90 .
              st_output-wrbtr4 = st_lineitem-amt_doccur.
            ENDIF.
          ENDIF.
    DATA :  A TYPE BSIK-WRBTR,
            C TYPE STRING.
          st_output-grossamt = st_output-wrbtr1 +
                               st_output-wrbtr2 +
                               st_output-wrbtr3 +
                               st_output-wrbtr4 .
          A = st_output-grossamt - ( st_output-grossamt * st_output-psskt ) / 100.
          MOVE A TO C.
          MOVE C TO st_output-netamt .
    *st_output-netamt = st_output-grossamt - ( st_output-grossamt * st_output-psskt ) / 100.
          APPEND  st_output TO gt_output.
          CLEAR st_output.
        ENDLOOP.
      ENDLOOP.
    SORT gt_output.
    END-OF-SELECTION.
      PERFORM fill_field_catalog.
      PERFORM fill_event_catalog.
      PERFORM sort_catalog.
      PERFORM display_alv_list.
    *&      Form  fill_field_catalog
          text
    FORM fill_field_catalog .
    *Definition
      DEFINE field_cat.
        st_fieldcat-tabname      = &1.
        st_fieldcat-fieldname    = &2.
        st_fieldcat-ref_tabname  = &3.
        st_fieldcat-seltext_m    = &4.
        st_fieldcat-do_sum       = &5.
          append st_fieldcat to gt_fieldcat.
        clear st_fieldcat.
      END-OF-DEFINITION.
      field_cat gc_tname 'BUKRS' 'BSIK' 'Company Code' ''.
      field_cat 'GT_OUTPUT' 'LIFNR' 'BSIK' 'Customer Account' ''.
      field_cat 'GT_OUTPUT' 'BLART' 'BSIK' 'Document Type' ''.
      field_cat 'GT_OUTPUT' 'NAME1' 'LFA1' 'Vendor Name' ''.
      field_cat 'GT_OUTPUT' 'KTOKK' 'LFA1' 'Account Group' ''.
    field_cat gc_TNAME 'ALLGSTID' 'RFPDO' 'Key Date' ''.
      field_cat gc_tname 'BELNR' 'BSIK' 'Invoice' ''.
      field_cat gc_tname 'EBELN' 'EKKO' 'Purchasing Order' ''.
      field_cat gc_tname 'BLDAT' 'BSIK' 'Document Date' ''.
      field_cat gc_tname 'NETDT' 'BSEGA' 'Due Date' ''.
      field_cat gc_tname 'WRBTR1' 'BSIK' 'Aged 1-30' ''.
      field_cat gc_tname 'WRBTR2' 'BSIK' 'Aged 31-60' ''.
      field_cat gc_tname 'WRBTR3' 'BSIK' 'Aged 61-90' ''.
      field_cat gc_tname 'WRBTR4' 'BSIK' 'Aged Over 90' ''.
      field_cat gc_tname 'GROSSAMT' 'BSIK' 'Gross Amount' ''.
      field_cat gc_tname 'PSSKT' 'REGUP' 'Discount' ''.
      field_cat gc_tname 'NETAMT' 'BSIK' 'Net Amount' 'X' .
    ENDFORM.                    " fill_field_catalog
    *&      Form  fill_event_catalog
          EVENTS FILLING SUBROUTINE TO FIND THE TOP OF THE PAGE EVENT
    FORM fill_event_catalog .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 0
        IMPORTING
          et_events       = gt_events
        EXCEPTIONS
          list_type_wrong = 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.
      READ TABLE gt_events TRANSPORTING NO FIELDS WITH KEY name = 'TOP_OF_PAGE'.
      IF sy-subrc EQ 0.
        st_events-form = 'FILL_HEADER'.
        MODIFY gt_events FROM st_events INDEX sy-tabix TRANSPORTING form.
      ENDIF.
    ENDFORM.                    " fill_event_catalog
    *&      Form  FILL_HEADER
          FILL HEADER DATA
    FORM fill_header .
    st_text_top_of_page-typ = 'S'.
    st_text_top_of_page-info = sy-mandt.
    APPEND st_text_top_of_page TO gt_text_top_of_page.
    st_text_top_of_page-info = sy-uname.
    APPEND st_text_top_of_page TO gt_text_top_of_page.
    WRITE sy-datum TO st_text_top_of_page-info.
    APPEND st_text_top_of_page TO gt_text_top_of_page.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
       EXPORTING
         it_list_commentary = gt_text_top_of_page.
    ENDFORM.                   "fill header
    *&      Form  sort_catalog
          text
    -->  p1        text
    <--  p2        text
    FORM sort_catalog .
      st_sort-up = 'X'.
      st_sort-spos = 1.
      st_sort-subtot = 'X'.
      st_sort-fieldname = 'LIFNR'.
      APPEND st_sort TO Gt_sort.
      CLEAR st_sort.
      st_sort-up = 'X'.
      st_sort-spos = '2'.
      st_sort-subtot = ''.
      st_sort-fieldname = 'NETAMT'.
      APPEND st_sort TO gt_sort.
      CLEAR st_sort.
    ENDFORM.                    " sort_catalog
    *&      Form  display_alv_list
          CREATE THE OUTPUT IN THE ALV LIST FORMAT
    FORM display_alv_list .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = sy-repid
          it_fieldcat        = gt_fieldcat
          it_sort            = gt_sort
          i_default          = 'X'
          it_events          = gt_events
        TABLES
          t_outtab           = gt_output
        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.
    ENDFORM.                    " display_alv_list

    Hi,
    This is the sample report for ALV SUBTOTAL.
    REPORT  YMS_ALVSUBTOTAL.
    *REPORT z_alv_sub_totals .
    TYPE-POOLS: slis.
    DATA: BEGIN OF it_output OCCURS 0,
              var1(8) TYPE n,
              var2(10),
              var3 TYPE I,
          END OF it_output.
    DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
           t_fieldcat TYPE slis_fieldcat_alv,
          it_sort TYPE slis_t_sortinfo_alv,
          t_sort TYPE slis_sortinfo_alv,
          v_repid LIKE sy-repid.
    INITIALIZATION.
      v_repid = sy-repid.
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM sort_fields.
      PERFORM fill_fieldcat.
      PERFORM list_display.
    *&      Form  GET_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM get_data.
      it_output-var1 = 1000.
      it_output-var2 = 'anupama'.
      it_output-var3 = '10000'.
    it_output-key = 'X'.
      APPEND it_output.
      CLEAR it_output.
      it_output-var1 = 1000.
      it_output-var2 = 'siddhu'.
      it_output-var3 = '20000'.
      APPEND it_output.
      CLEAR it_output.
      it_output-var1 = 1000.
      it_output-var2 = 'chinni'.
      it_output-var3 = '100000'.
      APPEND it_output.
      CLEAR it_output.
      it_output-var1 = 2000.
      it_output-var2 = 'chicchu'.
      it_output-var3 = '10000'.
      APPEND it_output.
      CLEAR it_output.
      it_output-var1 = 2000.
      it_output-var2 = 'candy'.
      it_output-var3 = '10000'.
      APPEND it_output.
      CLEAR it_output.
      it_output-var1 = 1000.
      it_output-var2 = 'anupama'.
      it_output-var3 = '10000'.
      APPEND it_output.
      CLEAR it_output.
      it_output-var1 = 4000.
      it_output-var2 = 'anupama'.
      it_output-var3 = '10000'.
      APPEND it_output.
      CLEAR it_output.
    ENDFORM.                    " GET_DATA
    *&      Form  fill_fieldcat
          text
    -->  p1        text
    <--  p2        text
    FORM fill_fieldcat.
      PERFORM fill_fields USING: 'IT_OUTPUT' 'VAR1' 'Variable 1' ' ',
                                 'IT_OUTPUT' 'VAR2' 'Variable 2' ' ',
                                 'IT_OUTPUT' 'VAR3' 'Variable 3' 'X'.
    ENDFORM.                    " fill_fieldcat
    *&      Form  fill_fields
          text
         -->P_0146   text
         -->P_0147   text
         -->P_0148   text
         -->P_0149   text
    FORM fill_fields USING    value(tabname) TYPE slis_tabname
                              value(fieldname) TYPE slis_fieldname
                              value(seltext_m) LIKE dd03p-scrtext_m
                              value(do_sum) TYPE c.
      t_fieldcat-tabname = tabname.
      t_fieldcat-fieldname = fieldname.
      t_fieldcat-seltext_m  = seltext_m.
      IF do_sum = 'X'.
        t_fieldcat-datatype = 'CURR'.
      ENDIF.
      t_fieldcat-do_sum = do_sum.
      APPEND t_fieldcat TO it_fieldcat.
      CLEAR t_fieldcat.
    ENDFORM.                    " fill_fields
    *&      Form  list_display
          text
    -->  p1        text
    <--  p2        text
    FORM list_display.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
         i_callback_program             = v_repid
         it_fieldcat                    = it_fieldcat
         it_sort                        = it_sort[]
       TABLES
          t_outtab                       = it_output
       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.
    ENDFORM.                    " list_display
    *&      Form  sort_fields
          text
    -->  p1        text
    <--  p2        text
    FORM sort_fields.
      t_sort-fieldname = 'VAR1'.
      t_sort-tabname = 'IT_OUTPUT'.
      t_sort-spos = 1.
      t_sort-up = 'X'.
      t_sort-subtot = 'X'.
      APPEND t_sort TO it_sort.
      CLEAR t_sort.
      t_sort-fieldname = 'VAR3'.
      t_sort-tabname = 'IT_OUTPUT'.
      t_sort-spos = 2.
      t_sort-up = 'X'.
      APPEND t_sort TO it_sort.
      CLEAR t_sort.
    ENDFORM.                    " sort_fields
    Thanks,
    Sankar M

  • How to calculate totals in Blocked ALV Report

    Hi All,
    Can any body tell how to calculate totals & sub totals in
    Blocked ALV Report[Blocked List].
    Thanks in advance
    Thanks & Regards,
    Rayeezuddin.

    read this it might help
    Sums                                                       
    15. No_sumchoice(1) TYPE c : This parameter allows the choice for summing up
    Only by fieldcatalog.
    Value set: SPACE, 'X'
    'X' = fields which are to be summed, passed by the calling program (FIELDCAT-DO_SUM = 'X'). The user should not be able to change this value interactively.
    16. No_totalline(1) TYPE c : Removes the option of having totals after sub-totals.
    Value set: SPACE, 'X'
    'X' = no total record is to be output. Subtotals can still be calculated and output. The fields in the subtotals are flagged DO_SUM = 'X' in the field list.
    17. No_subchoice(1) TYPE c : Does not allow the user to interactively change the field chosen for subtotals.
    Value set: SPACE, 'X'
    'X' = value whose change triggers subtotals, provided by the calling program. The user should not be able to change this value interactively.
    18. No_subtotals(1) TYPE c : No subtotals possible          
    Value set: SPACE, 'X'
    'X' = no subtotals.
    19. Numc_sum(1)  TYPE c : Totals only possible for NUMC-Fields.
    20. No_unit_splitting TYPE c: No separate total lines by inh.units   
    21.totals_before_items TYPE c: Display totals before the items   
    22. Totals_only(1) TYPE c :  Show only totals      
    Value set: SPACE, 'X'
    'X' = only total records are output.
    23. Totals_text(60) TYPE c : Text for 1st col. in totals   
    Value set: SPACE, string (max.60)
    ' ' = The first column in the total record contains an appropriate number of '*'s to indicate the total by default. If the first column is wide enough, the string 'Total' is output after the asterisks.
    'String’ = The string passed is output after the total indicated by '*', if the column is wide enough.
    24. Subtotals_text(60) TYPE c : Texts for subtotals
    Value set: SPACE, string (max.60)
    ' ' = In the first column of subtotal records, the subtotal is indicated by an appropriate number of '*' by default. If the first column is not a subtotal criterion, the string 'Total' is output after the asterisks, if the column is wide enough.
    'String’ = the string passed is output after the subtotal indicated by '*', if the column is wide enough and the first column is not a subtotal criterion. If it is a subtotal criterion, its value is repeated after the total, if the column is wide enough.
    ELSE TELL ME I WILL PASTE COMPLETE HELP
    regards

  • How to calculate subtol and total values in alv.

    Hi expert,
    I want to calculate the subtol and total values in alv as follows,
    example:
       month:    Jan      Fer      Mar    Apr
                      -50       -30      40      -10
                      -20       -13      -12     -10
    subtotal      -70       -43      28      -20
                      -10       -10      -10     -10
                      -10       -31      -15     -10
    subtotal      -20       -41      -25     -20
    total           -90       -84       3       -40
    when i put '-' in front of the month,i define the month type c,
    and when the type is c,it cann't calculate the subtotals and totals.
    how can i do can make the layout like the example.
    thanks...
    Edited by: Heum Kim on Aug 25, 2008 3:54 AM

    The below code is not generic one. I am just looking for generic one. You try to fix it using the similiar approach.
    REPORT  ZTEST_ALV_DEC.
    data: fcat type lvc_s_fcat,
          tfcat type lvc_t_fcat.
    data: begin of itab occurs 0,
          carrid(10),
          quan type DEC_16_02_S,
          end of itab.
          itab-carrid = 'AA'.
          itab-quan = '-10000.00'.
          append itab.
    fcat-fieldname = 'QUAN'.
    fcat-tabname = 'ITAB'.
    fcat-decimals_o = 2.
    fcat-edit_mask = 'V__,___.__'.  "This is not generic
    append fcat to tfcat.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
    EXPORTING
       I_CALLBACK_PROGRAM                = sy-repid
       IT_FIELDCAT_LVC                   = tfcat
      TABLES
        t_outtab                          = itab
    EXCEPTIONS
       PROGRAM_ERROR                     = 1

  • Hi guru's in SMART FORMS how i  can get subtotals , and page totals

    hi guru's in SMART FORMS how i  can get subtotals , and page totals plz help me

    Hi
    check this
    Subtotals - Check the link...
    <b>Re: Subtotal with Table Node in smartforms can use the PROGRAM LINES node to calculate the page totals in Table node.
    Table Node has three sections:
    Header: (Triggered once in the beginning of a page)
    Create a Program lines node to reset the value of TOTAL to 0.
    Main Area (For each row of internal table)
    Create a Program lines node to add the Value to TOTAL
    Footer (Triggered once in the End of a page)
    Display the TOTAL
    Note: 1) You can declare the TOTAL variable in the GLOBAL Definitions under GLOBAL DATA.
    2) In the PROGRAM lines always pass the TOTAL in both INPUT and OUTPUT parameters
    Regards
    Anji

  • How to Calculate Opening balance

    Hi BW Gurus,
    How to calculate Opening balance for previous period using variables in Reports using debit and credit.
    Example:
    Opening balance is the balance for an account for the previous period. In other words, if the user is running a report for Period 1, 2006, the opening balance is actually the ending balance from Period 12, 2005 (December 31st, 2005).
    Thanks in advance
    DJ

    Hi Friend,
    If Your Prob is solve then tell me how to find perticular month balance amount.
    i m create cash book report for perticuler GL Account , i use BKPF + BSEG for this
    i found all entries,
    But at last i want to Opening Balance for perticuler date.
    like     01/05/2007 opening balance = 10000 as per tcode FS10N
    and in 26/05/2007 ??????
    how to find exact date opening balance is there any function for same
    or any procedure..
    Thanks
    From
    Gaurav

  • HOW TO CALCULATE OPENNING BALANCE

    HI Experts..
    How to calculate Opening balance for previous period using variables in Reports using debit and credit.
    Example:
    Opening balance is the balance for an account for the previous period. In other words, if the user is running a report for Period 1, 2006, the opening balance is actually the ending balance from Period 12, 2005 (December 31st, 2005).
    I am Using 0FIAR_O03 ODS ..
    Very Urgent Issue..
    If Possible Stp by Step..
    Cheers
    Purushottam
    09891683828
    [email protected]

    Hi Saloni,
    to get the debit and credit you would be using a variable 0I_FPER(Fiscal year / period), which is a user entry interval variable.
    now to get the opening balance you will have to create a customer exit valiable and the low value of 0I_FPER will have to popuplated by writied the code for the customer exit valiable. you will have to restrict the key figure DEB_CRE_LC for this customer exit variable with the operand as less than(< Fiscal Year /Period from 0I_FPER)).
    If the above was useful please assign reward points.
    Regards
    Venkata Devaraj

  • How to calculate Opening balance for a customer?

    Hi Experts,
    How to calculate Opening balance for a customer? I am trying to develop a report where in i have to get opening AR balance,current sales,adjustments etc of a customer. Please let me know how can i do this. I have some tables with me KNC1, BSAD, BSID.
    Thanks in Advance.
    Sharat Chandra.

    Say for example ..
    Get the opening bal for Customer 'K' in CCode 'C1' in 2008 ..
    First get all items from BSEG ..
    Select * from BSEG where KUNNR eq 'K'
                                     and BUKRS eq 'C1'
                                     and GJAHR eq '2008' .
    Sum all the DMBTR values (This is the total value).
    Second get the cleared items form BSAD for the above entries;
    Select * from BSAD for all entries in BSEG where KUNNR and BUKRS and XBLNR eq BSEG-XBLNR.
    Sum all DMBTR values ( this is cleared value).
    Third substract the cleared value from total to get Open value.
    This is a overview .. you should go to the tables and look for fields and etc.. and then define the logic meeeting your requirements .... this is a genric undersatnding ....
    Thanks,
    Aditya. V

  • How to calculate Average balance for an account

    Hi,
    How to calculate average balance for an account for a particular period say for JAN-12 period and after the end of that period for another two days 01-feb-12 and 01-feb-12 ?
    I'm using the following query :
    SELECT cc.segment1||'-'||cc.segment2||'-'||cc.segment3||'-'||cc.segment4||'-'||cc.segment5||'-'||cc.segment6 "Account_XX",
    nvl(sum(l.accounted_dr - l.accounted_cr),0) "Balance"
    FROM gl_code_combinations cc,
    gl_je_lines l
    WHERE cc.code_combination_id = l.code_combination_id
    AND l.set_of_books_id ='XX'
    and code_combination_id = replace it with code combination_id for account_xx
    AND l.effective_date <= '31-Jan-12' (january period end ??)
    GROUP BY cc.segment1||'-'||cc.segment2||'-'||cc.segment3||'-'||cc.segment4||'-'||cc.segment5||'-'||cc.segment6
    There are some discrepancies in "average balance" after end of month (Jan-12)?
    How to calculate average balances for a particular account (Account_XX above)from end of month of Jan to first two days of february?
    Thanks,
    Kiran

    Kiran,
    Please let me know first, is Average Balancing feature enabled in your GL Ledger?
    Regards
    Muhammad Ayaz

  • How to calculate the total running time for process from sysssislog entries

    Hi All,
    I have the below query which gets me the log entries form the logs table when the process started/completed.
    Select row_number() over (order by starttime) row_num,Substring( Substring(message, CharIndex('''',message) +1 ,Len(message)) ,0, CharIndex('''',Substring(message, CharIndex('''',message) +1 ,Len(message)))) as Description,
    starttime,endtime,message
    from dbo.sysssislog
    where (message like 'start%' or message like 'finish%' ) and
    LEFT(Substring( Substring(message, CharIndex('''',message) +1 ,Len(message)) ,0, CharIndex('''',Substring(message, CharIndex('''',message) +1 ,Len(message)))),1) between 'A' and 'Z'
    order by starttime
    However,I have to build a report on the top of it showing how much time that attribute/dimension/heirarchy took to execute(Ex-How much time did YearlyReview dimension take to complete).I dont have much knowledge of T-SQL and unable to figure out how to calculate
    that on SQL or report level.
    Could someone please assist me in getting the exact query for that?
    Thanks a lot.

    I get the below output(sample 20 rows) on executing this query.Also,a start process does not necessarily follow up a finished message for the same dimension as it may have been stopped or it failed.So we need to leave it as NA in case it started but dint
    finish
    Row_Num Description starttime endtime Message
    1 PAC SC Super Type 12/13/12 16:38 12/13/12 16:38 Started processing the 'PAC SC Super Type' dimension.
    2 PAC SC Super Type 12/13/12 16:38 12/13/12 16:38 Started processing the 'PAC SC Super Type' dimension.
    3 Team Member Indicator 12/13/12 16:38 12/13/12 16:38 Started processing the 'Team Member Indicator' dimension.
    4 Team Member Indicator 12/13/12 16:38 12/13/12 16:38 Started processing the 'Team Member Indicator' dimension.
    5 PAC SC Super Type 12/13/12 16:38 12/13/12 16:38 Started reading data for the 'PAC SC Super Type' attribute.
    6 PAC SC Super Type 12/13/12 16:38 12/13/12 16:38 Started reading data for the 'PAC SC Super Type' attribute.
    7 Specialist Merger Indicator 12/13/12 16:38 12/13/12 16:38 Started reading data for the 'Specialist Merger Indicator' attribute.
    8 Specialist Merger Indicator 12/13/12 16:38 12/13/12 16:38 Started reading data for the 'Specialist Merger Indicator' attribute.
    9 YearlyReview 12/13/12 16:38 12/13/12 16:38 Started processing the 'YearlyReview' dimension.
    10 YearlyReview 12/13/12 16:38 12/13/12 16:38 Started processing the 'YearlyReview' dimension.
    11 PAC SC Repeat Caller 12/13/12 16:38 12/13/12 16:38 Started processing the 'PAC SC Repeat Caller' dimension.
    12 PAC SC Repeat Caller 12/13/12 16:38 12/13/12 16:38 Started processing the 'PAC SC Repeat Caller' dimension.
    13 Year 12/13/12 16:38 12/13/12 16:38 Started reading data for the 'Year' attribute.
    14 Year 12/13/12 16:38 12/13/12 16:38 Started reading data for the 'Year' attribute.
    15 Staffing Function 12/13/12 16:38 12/13/12 16:38 Started processing the 'Staffing Function' dimension.
    16 Staffing Function 12/13/12 16:38 12/13/12 16:38 Started processing the 'Staffing Function' dimension.
    17 PAC SC Repeat Caller 12/13/12 16:38 12/13/12 16:38 Started reading data for the 'PAC SC Repeat Caller' attribute.
    18 PAC SC Repeat Caller 12/13/12 16:38 12/13/12 16:38 Started reading data for the 'PAC SC Repeat Caller' attribute.
    19 PAC HV Cust 12/13/12 16:38 12/13/12 16:38 Started processing the 'PAC HV Cust' dimension.
    20 PAC HV Cust 12/13/12 16:38 12/13/12 16:38 Started processing the 'PAC HV Cust' dimension.

  • How to calculate the unit for RATE?

    Hey All,
    I am not sure if there is something standard for this or not.
    I am calculating the 'Rate' by using 'Value/Amount' and 'Quantity' as follows -
    Rate == Value /  Quantity
    I need to calculate the unit for the rate as below -
    Rate unit == Value unit (Currency) /  Quantity unit (Base_uom) 
    (for example -
    if value is 1000 USD and quantity is 10 TO then Rate should come out as 100 USD / TO)
    Could anyone please suggest how to calculate the unit in this case?
    Many Thanks!
    Tanu

    Hi,
    Go through the below link it may give some idea
    http://help.sap.com/saphelp_nw04/Helpdata/EN/19/1d7abc80ca4817a72009998cdeebe0/content.htm
    Regards,
    Marasa.

  • How to calculate the Current APC (Acquisition and Production Cost)

    Hi,
    Please help me how to calculate the Current APC.
    The Current APC (Acquisition and Production Cost) is a calculated value based on Previous Year Acquisition balance plus any value changes up to the time of the report.
    The Asset History Report (RAGITT_ALV01) calculates the Current APC value &
    The Current APC can also be found in the Asset Explorer (transaction code AW01N) under Country Book 10/ Posted Values tab then the line “Acquisition Value” and column “Posted values”.
    I suppose that the calculation of Current APC (Acquisition and Production Cost) is getting done in the GET statements in the report RAGITT_ALV01, but unable to find the actual logic.
    Please help me.
    Thanks in advance,
    Satish

    Hi,
    you'll find the logic in fm FI_AA_VALUES_CALCULATE
    A.

  • How to calculate the Current APC

    Hi,
    Please help me how to calculate the Current APC.
    The Current APC (Acquisition and Production Cost) is a calculated value based on Previous Year Acquisition balance plus any value changes up to the time of the report.
    The Asset History Report (RAGITT_ALV01) calculates the Current APC value &
    The Current APC can also be found in the Asset Explorer (transaction code AW01N) under Country Book 10/ Posted Values tab then the line “Acquisition Value” and column “Posted values”. 
    Thanks in advance,
    Satish

    Hi,
    I suppose that the calculation of Current APC (Acquisition and Production Cost) is getting done in the GET statements in the report RAGITT_ALV01, but unable to find the actual logic where it is being done.
    Please help me.
    Thanks in advance,
    Satish

Maybe you are looking for

  • How can i pass the one value for two bind parameters

    hi All, i have a search Query select Distinct CONSOLIDATION_SUMMARY_ID,CREATION_DATE,CREATED_BY,BATCH_ID,PROCESS_FLAG,ERROR_MESSAGE,CUSTOMER_ID,BILLING_FREQUENCY ,CONSOLIDATION_LEVEL,SOLD_TO_ORG_ID ,SHIP_TO_ORG_ID ,TRANSACTIONAL_CURR_CODE ,INVOICE_TO

  • Transforming CC #7 to CC#11

    I am using LP 7.1 and Garritan Personal Orchestra. I have followed previous forum instructions on how to transform cc#7 to cc#11 and it worked for Logic plugins/instruments. But for GPO and others, my volume pedal does not work. I can see the midi da

  • How to replicate full database in 10g

    Hi, We have 9i database but soon we will be migrating to 10gR2. I want to see are there any other options in 10g to replicate full database other than data guard. I want to use that replicated database when ever primary database is not available due

  • UCCE 7.5 Skill group expansion

    I have an issue where I want to queue to a skill group for say 5 mins and then expand it to another skill group or groups.  What is the best way to do this? My thoughts: 1) add skill group to initial queue to node with a consider if statement 2) add

  • Netweaver Sneak Preview Installation Issues

    Hi, Here is the installation logs: ERROR      2005-11-12 09:46:20 [ianxbservi.hpp:235]            CServiceHandle::Open(SAPOsCol) FSL-06002  Error 1060 (The specified service does not exist as an installed service. ) in execution of a 'OpenService' fu