Subtotal in ALV grid for a particular type and Grand total in ALV

Hi,
I need to have sub total for a particular type(eg: goods, services).. and grand total at end in ALV grid..
ALV output required as below:
Type     VAT registration number     Country      Total Gross Amounts       Total Tax Amounts       Total Amount, ex-tax
Goods     ATU12345678     AT                  222.42      0         222.42
Goods     NL123456789B02     NL               3,417.00      0      3,417.00
     Goods Total                    3,639.42                -         3,639.42
Services     ATU12345678     AT               2,342.34      0      2,342.34
Services     NL123456789B02     NL                  223.33      0         223.33
     Services Total                    2,565.67                -         2,565.67
     Grand Total                    6,205.09                -         6,205.09
Let me as to how to achieve the above type in ALV grid...
Regards
Shiva

check this link..
Grand Totals in ALV grid disply function module
or do like this..
REPORT  ZALVTESTFORSUBTOTAL.
tables:pa0008.
type-pools:slis.
types:begin of ty_pa0008,
      pernr like pa0008-pernr,
      begda like pa0008-begda,
      endda like pa0008-endda,
      ansal like pa0008-ansal,
      lga01 like pa0008-lga01,
      bet01 like pa0008-bet01,
      end of ty_pa0008.
data:it_pa0008 type standard table of ty_pa0008 with header line.
data:it_fieldcat type SLIS_T_FIELDCAT_ALV,
     wa_fieldcat type slis_fieldcat_alv,
     it_layout type slis_layout_alv,
     WA_events TYPE slis_alv_event,
     it_events TYPE slis_t_event.
select-options:s_pernr for pa0008-pernr.
start-of-selection.
perform getD_data.
perform disp_alv.
*&      Form  getD_data
      text
-->  p1        text
<--  p2        text
form getD_data .
select pernr
       begda
       endda
       ansal
       lga01
       bet01
       from pa0008
       into table it_pa0008
       where pernr in s_pernr.
sort it_pa0008 by pernr begda descending.
endform.                    " getD_data
*&      Form  disp_alv
      text
-->  p1        text
<--  p2        text
form disp_alv .
wa_fieldcat-fieldname = 'PERNR'.
wa_FIELDCAT-REPTEXT_DDIC = 'Personnel no'.
*WA_FIELDCAT-no_subtotals = 'X'.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'BEGDA'.
wa_FIELDCAT-REPTEXT_DDIC = 'Start date'.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ENDDA'.
wa_FIELDCAT-REPTEXT_DDIC = 'End date'.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ANSAL'.
wa_FIELDCAT-REPTEXT_DDIC = 'Annula salary'.
wa_fieldcat-do_sum = 'X'.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'LGA01'.
wa_FIELDCAT-REPTEXT_DDIC = 'Wage Type'.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'BET01'.
wa_FIELDCAT-REPTEXT_DDIC = 'Amount for wagetype'.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
DATA: sort TYPE slis_sortinfo_alv,
it_sort TYPE slis_t_sortinfo_alv.
sort-fieldname = 'PERNR'.
sort-subtot = 'X'.
SORT-UP = 'X'.
APPEND sort TO it_sort.
*sort-fieldname = 'BEGDA'.
*SORT-NO_SUBTOTS = 'X'.
*APPEND sort TO it_sort.
IT_layout-totals_text = 'total text'.
IT_layout-subtotals_text = 'Subtotal text'.
*WA_EVENTS-NAME = 'SUBTOTAL TEXT'.
*WA_EVENTS-FORM = 'SUBTOTAL TEXT'.
*APPEND WA_EVENTS TO IT_EVENTS.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
   I_CALLBACK_PROGRAM             = sy-repid
   IS_LAYOUT                      = it_LAYOUT
   IT_FIELDCAT                    = IT_FIELDCAT
   it_sort                        = it_sort
  it_events                      = it_events
   TABLES
    t_outtab                       = it_pa0008 .
endform.                    " disp_alv

Similar Messages

  • Hotspot click for only some rows in ALV grid for a particular column ?

    Hi there,
            In ALV grid, we can make Hotspot enable for all rows in a specified column
    by specifying in the fieldcatalog with Hotspot attribute set as true.
    But I want to enable Hotspot only for certain rows in the particular column. I tried with MC_STYLE4_LINK , but I didnt got the required result.
    So , how could I achieve that in ALV grid.
    Points would be rewarded for helpful answers.
    Regards,
    Anil .

    Hi,
    You can do it for a column. Please refer to the code snippet below,
      DATA : it_fcat TYPE lvc_t_fcat,
             wa_fcat LIKE LINE OF it_fcat.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
       EXPORTING
      I_BUFFER_ACTIVE              =
         i_structure_name             = 'SMMW_ALERTS_ICON_S'
      I_CLIENT_NEVER_DISPLAY       = 'X'
      I_BYPASSING_BUFFER           =
      I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = it_fcat
       EXCEPTIONS
         inconsistent_interface       = 1
         program_error                = 2
         OTHERS                       = 3
    LOOP AT it_fcat INTO wa_fcat.
      IF wa_fcat-fieldname = 'STATUS'.
        wa_fcat-hotspot = 'X'.
        MODIFY it_fcat FROM wa_fcat.
        CLEAR wa_fcat.
      ENDIF.
    ENDLOOP.
    CALL METHOD l_obj_alv_grid->set_table_for_first_display
          EXPORTING
        i_structure_name              = 'SMMW_ALERTS_ICON_S'
       CHANGING
            it_outtab                     = lt_alerts_st
            it_fieldcatalog               = it_fcat.
    In the above replace the structure 'SMMW_ALERTS_ICON_S' with your structure and column 'STATUS' with your desired column.
    Hope this helps,
    Regards,
    Vinodh

  • Using ALV Grid for data Input

    Hi experts.
    Can someone assist me with information on using ALV grid for data input. Please give a simple example if possible.
    I am mainly interested in the part in which we can transfer data from the grid changing the internal table's data.

    Try this code:
    REPORT z_demo_alv_jg.
    TYPE-POOLS                                                          *
    TYPE-POOLS: slis.
    INTERNAL TABLES/WORK AREAS/VARIABLES                                *
    DATA: i_fieldcat TYPE slis_t_fieldcat_alv,
          i_index TYPE STANDARD TABLE OF i WITH HEADER LINE,
          w_field TYPE slis_fieldcat_alv,
          p_table LIKE dd02l-tabname,
          dy_table TYPE REF TO data,
          dy_tab TYPE REF TO data,
          dy_line TYPE REF TO data.
    FIELD-SYMBOLS                                                       *
    FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
                   <dyn_wa> TYPE ANY,
                   <dyn_field> TYPE ANY,
                   <dyn_tab_temp> TYPE STANDARD TABLE.
    SELECTION SCREEN                                                    *
    PARAMETERS: tabname(30) TYPE c,
                lines(5)  TYPE n.
    START-OF-SELECTION                                                  *
    START-OF-SELECTION.
    Storing table name
      p_table = tabname.
    Create internal table dynamically with the stucture of table name
    entered in the selection screen
      CREATE DATA dy_table TYPE STANDARD TABLE OF (p_table).
      ASSIGN dy_table->* TO <dyn_table>.
      IF sy-subrc <> 0.
        MESSAGE i000(z_zzz_ca_messages) WITH ' No table found'.
        LEAVE TO LIST-PROCESSING.
      ENDIF.
    Create workarea for the table
      CREATE DATA dy_line LIKE LINE OF <dyn_table>.
      ASSIGN dy_line->* TO <dyn_wa>.
    Create another temp. table
      CREATE DATA dy_tab TYPE STANDARD TABLE OF (p_table).
      ASSIGN dy_tab->* TO <dyn_tab_temp>.
      SORT i_fieldcat BY col_pos.
    Select data from table
      SELECT * FROM (p_table)
      INTO TABLE <dyn_table>
      UP TO lines ROWS.
      REFRESH <dyn_tab_temp>.
    Display report
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program       = sy-repid
          i_structure_name         = p_table
          i_callback_user_command  = 'USER_COMMAND'
          i_callback_pf_status_set = 'SET_PF_STATUS'
        TABLES
          t_outtab                 = <dyn_table>
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
      ENDIF.
    *&      Form  SET_PF_STATUS
          Setting custom PF-Status
         -->RT_EXTAB   Excluding table
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'Z_STANDARD'.
    ENDFORM.                    "SET_PF_STATUS
    *&      Form  user_command
          Handling custom function codes
         -->R_UCOMM      Function code value
         -->RS_SELFIELD  Info. of cursor position in ALV
    FORM user_command  USING    r_ucomm LIKE sy-ucomm
                               rs_selfield TYPE slis_selfield.
    Local data declaration
      DATA: li_tab TYPE REF TO data,
            l_line TYPE REF TO data.
    Local field-symbols
      FIELD-SYMBOLS:<l_tab> TYPE table,
                    <l_wa>  TYPE ANY.
    Create table
      CREATE DATA li_tab TYPE STANDARD TABLE OF (p_table).
      ASSIGN li_tab->* TO <l_tab>.
    Create workarea
      CREATE DATA l_line LIKE LINE OF <l_tab>.
      ASSIGN l_line->* TO <l_wa>.
      CASE r_ucomm.
      When a record is selected
        WHEN '&IC1'.
        Read the selected record
          READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX
          rs_selfield-tabindex.
          IF sy-subrc = 0.
          Store the record in an internal table
            APPEND <dyn_wa> TO <l_tab>.
          Fetch the field catalog info
            CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
              EXPORTING
                i_program_name         = 'Z_DEMO_PDF_JG'
                i_structure_name       = p_table
              CHANGING
                ct_fieldcat            = i_fieldcat
              EXCEPTIONS
                inconsistent_interface = 1
                program_error          = 2
                OTHERS                 = 3.
            IF sy-subrc = 0.
            Make all the fields input enabled except key fields*
              w_field-input = 'X'.
              MODIFY i_fieldcat FROM w_field TRANSPORTING input
              WHERE key IS INITIAL.
            ENDIF.
          Display the record for editing purpose
            CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
              EXPORTING
                i_callback_program    = sy-repid
                i_structure_name      = p_table
                it_fieldcat           = i_fieldcat
                i_screen_start_column = 10
                i_screen_start_line   = 15
                i_screen_end_column   = 200
                i_screen_end_line     = 20
              TABLES
                t_outtab              = <l_tab>
              EXCEPTIONS
                program_error         = 1
                OTHERS                = 2.
            IF sy-subrc = 0.
            Read the modified data
              READ TABLE <l_tab> INDEX 1 INTO <l_wa>.
            If the record is changed then track its index no.
            and populate it in an internal table for future
            action
              IF sy-subrc = 0 AND <dyn_wa> <> <l_wa>.
                <dyn_wa> = <l_wa>.
                i_index = rs_selfield-tabindex.
                APPEND i_index.
              ENDIF.
            ENDIF.
          ENDIF.
      When save button is pressed
        WHEN 'SAVE'.
        Sort the index table
          SORT i_index.
        Delete all duplicate records
          DELETE ADJACENT DUPLICATES FROM i_index.
          LOOP AT i_index.
          Find out the changes in the internal table
          and populate these changes in another internal table
            READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX i_index.
            IF sy-subrc = 0.
              APPEND <dyn_wa> TO <dyn_tab_temp>.
            ENDIF.
          ENDLOOP.
        Lock the table
          CALL FUNCTION 'ENQUEUE_E_TABLE'
            EXPORTING
              mode_rstable   = 'E'
              tabname        = p_table
            EXCEPTIONS
              foreign_lock   = 1
              system_failure = 2
              OTHERS         = 3.
          IF sy-subrc = 0.
          Modify the database table with these changes
            MODIFY (p_table) FROM TABLE <dyn_tab_temp>.
            REFRESH <dyn_tab_temp>.
          Unlock the table
            CALL FUNCTION 'DEQUEUE_E_TABLE'
              EXPORTING
                mode_rstable = 'E'
                tabname      = p_table.
          ENDIF.
      ENDCASE.
      rs_selfield-refresh = 'X'.
    ENDFORM.                    "user_command

  • I just bought Nikon D750. When will we get Lightroom RAW support for that particular type of camera?

    Does anyone yet know when RAW files can be dowloaded to Lightroom from Nikon D750?

    Dear all,
    Thank you for your fast reply. I´m just downloading that newest version 5.7.1 and test it with the RAW files.
    With Regards
    Eero
    dj_paige <[email protected]> kirjoitti 28.12.2014 kello 18.15:
    I just bought Nikon D750. When will we get Lightroom RAW support for that particular type of camera?
    created by dj_paige <https://forums.adobe.com/people/dj_paige> in Photoshop Lightroom - View the full discussion <https://forums.adobe.com/message/7048333#7048333>
    Lightroom supports this camera's RAW photos. Use Lightroom 5.7.1
    If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7048333#7048333 and clicking ‘Correct’ below the answer
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7048333#7048333
    To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following"
    Start a new discussion in Photoshop Lightroom by email <mailto:[email protected]> or at Adobe Community <https://forums.adobe.com/choose-container.jspa?contentType=1&containerType=14&container=33 16>
    For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624 <https://forums.adobe.com/thread/1516624>.

  • How to do subtotal and grand total as per currency in a tree ALV

    Hi Experts,
    I am doing a tree ALV for SD output. I met an urgent problem that is how to do subtotal and grand total on the field (netwr) as per currency (waerk) in the tree ALV. I am using below codes to create the tree ALV.
        l_tree_container_name = 'CCONTAINER1'.
        CREATE OBJECT objCustomContainer
            EXPORTING
                  container_name = l_tree_container_name
            EXCEPTIONS
                  cntl_error                  = 1
                  cntl_system_error      = 2
                  create_error               = 3
                  lifetime_error              = 4
                  lifetime_dynpro_dynpro_link = 5.
    create tree control
        CREATE OBJECT objTree1
          EXPORTING
              parent              = objCustomContainer
              node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
              item_selection      = ' '
              no_html_header      = 'X'
              no_toolbar          = ''
          EXCEPTIONS
              cntl_error                   = 1
              cntl_system_error       = 2
              create_error                = 3
              lifetime_error               = 4
              illegal_node_selection_mode  = 5
              failed                       = 6
              illegal_column_name          = 7.
        DATA l_hierarchy_header TYPE treev_hhdr.
        call method buildHierarchyHeader
          IMPORTING
            p_hierarchy_header = l_hierarchy_header.
    Build fieldcatalog
        call method buildFieldcatalog.
        CALL METHOD objTree1->set_table_for_first_display
            EXPORTING
              is_hierarchy_header = l_hierarchy_header
            CHANGING
              it_fieldcatalog     = l_fieldcatalog
              it_outtab            = lt_order.             
        CALL METHOD objTree1->update_calculations.
        CALL METHOD objTree1->frontend_update.
    filling fieldcatalog,
          LS_FIELDCATALOG-FIELDNAME = 'NETWR'.
          LS_FIELDCATALOG-SCRTEXT_S = 'Net Value'.
          LS_FIELDCATALOG-COL_POS = l_pos.
          LS_FIELDCATALOG-OUTPUTLEN = 15.
          LS_fieldcatalog-do_dum= 'X'.
          LS_FIELDCATALOG-DATATYPE = 'CURR'.
          APPEND LS_FIELDCATALOG TO l_FIELDCATALOG.
          CLEAR LS_FIELDCATALOG.
          l_pos = l_pos + 1.
    I could see the subtotal and grandtotal in tree ALV but they are simply sumed up  regardless different currency.
    Thank you very much for your kindly helps.
    Yu

    hi
    good
    go through this report and work accordingly.
    REPORT ZALV.
    TYPE-POOLS: SLIS.
    DATA: G_REPID LIKE SY-REPID,
    GS_PRINT            TYPE SLIS_PRINT_ALV,
    GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
    GT_EVENTS           TYPE SLIS_T_EVENT,
    GT_SORT             TYPE SLIS_T_SORTINFO_ALV,
    GS_LAYOUT           TYPE SLIS_LAYOUT_ALV,
    GT_FIELDCAT         TYPE SLIS_T_FIELDCAT_ALV,
    FIELDCAT_LN LIKE LINE OF GT_FIELDCAT,
    COL_POS TYPE I.
    DATA: BEGIN OF ITAB,
      FIELD1(5) TYPE C,
      FIELD2(5) TYPE C,
      FIELD3(5) TYPE P DECIMALS 2,
    END OF ITAB.
    DATA: BEGIN OF ITAB1 OCCURS 0.
      INCLUDE STRUCTURE ITAB.
    DATA: END OF ITAB1.
    DATA: BEGIN OF ITAB_FIELDCAT OCCURS 0.
      INCLUDE STRUCTURE ITAB.
    DATA: END OF ITAB_FIELDCAT.
    Print Parameters
    PARAMETERS:
                P_PRINT  AS CHECKBOX DEFAULT ' ', "PRINT IMMEDIATE
                P_NOSINF AS CHECKBOX DEFAULT 'X', "NO SELECTION INFO
                P_NOCOVE AS CHECKBOX DEFAULT ' ', "NO COVER PAGE
                P_NONEWP AS CHECKBOX DEFAULT ' ', "NO NEW PAGE
                P_NOLINF AS CHECKBOX DEFAULT 'X', "NO PRINT LIST INFO
                P_RESERV TYPE I.                  "NO OF FOOTER LINE
    INITIALIZATION.
    G_REPID = SY-REPID.
    PERFORM PRINT_BUILD    USING GS_PRINT.      "Print PARAMETERS
    START-OF-SELECTION.
    TEST DATA
    MOVE 'TEST1' TO ITAB1-FIELD1.
    MOVE 'TEST1' TO ITAB1-FIELD2.
    MOVE '10.00' TO ITAB1-FIELD3.
    APPEND ITAB1.
    MOVE 'TEST2' TO ITAB1-FIELD1.
    MOVE 'TEST2' TO ITAB1-FIELD2.
    MOVE '20.00' TO ITAB1-FIELD3.
    APPEND ITAB1.
    DO 50 TIMES.
      APPEND ITAB1.
    ENDDO.
    END-OF-SELECTION.
    PERFORM BUILD.
    PERFORM EVENTTAB_BUILD CHANGING GT_EVENTS.
    PERFORM COMMENT_BUILD  CHANGING GT_LIST_TOP_OF_PAGE.
    PERFORM CALL_ALV.
    FORM BUILD.
    DATA FIELD CATALOG
    Explain Field Description to ALV
    DATA: FIELDCAT_IN TYPE SLIS_FIELDCAT_ALV.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME = 'FIELD1'.
    FIELDCAT_LN-TABNAME   = 'ITAB1'.
    *FIELDCAT_LN-NO_OUT    = 'X'.  "FIELD NOT DISPLAY, CHOOSE FROM LAYOUT
    FIELDCAT_LN-KEY       = ' '.   "SUBTOTAL KEY
    FIELDCAT_LN-NO_OUT    = ' '.
    FIELDCAT_LN-SELTEXT_L = 'HEAD1'.
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME = 'FIELD2'.
    FIELDCAT_LN-TABNAME   = 'ITAB1'.
    FIELDCAT_LN-NO_OUT    = 'X'.
    FIELDCAT_LN-SELTEXT_L = 'HEAD2'.
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME     = 'FIELD3'.
    FIELDCAT_LN-TABNAME       = 'ITAB1'.
    FIELDCAT_LN-REF_FIELDNAME = 'MENGE'. "<- REF FIELD IN THE DICTIONNARY
    FIELDCAT_LN-REF_TABNAME   = 'MSEG'.  "<- REF TABLE IN THE DICTIONNARY
    FIELDCAT_LN-NO_OUT        = ' '.
    FIELDCAT_LN-DO_SUM        = 'X'.   "SUM UPON DISPLAY
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    DATA SORTING AND SUBTOTAL
    DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD1'.
    GS_SORT-SPOS      = 1.
    GS_SORT-UP        = 'X'.
    GS_SORT-SUBTOT    = 'X'.
    APPEND GS_SORT TO GT_SORT.
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD2'.
    GS_SORT-SPOS      = 2.
    GS_SORT-UP        = 'X'.
    *GS_SORT-SUBTOT    = 'X'.
    APPEND GS_SORT TO GT_SORT.
    ENDFORM.
    FORM CALL_ALV.
    ABAP List Viewer
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = G_REPID
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    I_STRUCTURE_NAME = 'ITAB1'
    IS_LAYOUT =  GS_LAYOUT
    IT_FIELDCAT = GT_FIELDCAT[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
      IT_SORT = GT_SORT[]
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
      IT_EVENTS = GT_EVENTS[]
    IT_EVENT_EXIT =
      IS_PRINT = GS_PRINT
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    T_OUTTAB = ITAB1
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    ENDFORM.
    HEADER FORM
    FORM EVENTTAB_BUILD CHANGING LT_EVENTS TYPE SLIS_T_EVENT.
    CONSTANTS:
    GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
    *GC_FORMNAME_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE'.
      DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                I_LIST_TYPE = 0
           IMPORTING
                ET_EVENTS   = LT_EVENTS.
      READ TABLE LT_EVENTS WITH KEY NAME =  SLIS_EV_TOP_OF_PAGE
                               INTO LS_EVENT.
      IF SY-SUBRC = 0.
        MOVE GC_FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.
        APPEND LS_EVENT TO LT_EVENTS.
      ENDIF.
    define END_OF_PAGE event
    READ TABLE LT_EVENTS WITH KEY NAME =  SLIS_EV_END_OF_PAGE
                             INTO LS_EVENT.
    IF SY-SUBRC = 0.
      MOVE GC_FORMNAME_END_OF_PAGE TO LS_EVENT-FORM.
      APPEND LS_EVENT TO LT_EVENTS.
    ENDIF.
    ENDFORM.
    FORM COMMENT_BUILD CHANGING GT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
      DATA: GS_LINE TYPE SLIS_LISTHEADER.
      CLEAR GS_LINE.
      GS_LINE-TYP  = 'H'.
      GS_LINE-INFO = 'HEADER 1'.
      APPEND GS_LINE TO GT_TOP_OF_PAGE.
      CLEAR GS_LINE.
      GS_LINE-TYP  = 'S'.
      GS_LINE-KEY  = 'STATUS 1'.
      GS_LINE-INFO = 'INFO 1'.
      APPEND GS_LINE TO GT_TOP_OF_PAGE.
      GS_LINE-KEY  = 'STATUS 2'.
      GS_LINE-INFO = 'INFO 2'.
      APPEND GS_LINE TO GT_TOP_OF_PAGE.
    CLEAR GS_LINE.
    GS_LINE-TYP  = 'A'.
    GS_LINE-INFO = 'ACTION'.
    APPEND GS_LINE TO  GT_TOP_OF_PAGE.
    ENDFORM.
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
      WRITE: SY-DATUM, 'Page No', SY-PAGNO LEFT-JUSTIFIED.
    ENDFORM.
    FORM END_OF_PAGE.
      WRITE at (sy-linsz) sy-pagno CENTERED.
    ENDFORM.
    PRINT SETTINGS
    FORM PRINT_BUILD USING LS_PRINT TYPE SLIS_PRINT_ALV.
      LS_PRINT-PRINT              = P_PRINT.  "PRINT IMMEDIATE
      LS_PRINT-NO_PRINT_SELINFOS  = P_NOSINF. "NO SELECTION INFO
      LS_PRINT-NO_COVERPAGE       = P_NOCOVE. "NO COVER PAGE
      LS_PRINT-NO_NEW_PAGE        = P_NONEWP.
      LS_PRINT-NO_PRINT_LISTINFOS = P_NOLINF. "NO PRINT LIST INFO
      LS_PRINT-RESERVE_LINES      = P_RESERV.
    ENDFORM.
    thanks
    mrutyun^

  • Subtotal and grand total for two fields(iseg-buchm and iseg-erfmg)

    hi experts,
        how to do subtotal and grand total for two fields (iseg-buchm and iseg-erfmg).please help me on solving the problem.

    subtotal & grand total can be done in folowing way in ALV.
    1.Pass it_sort parametere to REUSE_ALV_GRID_DISPLAY
    2.Give the field name for sorting in it_sort-fieldname. it can be any field name  u want to sort ur data with.
    3.For iseg-buchm & iseg-erfmg mark do_sum = 'X'. in fieldcat
      gs_sort-spos = 1.
      gs_sort-fieldname = 'ANY FIELD NAME'.
      gs_sort-up = 'X'.
      gs_sort-subtot = 'X'.
      APPEND gs_sort TO et_sort.
      IF iv_fieldname = 'BUCHM'
      OR iv_fieldname = 'ERFMG'.
        gs_fieldcat-do_sum = 'X'.
      ENDIF.
      APPEND gs_fieldcat TO gt_fieldcat.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
           is_variant              = ev_variant
          it_fieldcat             = gt_fieldcat[]

  • Sap notes for 103 movement type and 105 movement types in sap

    Hi all,
    Please let me know if there are any sap notes for 103 movement type and 105 movement type in sap as soon as possible
    points will be awarded.
    thanking u in advance,
    srinivas.

    There are many SAP notes related to these movement types e.g 514609,750836,
    533833, 808029, 317823,etc.
    You can search them at http://service.sap.com
    Regards,
    Amit

  • Need working days for a particular month and year

    Hi,
    I need the number of working days for a particular month and year.Saturdays and Sundays are holidays.
    Regards,
    Vignesh

    Try this:
    SQL> var yr NUMBER;
    SQL> exec :yr := 2010;
    PL/SQL procedure successfully completed.
    SQL> with t as (select :yr yr from dual)
      2  SELECT TO_CHAR(dat,'MON-RR'),COUNT(*) FROM
      3  (select TO_DATE('01-JAN-'||yr) + lv dat FROM
      4  (select level - 1 lv,yr from t
      5  connect by level <= TO_DATE('31-DEC-'||yr) - TO_DATE('01-JAN-'||yr) + 1))
      6  WHERE TO_CHAR(Dat,'DY') NOT IN ('SAT','SUN')
      7  GROUP BY TO_CHAR(dat,'MON-RR');
    TO_CHAR(DAT,   COUNT(*)
    APR-10               22
    AUG-10               22
    DEC-10               23
    FEB-10               20
    JAN-10               21
    JUL-10               22
    JUN-10               22
    MAR-10               23
    MAY-10               21
    NOV-10               22
    OCT-10               21
    TO_CHAR(DAT,   COUNT(*)
    SEP-10               22
    12 rows selected.
    SQL> Edited by: AP on Jul 27, 2010 7:54 AM

  • Can we get subtotal and grand total by own calculation in a hierarchy ALV?

    Can we get subtotal and grand total by own calculation in a hierarchy ALV? I can get them by setting DO_SUM = 'X' by standard summation, but now I need to do my own summation on subtotal and total, can I?

    Can we get subtotal and grand total by own calculation in a hierarchy ALV? I can get them by setting DO_SUM = 'X' by standard summation, but now I need to do my own summation on subtotal and total, can I?

  • Resources for designing data types and message types

    Hi
    I wanted to know if anyone can recommend me some good resources which can explain the design considerations for designing data types and message types in XI which can help promote reusability.
    Thanks.
    Best Regards,
    Kiran

    hi,
    there no rare rule whe you define your data type, why i tell you this, because you define a data type since the documentation that sender sistem team gives to you. so you only have to copy this structure to PI.
    now about Message Type less problems, because, you a Data type is assign to a Message Type, whats it means.
    when you define a DATA type you are defining the structure of you XML, que you assing the data type to a message type this structure pass to be an xml document.
    Thanks you
    Rodrigo

  • Currency wise grand totals IN ALV

    Hi friends,
    I  have problem  in alv report, my requirement is want to display the
    currency wise grand totals in ALV Report.if any having this idea please
    address the solution.
    yours
    ramakrishna.Y

    if i am not wrong then ithink you are talking about subtotal as per currency .
    then you have to use sort fnality..
    you have to write your fieldcat for currency value field
    wfieldcat-do_sum = 'X'.
    data : isort type slis_t_sortinfo_alv,
             wsort type slis_sortinfo_alv.
    wsort-spos = 1.
    wsort-up = 'X'.
    wsort-fieldname = ' YOUR CURRency key field in caps'.
    wsort-group = 'UL'.
    append wsort to isort.
    you have to pass that to reuse alv fm it_sort = isort.
    regards
    shiba dutta

  • Remove Grand total in ALV

    Hi Gurus,
    In my ALV output,
    I have used subtotals.
    i.e i have sorted  PO Number.
    and with respect to that i am calculating sub total to Amount field
    Now the code works perfectly and subtotal of the amount displayed for each PO Number.
    But along with that a GRAND TOTAL is displayed at the end of the ALV List.
    I dont want the grand total and need to remove it.
    How to remove the grand total.
    Kindly help on this.
    Thanks
    deepan M

    Hi deepan adhi ,
    Do not check the option DO_SUM in the catalog.
      DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
                 LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    *Amount
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-TABNAME       = 'IT_DATA'.
      LS_FIELDCAT-FIELDNAME     = 'BETRH'.
      LS_FIELDCAT-SELTEXT_L     =  'Amount.
      LS_FIELDCAT-JUST                =  'R'.
    LS_FIELDCAT-DO_SUM          =  'X'.*
      APPEND LS_FIELDCAT TO LT_FIELDCAT.
    Hope this information is help to you.
    Regards,
    José

  • Sub total wise Grand total in ALV report

    Dear All,
    I am displaying a list of material through material group wise so for each material i want to display sub-total for stock and grand total of stock(material group wise).Here it is adding up all the stock displayed for different AUOM(alternative unit of measure ) which is for same material so i want to pick only the sub-total and sum up in my Grand total.
    How to pick only the Sub-total Results and Add in ALV List for Grand total.
    Thanks & Regards,
    Arun.
    Edited by: Arun Kumaran on Sep 24, 2008 7:46 AM

    Hi arun,
    check these links
    total and subtotal in alv
    ALV SUBTOTAL
    Regards,
    Anirban

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

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

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

  • Like SM30 ,table should be display in editable ALV Grid(for Dynamic DB )

    Hi Friends,
    plese help me how to display  ALV grid in editable mode for differnt types of data base tables.
    same as like SM30 transaction.
    Moderator message: please search for available information/documentation/previous discussions before asking.
    Edited by: Thomas Zloch on Nov 11, 2010 6:40 PM

    Hi,
    In SLIS_T_FIELDCAT_ALV you specify the field as edit = X.
    Give it as mentioned, where you assign fieldname and positions etc.
    Thanks&Regards

Maybe you are looking for

  • Problem in output file generation in AL11 tcode

    Hi experts,                  I am doing one proxy to file scenario.file to be generated as a fixed length format .when i run the scenario, i am getting all the values in output payload correctly in Sxmb_moni and file is also created.But when i scroll

  • Sql server 2014 developer edition error on setup.exe

    i downloaded the file from the MS Australia store > mount the disc image file > run the setup.exe and get above 2 errors. searching through forums i couldnt resolve as their were similar but not the exact problem. how to resolve this?

  • Issue with " " in file when using file adapter

    Hi, Iam using FIle adapter to load the data from file to a table. Every thing is working fine, but when ever the record in the file has " " in the data it fails. Eg: 12|"LOG" logo|Y I am using file adapter with delimiter | and empty in enclosed by. W

  • Best way to get amount of memory available?

    What is the best option currently to get the amount of memory available (programatically)??  I'm using LV 2011 & 2014. Back in 2013, I got a VI from "jtagg" here, and that's what I've been using since then, but I'm not sure it's reporting what I need

  • How to dispaly day 10-nov-06 in selection screen

    data: begin of itab occurs 0, SPRAS type SPRAS, MNR LIKE T247-MNR, KTX LIKE T247-KTX, LTX LIKE T247-LTX, end of itab. DATA : month LIKE T247-MNR. DATA: YEAR(4). DATA: FINAL(18). DATA: DAY(2). DAY = sy-datum+6(2). MONTH = sy-datum+4(2). YEAR = sy-datu