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

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 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 get grand total in query designer

    Hi,
       Antbody know how to get the grand total after the  last row in query designer? I
    Thanks

    Hi,
    If we select the very first Characterstic in the rows section and set the Supress result rows as "never".
    That will show the overall result in the end of the report,
    In the query properties tab ,check for display properties of the result.That should be set to bottom.
    Hope this will work.
    Thanks
    Mukesh

  • Grand total level of the percentage column giving value from the first row of column

    Hi Guys,
    I have a requirement like to show the percentage value which the calculation of two columns , in the grand total level .
    I think it can be achievaable by giving the aggregation rule for that column as Server complex Aggregate .
    eg.
    Fiscal Year  Department  subdepartment   Total cost     Sub Department cost     % cost
    2011           Edu             Books                 500              50                               10
    2011           Edu             Note Book           200            100                                50
    2011           Edu             Furniture             300             30                                 10
    2011            Edu                                      1000           180                              18
    Grand Total
    Ideally it should come like as above ..but the problem with me that ,it showing correct value for  all the rows ,but at the grand total level it's taking the value of % cost from the first row . like below..
    2011           Edu                                   1000                  180                         10
    Grand Total  
    I have calculated the % cost column in the answer itself  as (Sub Department cost /Total Cost )
    where the
    Aggregation rule for the columns given are
    Total Cost - Sum  ,Sub Dep Cost -  Sum, % Cost - Server Complex Aggregate
    So plz suggest me any Idea to achieve this ..Thanks in advance.

    Give the agg. as avg for % field.
    Best of Luck,
    Kashi

  • How to get safari to open to the last page I was on and screens to enlarge automatically?

    Hello, I just upgraded to the latest iMac version from my 2010 model, and whenever I close and open up safari it opens to top siotes instead of the last page I was on, and every time I open it I have to enlarge it myself by clicking the arrows in the top right. Same happens with everything else, like the app store. How do I change this so whenever I go to safari it opens to the last page I was on and has safari, app store, etc. have large screens right away? I set up my old iMac 3 years ago, and I guess I must've done something to have it do this, but I forgetn what I did. Thank you in advance

    Hello there, Clumn.
    The following Knowledge Base article provides some general tips for Mavericks that may address your issue:
    OS X Mavericks: General preferences
    http://support.apple.com/kb/ph13803
    Particularly of note:
    Close windows when quitting an application
    If you quit apps with windows still open on your screen, selecting this checkbox prevents the windows from reopening automatically the next time you start their app.
    This feature when not selected will allow the application to reopen windows automatically when you open the app.
    Additionally, this article provides information on how to set windows Full Screen:
    OS X Mavericks: Take apps full screen
    http://support.apple.com/kb/PH14302
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • How to get a long text into the SapScript

    Hi.
    I need to read text from header field from ME21N. I use to this READ_TEXT function module, which is called from SapScript but the problem is, that this function returns me just about 80 chars and trim rest of string.
    First idea was use loop in form, but is impossible, how to solve this problem.
    Thanks

    Problem was solved :
    INCLUDE &EKKO-EBELN& OBJECT EKKO ID F01 LANGUAGE &EKKO-SPRAS&
    Edited by: Daniel Duras on Apr 23, 2008 10:51 PM

  • How to get(select) slowest selects in the last week

    Hi,
    i had to find the slowest select statement in my dba. It's a 9i Database no Grid Control is installed :-(
    thanks
    Wolle

    Yes, if you had taken the snap(statspack), then you can take statspack report for the snap ids and find out that.
    Regards,
    Jaggym

  • Can I change the reort total: text in the summary row in a report region?

    Hi all,
    This might has been asked before, I tried searching the forum but couldn't find an answer. In the report attribute, if I tick the sum checkbox then run the page, the last row would give me the summary numbers which is what I want. However is there a way I can change the "report total" text in the last row of the first column?
    Thanks very much for your time.
    Pete

    Hello user9546327,
    I had the same problem, until I realised that the text seems to be printed under the first column of the report. If that one is a hidden column, the text won't be printed in the report.
    Solution:
    In the 'Report Attributes' tab, move the first visible column (= attribute 'Show' is ticked) to the top of the report columns.
    Best regards,
    Sabine

  • Subtotal text in the 3rd column of the alv list

    Hi Guru,
    Can anyone know or have some codes on how to implement a subtotal text in the 3rd column of the ALV list. Im using FM REUSE_ALV_HIERSEQ_LIST_DISPLAY to display the report.
    Please give some advise or help.
    Thanks and rewards is given.

    Hi my friend,
    Insted Using FM REUSE_ALV_HIERSEQ_LIST_DISPLAY
    better use REUSE_ALV_GRID_DISPLAY.
    in that 
            it_sort            = i_sort[]
      constants :     c_x       type char1 value 'X'.
        l_rec_fieldcat_wa-do_sum    = c_x.
      endif.

  • My phone has been smashed I need to get records of all my iMessages and texts from the last month. How do I get these?

    My phone has been smashed I need to get records of all my iMessages and texts from the last month. How do I get these?

    Do you have a backup of your iPhone which contains these messages?
    If so, you can restore a new iPhone from that backup during setup.
    If not, the messages are gone.

  • How user can get a Sales Text for the any Line Item in the Billing?

    Salute Masters ! !
    How user can get a Sales Text for the any Line Item in the Billing?
    It's coming for other Order (Line Item for Bought out Item at Project Site - Some Item they procure at project site & complete the task).
    Where I can configure in system for all.
    Rgds
    Srivastav
    09973504950

    Hi,
    Sales text can be copied from customer to order , order to delivery and delivery to billing .
    Check the T-code : VOTXN , do the customization as per your requirement.
    check the below link :
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/dd/55f993545a11d1a7020000e829fd11/content.htm

  • Get Grand total of the subtotals

    Hi,
    I am devoloping a report which pulls the expense lines for each project.I am displaying the fte count at each line.As it'll be same for a particular project,all the lines for that particular project will show the same FTE count.I am grouping the
    lines by Project No in Desktop edition.Now I want the total fte count which is the sum of the fte counts at each grouped level.So I cant use the total as it'll give the grand total of all the line entries.But I am not finding any option for this kind of total.(Total of the subtotals)
    Pls give me a solution ASAP

    Hi,
    I am devoloping a report which pulls the expense lines for each project.I am displaying the fte count at each line.As it'll be same for a particular project,all the lines for that particular project will show the same FTE count.I am grouping the
    lines by Project No in Desktop edition.Now I want the total fte count which is the sum of the fte counts at each grouped level.So I cant use the total as it'll give the grand total of all the line entries.But I am not finding any option for this kind of total.(Total of the subtotals)
    Pls give me a solution ASAP

  • 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

  • DATA TRANSFER - How to get a SINGLE SPACE in the downloaded file from UNIX?

    Hi Experts,
    Am sending data from SAP to UNIX/ Application server and text file on desk top as well.
    So, I am keeping a single character just SPACE at the END of each record.
    Then, When I see the downloaded text file, I found a SINGLE SPACE at the end of each record, fine.
    Then, by using CG3Y t code, I downloaded the UNIX file to my desk top.
    But, When I see this UNIX downloaded file from UNIX, I did NOT find any SPACE at the end of each record!!!
    Am doing every thing same in both cases.
    So,
    1 - Why its happening in case of UNIX file?
    2 - How to get a SINGLE SPACE  at the END in the downloaded file from UNIX?
    thanq

    Hi,
    I don't know if this works:
    perform SET_TRAIL_BLANKS(saplgrap) using 'X'.  
    perform SET_FIXLEN(saplgrap) using '0' '060'.   "put length of your line from-to
    ... download ...
    It will put space at the end of your line, according to the length.
    Hope it works,
    Chang

Maybe you are looking for

  • HDTV Resolution not supported, Desktop lost

    I connected a HDTv to my G4. The image was great but circles were ellipses. I changed the resolution several times but one lost everything on the panel. It looks like a dark curtain. Changing the sets mode to a different input and then coming back sh

  • IOS 4.2.1 messed up my TomTom Car Kit

    I have been using a TomTom Car Kit for my iPhone 4 a couple of weeks now. And it has been working great. But after updating iOS to 4.2.1 yesterday the phone keeps on giving me the following message. "This accessory is not optimized for this iPhone" "

  • IPhoto faces gone since upgrade to 9.6.1

    Hi, Something strange is happening here. Since I upgraded iPhoto to 9.6.1, the Faces feature doesn't work anymore. When I click Faces in the left sidebar (which shows all faces' names and a thumbnail), well, all the names appear but with a black squa

  • SETTLEMENT RULE FOR AN ORDER

    How will i know settlement rule for an order is created and assigned to an order type?

  • Setting Acrobat 7 as my default

    I have both Acrobat 5 & Acrobat 7 on my machine. I keep getting 5 as the default in web browsers (safari, firefox, netscape) and when opening .pdf files. How do I force everything over to 7? Note: I have a machine that boots into either OS 9.2 or 10.