Need to display grand total text in OOPS ABAP ALV report

Hi
I am using OOPS for alv display and need to display grand "total text" in any column in th eoutput display.
I know the procedure to display in ALV display. but dont have idea in OOPS. Please help.
Thanks
Amminesh.

hi,
follow this link for alv's with oop's oncept.
http://abapreports.blogspot.com/2008/06/alv-grid-display-with-oops.html
for calculating total  to the specific field.....
while creating the fieldcatalog pass the value 'X' to field do_sum of lvc_t_fcat( field catalog).
data: fcat type lvc_t_fcat.
fcat-fieldname = <field-name>.
fcat-ref_table = <ref-tablename>.
fcat-ref_field = <ref-fieldname>.
fcat-do_sum = 'X'.
regards,
Ashok

Similar Messages

  • How to get Grand Total Text in ALV GRID

    Hi Folks,
    I am able to get the SUBTOTAL TEXT .....But i need...
    How to get Grand Total Text in ALV GRID Display...
    Can any one give a Solution for this...

    Hi Surendar,
    Check out this code.. this is showing Total Text in Toal line in the very first column.
    REPORT  zsales_ord_det_1                        .
    TABLES: ztable_10.
    TYPE-POOLS: slis.
    DATA: BEGIN OF it OCCURS 0,
    srno(6) type c,
    name LIKE ztable_10-name,
    age LIKE ztable_10-age,
    END OF it.
    DATA : BEGIN OF it_temp OCCURS 0,
    name LIKE ztable_10-name,
    age LIKE ztable_10-age,
    END OF it_temp.
    DATA: i_fieldcat  TYPE slis_t_fieldcat_alv,
          wa_fieldcat TYPE  slis_fieldcat_alv.
    DATA: v_repid LIKE sy-repid,
           i_index TYPE STANDARD TABLE OF i WITH HEADER LINE,
           gs_layout TYPE slis_layout_alv,
           gd_layout TYPE slis_layout_alv,
           i_sort TYPE STANDARD TABLE OF slis_sortinfo_alv,
           wa_sort TYPE slis_sortinfo_alv.
    START-OF-SELECTION.
      v_repid = sy-repid.
      SELECT * FROM ztable_10 INTO TABLE it_temp.
      LOOP AT it_temp .
        it-srno = 'Total'.
        it-name = it_temp-name.
        it-age = it_temp-age.
        APPEND  it.
      ENDLOOP.
    END-OF-SELECTION.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
         i_program_name               = v_repid
         i_internal_tabname           = 'IT'
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
         i_inclname                   = v_repid
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
        CHANGING
          ct_fieldcat                  = i_fieldcat[]
       EXCEPTIONS
         inconsistent_interface       = 1
         program_error                = 2
         OTHERS                       = 3
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    wa_fieldcat-row_pos = 1.
    wa_fieldcat-col_pos = 1.
    wa_fieldcat-fieldname = 'SRNO'.
    wa_fieldcat-tabname = it.
    append wa_fieldcat to i_fieldcat.
      LOOP AT i_fieldcat INTO wa_fieldcat.
        IF wa_fieldcat-fieldname = 'AGE'.
          wa_fieldcat-do_sum = 'X'.
          MODIFY i_fieldcat FROM wa_fieldcat.
        ENDIF.
       IF wa_fieldcat-fieldname = 'SRNO'.
         Hide this field so that it can display it's content i.e.
            Total text in Subtotal level
        wa_fieldcat-tech = 'X'.
          wa_fieldcat-no_out = 'X'.
          MODIFY i_fieldcat FROM wa_fieldcat TRANSPORTING tech no_out.
       ENDIF.
      ENDLOOP.
    wa_sort-spos = 1.
    wa_sort-fieldname = 'SRNO'.
    wa_sort-up = 'X'.
    wa_sort-subtot = 'X'.
    APPEND wa_sort TO i_sort.
      gd_layout-no_totalline = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                       = ' '
         i_callback_program                        = v_repid
      I_CALLBACK_PF_STATUS_SET     = ' '
    i_callback_user_command                = 'USER_COMMAND'
      I_CALLBACK_TOP_OF_PAGE         = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE  = ' '
      I_CALLBACK_HTML_END_OF_LIST    = ' '
      I_STRUCTURE_NAME                       =
      I_BACKGROUND_ID                        = ' '
      I_GRID_TITLE                                  =
      I_GRID_SETTINGS                          =
         is_layout                                      = gd_layout
         it_fieldcat                                      = i_fieldcat[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
         it_sort                           = i_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
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      I_HTML_HEIGHT_TOP                 =
      I_HTML_HEIGHT_END                 =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = it
       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.
    Regards,
    Seema

  • How to get grand total text  in the last column of reuse_alv_grid_display ?

    Hi,
    Experts,
    I am able to get the subtotal text but i am not able to get the grand total text please pass some code or idea on it.
    ex:
         2510    gopi       10
         2511   gopi        20
    subtotal                 30
         2521    anand    20
         2522    anand    10
        2523     anand    50
    subtotal                 80
         2512   vikram     30
    subtotal                 30
    (blank----)              140.
    Here i want to get text as 'COMPANY TOTAL'. by using REUSE_ALV_GRID_DISPLAY FM.
    Thanks,
    Shabeer ahmed.

    Hi,
      you can get the 'COMPANY TOTAL' by using the following code:
      LOOP AT i_main INTO w_main.*   Storing the Total text need to be displayed in
      ALV
        w_final-total      = 'COMPANY TOTAL'.
        w_final-field1   = w_main-field1.
        w_final-field2    = w_main-field2.   
        w_final-field3   = w_main-field3 .  
       APPEND w_final TO i_final.  ENDLOOP.
    Regards,
      Santosh

  • Grand Total Text is not printing in ALV

    Hi all,
    I am not able to print Grand Total text in my report
    I am not doing subtotal, i am using only grand totals.
    So i have used in the following way
    WA_FIELDCAT-DO_SUM        = GC_X.
      GS_LAYOUT-TOTALS_ONLY       = GC_X.
      GS_LAYOUT-TOTALS_TEXT       = 'Totals'(049).
    i am using using ALV GRID DISPLAY FM...its displaying the total amount, buts text is missing...
    Can any one tell me what else i have to pass in the layout or fieldcatlog or FM

    Hi AMR,
    If you use REUSE_ALV_GRID_DISPLAY function module, i think Total text does not come .but if u use REUSE_ALV_LIST_DISPLAY function module Total text comes .
    Check this sample program it let u know ..
    "Types
    TYPES:
          BEGIN OF t_pa0008,
            pernr TYPE pa0008-pernr,
            lga01 TYPE pa0008-lga01,
            bet01 TYPE pa0008-bet01,
          END OF t_pa0008.
    "Work areas
    DATA:
          w_pa0008 TYPE t_pa0008.
    "Internal tables
    DATA:
          i_pa0008 TYPE STANDARD TABLE OF t_pa0008.
    PARAMETERS:
               list TYPE c RADIOBUTTON GROUP gr1,
               grid TYPE c RADIOBUTTON GROUP gr1.
    " ALV Declarations
    " Types Pools
    TYPE-POOLS:
       slis.
    " Types
    TYPES:
       t_fieldcat         TYPE slis_fieldcat_alv,
       t_events           TYPE slis_alv_event,
       t_layout           TYPE slis_layout_alv,
       t_sort             TYPE  slis_sortinfo_alv,
       t_keyinfo          TYPE slis_keyinfo_alv.
    " Workareas
    DATA:
       w_fieldcat         TYPE t_fieldcat,
       w_events           TYPE t_events,
       w_sort             TYPE t_sort,
       w_layout           TYPE t_layout,
       w_keyinfo          TYPE t_keyinfo.
    " Internal Tables
    DATA:
       i_fieldcat         TYPE STANDARD TABLE OF t_fieldcat,
       i_events           TYPE STANDARD TABLE OF t_events,
       i_sort             TYPE STANDARD TABLE OF t_sort.
    START-OF-SELECTION.
      PERFORM get_data.
    END-OF-SELECTION.
      PERFORM build_fieldcatalog.        "Fieldcatalog
      PERFORM build_events.              "Events table
      PERFORM buid_layout.               "Layout structure.
      PERFORM build_sort_tab.            "To sort table and get subtotal
      PERFORM display_data.
    *&      Form  get_data
    FORM get_data.
      DATA:l_0008 TYPE pa0008 OCCURS 0 WITH HEADER LINE.
      SELECT pernr lga01 bet01
        FROM pa0008
        INTO CORRESPONDING FIELDS OF l_0008
        WHERE begda LE sy-datum
          AND endda GE sy-datum.
        w_pa0008-pernr = l_0008-pernr.
        w_pa0008-lga01 = l_0008-lga01.
        w_pa0008-bet01 = l_0008-bet01.
        APPEND w_pa0008 TO i_pa0008.
        CLEAR  w_pa0008.
        w_pa0008-pernr = l_0008-pernr.
        w_pa0008-lga01 = l_0008-lga02.
        w_pa0008-bet01 = l_0008-bet02.
        APPEND w_pa0008 TO i_pa0008.
        CLEAR  w_pa0008.
        w_pa0008-pernr = l_0008-pernr.
        w_pa0008-lga01 = l_0008-lga03.
        w_pa0008-bet01 = l_0008-bet03.
        APPEND w_pa0008 TO i_pa0008.
        CLEAR  w_pa0008.
        w_pa0008-pernr = l_0008-pernr.
        w_pa0008-lga01 = l_0008-lga04.
        w_pa0008-bet01 = l_0008-bet04.
        APPEND w_pa0008 TO i_pa0008.
        CLEAR  w_pa0008.
      ENDSELECT.
    ENDFORM.                    "get_data
    *&      Form  build_fieldcatalog
    FORM build_fieldcatalog.
      PERFORM build_fcat USING:
                    "Field    Int.Table    Text
                     'PERNR' 'I_PA0008'   'PERNR', "Remove this if u dont want in the item table as well as it is there in the header table
                     'LGA01' 'I_PA0008'   'LGA01',
                     'BET01' 'I_PA0008'   'BET01'.
    ENDFORM.                    "build_fieldcatalog
    *&      Form  build_events
    *       text
    FORM build_events.
      CLEAR:
            w_events, i_events[].
      w_events-name = 'TOP_OF_PAGE'.
      w_events-form = 'TOP_OF_PAGE'.
      APPEND w_events TO i_events.
      CLEAR  w_events.
    ENDFORM.                    "build_events
    *&      Form  display_data
    *       text
    FORM display_data.
      DATA:
            l_program TYPE sy-repid VALUE sy-repid,
            l_fm      TYPE RS38L_FNAM.
      IF list = 'X'.
        l_fm =  'REUSE_ALV_LIST_DISPLAY'.
      ELSEIF grid ='X'.
        l_fm =  'REUSE_ALV_GRID_DISPLAY'.
      ENDIF.
      CALL FUNCTION l_fm
        EXPORTING
          i_callback_program = l_program
          is_layout          = w_layout
          it_fieldcat        = i_fieldcat
          it_events          = i_events
          it_sort            = i_sort
        TABLES
          t_outtab           = i_pa0008.
      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_data
    *&      Form  build_fcat
    FORM build_fcat  USING l_field l_tab l_text.
      w_fieldcat-fieldname = l_field.
      w_fieldcat-tabname   = l_tab.
      w_fieldcat-seltext_m = l_text.
      IF l_field = 'BET01'.
        w_fieldcat-do_sum = 'X'.
      ENDIF.
      APPEND w_fieldcat TO i_fieldcat.
      CLEAR  w_fieldcat.
    ENDFORM.                    " build_fcat
    *&      Form  top_of_page
    *       text
    FORM top_of_page.
      DATA :
      i_header TYPE slis_t_listheader,
      w_header LIKE LINE OF i_header.
      DATA:l_date1 TYPE datum,
           l_date2 TYPE datum.
      w_header-typ = 'S'.
      w_header-info = sy-title.
      APPEND w_header TO i_header.
      CLEAR w_header.
      w_header-typ = 'H'.
      w_header-info = sy-repid.
      APPEND w_header TO i_header.
      CLEAR w_header.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = i_header
          i_logo             = 'ENJOYSAP_LOGO'.
    ENDFORM.                    "top_of_page
    *&      Form  BUILD_sort_tab
    FORM build_sort_tab .
      CLEAR :i_sort[],w_sort.
      w_sort-spos      = 1.
      w_sort-fieldname = 'PERNR'.
      w_sort-tabname   = 'I_PA0008'. "header table
      w_sort-up        = 'X'.
      w_sort-subtot    = 'X'.
      APPEND w_sort TO i_sort.
      CLEAR w_sort.
    ENDFORM.                    " BUILD_sort_tab
    *&      Form  buid_layout
    FORM buid_layout .
      w_layout-totals_text = 'Total'.
      w_layout-subtotals_text = 'S.Total'.
    ENDFORM.                    " buid_layout
    Regards,
    Venkat.O

  • Display the total number of rows for the report in OBIEE 11g

    Hi, In obiee 11g, the pagination will be 1-25. Is there any possiblity in obiee to show the total rows count next to pagination. Ex: if the result contains 120 rows. it should display after the pagination
    Records 1-25. Total of Records : 120
    Is there any way we can display the total number of rows for the report.
    Kindly help me.. Its very urgent requirement.
    MAny Thank in advacne

    Check this http://obiee100.blogspot.com/2011/07/display-total-number-of-records-in.html
    and
    http://docs.oracle.com/cd/E28280_01/bi.1111/e10544/appsql.htm#CHDCDIDA
    You have to go something like as suggested in previous link.
    Mark as correct/helpful

  • 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.

  • How to display grand total only on the last page of my report

    Hello
    I need to display the grand total amount of the invoice only on the last page of every report. If the report has 1 page then the grand total will be displayed on the 1st page. If the report has 2 pages then a subtotal will be displayed on the 1st page adding up all the amounts on page 1 only, and the grand total will be displayed on the 2nd page, adding up all the amounts of page 1 and 2. If the report has 3 pages then the a subtotal will be displayed on page 1 adding up all the amounts of page 1, and another subtotal on page 2 adding up all the amounts of page 2, and the grand total are displayed on page 3 adding up the amounts of every page.
    supplier amount
    xx 100
    yy 100
    subtotal 200
    page 1 of 2 --here i need to display only the total amounts of page 1
    supplier amount
    subtotal brought forward 200 --then i need to bring total of page 1 over to page 2
    qq 300
    zz 300
    total 800 --here i have reached the end of the report and  
    need to display the grand total
    page 2 of 2
    --Currently i am displaying this on my report
    supplier amount
    xx 100
    yy 100
    total 800 --this one gives the problem cause it displays the grand total
    ---------- on page 1 of 2 even before you can see the amounts on the
    next pages
    page 1 of 2
    supplier amount
    qq 300
    zz 300
    total 800

    put the grand total in a frame and set it to print on the last page of the enclosing object.

  • How to display sub total text in ALV grid display reporting

    Hi,
    I want to display a text 'SUB TOTAL'  in Sub total  row  of an ALV report.
    Presently I am getting the name of the field used in sorting to get sub totals. But I required to display own text. Could you please give me solution.
    Thanks
    Giridhar Karnam

    For doing this u need to simply modify the layout properties, please award points if found helpful
    DATA: L_LAYOUT TYPE SLIS_LAYOUT_ALV.
    L_LAYOUT-SUBTOTALS_TEXT = 'GEN SUBTOT'.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            I_CALLBACK_PROGRAM = SY-REPID
            IS_LAYOUT          = L_LAYOUT
            IT_FIELDCAT        = IT_FIELDCAT
          TABLES
            T_OUTTAB           = IT_FINAL
          EXCEPTIONS
            PROGRAM_ERROR      = 1
            OTHERS             = 2.

  • OBIEE 11g - How to display Grand Total in graphs

    hi ,
          I am using obiee 11.1.1.6 version . In a report I have a requirement to display the grand total (present in the table) to be shown in the graph also . Kindly help.
    Regards,
    Niv

    Hi Niv,
    One quick question here.How are you creating Grand Total?
    I have created using grand total by row summing and inserting that value in the Group By Function.
    Attached the screen shot for your reference.
    GT - Download - 4shared
    Mark if helps
    Thanks,

  • Sub total text in OOPs ALV

    Hi Experts,
    I need to get the subtotal text in the ALV, for which i need to handle the event sub_total text
    I see that it is not gettting trigerred.
    thanks

    Hi,
    Use the subtotal_text event of the ALV.
    Refer to this link for examples..
    [ALV Display Subtotal Text Using OO |https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/displaysubtotaltextinALV+grid]

  • Need to Achieve Grand Total in the Data Template

    Hi Team
    As per the requirements i need to achieve the grand total form the various level of Total. To achieve the Total i have used the SUM function and it works fine. Could you please suggest me how can i achieve the Grand Total. For your reference i am attaching the data template here that i am using.
    <group name="G_ITEM" dataType="varchar2" source="Q_ITEMQuery" groupFilter="">
                        <element name="ITEM_ID" dataType="varchar2" value="item_id" function=""/>
                        <element name="DESCRIPTION" dataType="varchar2" value="description" function=""/>
                        <element name="DIVISION" dataType="varchar2" value="division" function=""/>
                        <element name="UNITS_APPTD" dataType="varchar2" value="apptd_unit_qty" function=""/>
                        <element name="UNITS_RCVD" dataType="varchar2" value="unit_rcvd" function=""/>
                        <element name="WEIGHT_APPTD" dataType="varchar2" value="apptd_weight" function=""/>
                        <element name="WEIGHT_RCVD" dataType="varchar2" value="receipt_weight" function=""/>
                        <element name="SUM_UNITS_APPTD" value="G_ITEM.UNITS_APPTD" function="SUM()"/>
                        <element name="SUM_UNITS_RCVD" value="G_ITEM.UNITS_RCVD" function="SUM()"/>
                        <element name="SUM_WEIGHT_APPTD" value="G_ITEM.WEIGHT_APPTD" function="SUM()"/>
                        <element name="SUM_WEIGHT_RCVD" value="G_ITEM.WEIGHT_RCVD" function="SUM()"/>
                        <group name="G_TROUBLE" dataType="varchar2" source="Q_TROUBLEQuery" groupFilter="">
                             <element name="T_CODE" dataType="varchar2" value="trouble_code" function=""/>
                        </group>
                   </group>
                   <group name="G_DEPOSIT" dataType="varchar2" source="Q_DEPOSITQuery" groupFilter="">
                        <element name="ITEM_ID1" dataType="varchar2" value="ITEM_ID1" function=""/>
                        <element name="DESCRIPTION1" dataType="varchar2" value="DESCRIPTION1" function=""/>
                        <element name="UNIT_QTY1" dataType="varchar2" value="Unit_Qty1" function=""/>
                        <element name="SUM_UNIT_QTY1" value="G_DEPOSIT.UNIT_QTY1" function="SUM()"/>
                   </group>
                   <group name="G_TRANSPORT" dataType="varchar2" source="Q_TRANSPORTQuery" groupFilter="">
                        <element name="ITEM_ID2" dataType="varchar2" value="ITEM_ID2" function=""/>
                        <element name="DESCRIPTION2" dataType="varchar2" value="DESCRIPTION2" function=""/>
                        <element name="UNIT_QTY2" dataType="varchar2" value="Unit_Qty2" function=""/>
                        <element name="SUM_UNIT_QTY2" value="G_TRANSPORT.UNIT_QTY2" function="SUM()"/>
                   </group>
    I need SUM_UNITS_APPTD, SUM_UNIT_QTY1 and SUM_UNIT_QTY2 of 3 different group to be added to generate the Grand Total. PLEASE ADVISE
    Regards
    Srikant

    Hi Domnic
    Thanks for the reply.
    I am not much aware of the XDO. Could you please let me know can i pass the field name in place of 2 and 3 as in your example.
    For example if i have field A and B and i need to add it then should it be
    <?xdofx:A+B?> in RTF.
    Else please give me the complete syntax.
    Thanks in advance for your reply.
    Regards
    Srikant

  • Need to display variable descriptive text in a report

    Does anyone know of a way to display the descriptive text for user entry variables in Crystal Reports? I've tried a couple of methods in the past (a subreport going against master data and building an array of text valued from the data) but each has method has some significant drawbacks. How are customers dealing with this right now? I have been encouraging them to be satisfied with the technical names, but that doesn't go over very well.

    Look like no one had any thoughts. I'll just close this one down for now.

  • Grand total (of all columns) in ALV grid

    Hi Experts,
    I have developed one custom ALV report in GRID format. Now Report output is displaying like below.
    COL1 |   COL2  |    COL3  |  COL4 |
    TYPE1  |   10   |           44  |          05 |
    TYPE2  |    01  |           20  |          35 |
    TYPE3  |   05   |          10   |         20  |
    =============================
       sum  |     16  |          74   |  50  |
    But I need Grand Total for COL2 and COL3 and COL4 (i.e 16 + 74 + 50 )
    This grand total line should be at the end of the internal table -- 140 .
    The report output should be like below.....
    COL1 |   COL2  |    COL3  |  COL4 |
    TYPE1  |   10   |           44  |          05 |
    TYPE2  |    01  |           20  |          35 |
    TYPE3  |   05   |          10   |         20  |
    =============================
       sum  |     16  |          74   |  50  |           ====> this sum will displayed when user select sum button on the Grid toolbar.
    =============================
    Grand Total   140 |
    Suppose when I press sum button on the COL2. it should not change grand total. I mean Grand total should be like footer always.
    Please advise
    Thanks in advance.
    Raghu

    Hi
    For your requirment ,you have to fill the field catalog for each field for which
    you have to create the the grand total and check the option DO_SUM.
    If you neeed the sub total ,in the sort table you can check the option- fs_sort-subtot = 'X'.
    Just try the belo code .
    It will solve your problem.
    REPORT ztest.
    * INTERNAL TABLE DECLARATION.
    DATA:
    t_sflight TYPE TABLE OF sflight,
    fs_sflight TYPE sflight.
    *OBJECTS FOR CONTAINER AND GRID.
    DATA:
    r_container1 TYPE REF TO cl_gui_custom_container,
    r_grid1 TYPE REF TO cl_gui_alv_grid.
    *FIELD CATALOG
    DATA:
    t_fcat TYPE lvc_t_fcat,
    fs_fcat TYPE lvc_s_fcat.
    fs_fcat-fieldname = 'SEATSMAX'.
    fs_fcat-do_sum = 'X'.
    APPEND fs_fcat TO t_fcat.
    CLEAR fs_fcat.
    fs_fcat-fieldname = 'PRICE'.
    fs_fcat-do_sum = 'X'.
    APPEND fs_fcat TO t_fcat.
    CLEAR fs_fcat.
    * SORT TABLE
    DATA:
    t_sort TYPE lvc_t_sort,
    fs_sort TYPE lvc_s_sort.
    * LAYOUT TABLE
    DATA:
    fs_layo TYPE lvc_s_layo.
    *FS_LAYO-SGL_CLK_HD = 'X'.
    fs_layo-zebra = 'X'.
    fs_sort-spos ='1'.
    fs_sort-fieldname = 'CARRID'.
    fs_sort-down = 'X'.
    fs_sort-group = '*'.
    *fs_sort-subtot = 'X'.
    APPEND fs_sort TO t_sort.
    SELECT * FROM sflight INTO TABLE t_sflight.
    CALL SCREEN 100.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN1'.
      SET TITLEBAR 'TITLE1'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                    "user_command_0100 INPUT
    **&      Module  HANDLER  OUTPUT
    **       text
    MODULE  header  OUTPUT.
      CREATE OBJECT r_container1
        EXPORTING
          container_name = 'CONTAINER'.
      CREATE OBJECT r_grid1
        EXPORTING
          i_parent = r_container1.
      CALL METHOD r_grid1->set_table_for_first_display
        EXPORTING
          is_layout        = fs_layo
          i_structure_name = 'SFLIGHT'
        CHANGING
          it_fieldcatalog  = t_fcat
          it_outtab        = t_sflight
          it_sort          = t_sort.
    ENDMODULE.                    "Header OUTPUT
    Regards
    Hareesh.

  • Need help with adding formatted text and images to Crystal Report?

    Here's my scenario:
    I have a customer statement that's generated as a crystal report and that has a placeholder for advertisement. The advertisement is mixture of formatted text and images. Until now we only had one advertisement that was always used on the report. The new requirement is that we would have a pool of hundreds of advertisements and would need to display one specific advertisement on the customer statement based on various marketing criteria. They key is that the advertisement content will be determined programmatically and cannot be hardcoded into the report. I'm using Crystal2008 with .net SDK.
    Here are the solutions I thought of, but I'm still rather lost and would appreciate your help/opinion.
    1) Pass HTML or RTF to the report
    Not really sure if this is possible and how to get it done. Also how would I pass in images? Would display formatting be reliable when exporting to PDF?
    2) Create each add as a subreport and append it programatically
    I actually have this working, but I only know how to append a new section to the end of the report and then load the subreport to the section. I have no other controll of the placement. Is there a way to dynamically load a subreport to a predefined section in the main report? How about adding a dummy subreport in the main report as a placeholder and then replacing it with a different subreport? How could I do this?
    3) Pass an Image to the report
    I would create each advertisement as an image and then would somehow add the image to the report. How would I load the image and control the placement? Could I somehow define a placeholder for the image in the main report-maybe a dummy image to be replaced?
    Thank you.

    Hello Pavel,
    I would got the third way.
    You can use dynamic images in your report.
    Just by changing the URL to the image the image can be changed.
    Please see the [Crystal Manual|http://help.sap.com/businessobject/product_guides/cr2008/en/xir3_cr_usergde_en.pdf] and search for images.
    or directly here
    [Setting a Dynamic Graphic Location Path on an Image Object|https://boc.sdn.sap.com/node/506]
    [Dynamic image and HTTP://|https://boc.sdn.sap.com/node/3646]
    [codesample for .NET|https://boc.sdn.sap.com/node/6000]
    Please also use
    [Crystal Reports 2008 SDK Documentation and Sample Code|https://boc.sdn.sap.com/developer/library/CR2008SDK]
    [Crystal Reports 2008 .NET SDK Tutorial Samples|https://boc.sdn.sap.com/node/6203]
    Hope this helps
    Falk

  • Displaying the total no of records in ALV ouput.

    Hi everybody,
    I am displaying the output in ALV.
    I want display the total number of records at the top of page.( before the columns).
    Can any one throw light on this plz.
    Karunakar reddy

    To get the number of entries in your displayed table use:
    <i>DESCRIBE TABLE tab LINES wg_lines.</i>
    To display the value in a ALV Grid Control, use something like this:
    <i>DATA: sl_layout   TYPE lvc_s_layo.
    sl_layout-grid_title = wl_lines.
    CALL METHOD og_alv->set_table_for_first_display
          EXPORTING
            is_layout                     = sl_layout
            ....</i>
    Regards,
    Martin

Maybe you are looking for

  • IPod 4GB nano rebooting continually under 2006-06-28

    After I updated my 4GB iPod Nano to 2006-06-28 it rebooted, showed the apple logo, lit the screen, then reboots again. I cannot turn it off and I cannot get it recognized by the 2006-01-10 updater or iTunes. Do I have any options? She's still under w

  • Mac OS X cannot Install in this computer + strange errors and problems

    Hi guys, My macbook works fine 3 weeks ago, but one day, any operation I make, result in loading, example: click in finder, click in one link on the internet, loading for everything. Then I forced down. After reboot, macbook stay in a blank blue scre

  • Calibrating my monitor wigh 10.2.8

    I have been trying to calibrate my monitor using my old coal-fired OS of 10.2.8. I go through the steps under the "Display" memu in the system profile. I get finished and save the profile under a new name. However I can not get the new profile to tak

  • Execution Time in minutes

    Hi, it´s me again with another question. The Execution Time in the test report (xml) is always displayed in seconds. How can I change this in minutes? Thanks a lot. Daniel

  • Unable to cast object of type 'Oracle.DataAccess.Types.OracleDecimal'......

    I have some Oracle Tables with sequences for primary key and stored procs in packages to wrap up the insert commands. The sequences field are all declared as NUMBER. I also have Datasets based on the tables and a DataAdapter for each package. The Dat