ALV - Adding an additional row after subtotal

Hi Friends,
  I want to develop an ALV report wherein I want to have an additional row after the subtotal in ALV to show some calculation.
Please refer the below link for the report layout. In the ALV output after subtotaling the total operating revenue and total other income i would like to have an additional row to show the Total revenue(total operating revenue + total other income). Similarly after subtotaling the cost of sales, I would like to show the gross profit(total operating revenue - cost of sales) in an additional row. Please let me know whether this is possible in ALV Grid or List.
http://www.imagebanana.com/view/gpl4ynnk/report_layout.jpg
Regards
SAPient

Hi ,
Please go through the below link it may help you .
LInk : [Sub total text |http://wiki.sdn.sap.com/wiki/display/Snippets/DisplaysubtotaltextinALV+grid]
Regards,
Maruthi

Similar Messages

  • Webdynpro ALV - Adding an additional row

    Hi Friends,
    I want to develop an ALV report in Webdynpro ABAP as per the format mentioned in the below link. I want to have an additional row after the subtotal in ALV to show some calculation.As per the format below in the output after subtotaling the total operating revenue and total other income i would like to have an additional row to show the Total revenue(total operating revenue + total other income). Similarly after subtotaling the cost of sales, I would like to show the gross profit(total operating revenue - cost of sales) in an additional row. Please let me know whether this is possible in ALV. If so please advice me how to achieve it.
    http://www.imagebanana.com/view/gpl4ynnk/report_layout.jpg
    Regards
    SAPTechies

    Hi,
    I'm not sure but have you tried implementing the code you want after the total inside  end of page.
    There is another event called 'AFTER_LINE_OUTPUT' , try using them.
    Refer the below links for understanding how to use them.
    END-OF-PAGE
    http://help.sap.com/saphelp_470/helpdata/en/9f/dba04f35c111d1829f0000e829fbfe/content.htm
    Thanks.

  • Adding one additional row to table control of VA01

    HI all,
    I am working on free goods N:N senario which is not supported by sap standard.
    so we have decided to club all the material on the basis of material group and PSTYV = 'tann' in the table control of va01 and at the end of tann we have to display the free goods .The user exit is USEREXIT_MOVE_FIELD_TO_KOMP.
    Please help in in adding the additional row in table control of va01 (TCTRL_U_ERF_AUFTRAG).
    Even i have gone through all the thread in sdn and tried all the solution but none of the solution is working .
    plz quote solutions....
    thanks..
    Kundal.

    The user exit is USEREXIT_MOVE_FIELD_TO_KOMP
    Are you adding condition records, or adding free materials to VBAP?  If free materials to VBAP, you're in the wrong exit, I think....look for routines that allow you to add to internal table XVBAP in includes named like MV45AFZ*, and remember to set you UPDKZ to 'I'-insert if you're adding new rows.
    Not sure what you mean by not supported by SAP standard;  SAP does support free goods, via config!
    Edited by: BreakPoint on Mar 14, 2011 4:11 PM

  • Adding row after subtotal in ALV

    Hi Guys,
    can we add one row after the subtotal in ALV.
    Like the below...
    field1 field2 field3 field4
    Sub total. 120 121 125 130
    Test 150
    can you help me about the above...
    Thanks,
    Lingesh

    Hi
    If you use GROUPLEVEL_CHANGE you have to creare a form like this:
    FORM GROUPLEVEL_CHANGE
                   USING P_LINEINFO TYPE SLIS_LINEINFO
                         LS_GROUPS   TYPE KKBLO_GROUPLEVELS.
    ENDFORM.                    "GROUPLEVEL_CHANGE
    In the P_LINEINFO you have details of row and in the LS_GROUPS details of level of sorting.
    For example I used it to re-write subtotal:
    FORM GROUPLEVEL_CHANGE USING P_LINEINFO TYPE SLIS_LINEINFO
                                LS_GROUPS   TYPE KKBLO_GROUPLEVELS.
      PERFORM WRITE_SUB_TOTAL USING LS_GROUPS.
    ENDFORM.                    "GROUPLEVEL_CHANGE
    FORM WRITE_SUB_TOTAL  USING    P_GROUPS TYPE KKBLO_GROUPLEVELS.
      DATA: TOT_SALDO_A     LIKE BSID-DMBTR,
            TOT_FATTURATO_A LIKE BSID-DMBTR,
            TOT_DSO_A       LIKE BSID-DMBTR.
      DATA: WA_GROUP        TYPE KKBLO_GROUPLEVELS.
      DATA: RUN_LEVEL       TYPE I.
      DATA: BEGIN OF T_LEVEL OCCURS 1,
              LEVEL       TYPE I,
              INDEX_FROM  TYPE I,
              INDEX_TO    TYPE I,
            END   OF T_LEVEL.
      T_LEVEL-LEVEL      = P_GROUPS-LEVEL.
      T_LEVEL-INDEX_FROM = P_GROUPS-INDEX_FROM.
      T_LEVEL-INDEX_TO   = P_GROUPS-INDEX_TO.
      APPEND T_LEVEL.
    Check livel:
      CALL FUNCTION 'ALV_GROUPLEVELS_GET'
       IMPORTING
         ET_GROUPS                 = GT_GROUP
        TABLES
          T_OUTTAB                  = <FS_OUTPUT>.
      RUN_LEVEL = P_GROUPS-LEVEL + 1.
      IF RUN_LEVEL <= LEVEL.
        DO.
          LOOP AT GT_GROUP INTO WA_GROUP
                    WHERE INDEX_FROM => P_GROUPS-INDEX_FROM
                      AND INDEX_TO   <= P_GROUPS-INDEX_TO
                      AND LEVEL      = RUN_LEVEL.
            T_LEVEL-LEVEL      = RUN_LEVEL.
            T_LEVEL-INDEX_FROM = WA_GROUP-INDEX_FROM.
            T_LEVEL-INDEX_TO   = WA_GROUP-INDEX_TO.
          ENDLOOP.
          IF SY-SUBRC = 0.
            APPEND T_LEVEL.
          ENDIF.
          RUN_LEVEL = RUN_LEVEL + 1.
          IF RUN_LEVEL > LEVEL. EXIT. ENDIF.
        ENDDO.
      ENDIF.
      SORT T_LEVEL BY LEVEL DESCENDING.
      LOOP AT T_LEVEL.
        TOT_SALDO_A = TOT_FATTURATO_A = 0.
        LOOP AT <FS_OUTPUT> INTO <FS_WA_OUT>
                            FROM T_LEVEL-INDEX_FROM
                              TO   T_LEVEL-INDEX_TO.
          ASSIGN COMPONENT 'ZSALDO'
              OF STRUCTURE <FS_WA_OUT> TO <FS_SALDO>.
          ASSIGN COMPONENT 'ZFATTURATO'
              OF STRUCTURE <FS_WA_OUT> TO <FS_FATTURATO>.
          TOT_SALDO_A     = TOT_SALDO_A     + <FS_SALDO>.
          TOT_FATTURATO_A = TOT_FATTURATO_A + <FS_FATTURATO>.
        ENDLOOP.
        TOT_SALDO     = TOT_SALDO     + TOT_SALDO_A .
        TOT_FATTURATO = TOT_FATTURATO + TOT_FATTURATO_A.
        PERFORM CALCULATE_DSO USING TOT_FATTURATO_A
                                    TOT_SALDO_A TOT_DSO_A.
        PERFORM WRITE_TOT_DSO
                      USING TOT_SALDO_A
                            TOT_FATTURATO_A TOT_DSO_A
                            T_LEVEL-LEVEL T_LEVEL-INDEX_FROM.
      ENDLOOP.
    ENDFORM.                    " WRITE_SUB_TOTAL
    Max

  • How to regenerate additional rows after user clicks enter?

    Hi all,
              I am outputing the data through internal table(contains two fields 'Country' and 'Test')using ALV Classes.
    My requirement is user can add another row.And
    after appending another row user will enter country(say India) against the country
    field and clicks enter.Then the program has to fetch all the tests(say 'test1' and 'test2'  are there
    for India) described for India from the database table and refresh the screen
    with this additonal 2 rows(India, Test1 and India,Test2).
    Can anyone please let me know how to do it?Remember I am using ALV Classes.
    Thanks,
    Balaji.

    Hello Balaji
    I would use a simplified approach by storing the PBO output before displaying the editable ALV list. As soon as the user wants to save the data (enter 'SAVE' in command window) the report compares the PBO data with the current PAI data.
    To see the effect simply add a single row as previously described (resulting in three new rows) and delete two other rows. Inserted and deleted rows will be displayed afterwards.
    *& Report  ZUS_SDN_ALVGRID_EDITABLE_7
    REPORT  zus_sdn_alvgrid_editable_7.
    TYPE-POOLS: abap.
    INCLUDE <icon>.  " NOTE: replace by TYPE-POOLS: icon. on >= 6.20
    DATA:
      gd_repid         TYPE syrepid,
      gd_okcode        TYPE sy-ucomm,
      gs_layout        TYPE lvc_s_layo,
      gt_fcat          TYPE lvc_t_fcat,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_grid          TYPE REF TO cl_gui_alv_grid.
    TYPES: BEGIN OF ty_s_outtab.
    INCLUDE TYPE knb1.
    TYPES: END OF ty_s_outtab.
    TYPES: ty_t_outtab    TYPE STANDARD TABLE OF ty_s_outtab
                          WITH DEFAULT KEY.
    DATA:
      gt_outtab        TYPE ty_t_outtab,
      gt_outtab_pbo    TYPE ty_t_outtab.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          handle_data_changed
            FOR EVENT data_changed OF cl_gui_alv_grid
            IMPORTING
              er_data_changed
              e_onf4
              e_onf4_before
              e_onf4_after
              e_ucomm
              sender,
          handle_data_changed_finished
            FOR EVENT data_changed_finished OF cl_gui_alv_grid
            IMPORTING
              e_modified
              et_good_cells,
          handle_user_command
            FOR EVENT user_command OF cl_gui_alv_grid
            IMPORTING
              e_ucomm,
          handle_toolbar
            FOR EVENT toolbar OF cl_gui_alv_grid
            IMPORTING
              e_object
              e_interactive.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_data_changed.
    *   define local data
    **    cl_gui_cfw=>set_new_ok_code( 'REFRESH' ). " not possible on 4.6c
        CALL METHOD cl_gui_cfw=>set_new_ok_code
          EXPORTING
            new_code = 'REFRESH'
    *      IMPORTING
    *        RC       =
      ENDMETHOD.                    "handle_data_changed
      METHOD handle_data_changed_finished.
    *   define local data
        DATA:
          ls_outtab      TYPE ty_s_outtab,
          ls_cell        TYPE lvc_s_modi.
      ENDMETHOD.                    "handle_data_changed_finished
      METHOD handle_user_command.
      ENDMETHOD.                    "handle_user_command
      METHOD handle_toolbar.
    *   define local data
        DATA:
          ls_button    TYPE stb_button.
        ls_button-function  = 'DEFAULT'.
        ls_button-icon      = icon_mass_change.
        ls_button-quickinfo = 'Set default value for column'.
        APPEND ls_button TO e_object->mt_toolbar.
      ENDMETHOD.                    "handle_toolbar
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT * FROM knb1 INTO TABLE gt_outtab UP TO 20 ROWS
        WHERE bukrs = '1000'.
      gt_outtab_pbo = gt_outtab.  " store PBO data
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create ALV grid
      CREATE OBJECT go_grid
        EXPORTING
          i_parent          = go_docking
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Build fieldcatalog
      PERFORM build_fieldcatalog.
      PERFORM set_layout.
      SET HANDLER:
        lcl_eventhandler=>handle_toolbar               FOR go_grid,
        lcl_eventhandler=>handle_data_changed          FOR go_grid,
        lcl_eventhandler=>handle_data_changed_finished FOR go_grid.
    * Display data
      CALL METHOD go_grid->set_table_for_first_display
        EXPORTING
          is_layout       = gs_layout
        CHANGING
          it_outtab       = gt_outtab
          it_fieldcatalog = gt_fcat
        EXCEPTIONS
          OTHERS          = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      go_grid->set_toolbar_interactive( ).
      CALL METHOD go_grid->register_edit_event
        EXPORTING
          i_event_id = cl_gui_alv_grid=>mc_evt_enter
        EXCEPTIONS
          error      = 1
          OTHERS     = 2.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Link the docking container to the target dynpro
      gd_repid = syst-repid.
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = gd_repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * ok-code field = GD_OKCODE
      CALL SCREEN '0100'.
    * Flow logic (no elements on screen):
    *  PROCESS BEFORE OUTPUT.
    *    MODULE STATUS_0100.
    *  PROCESS AFTER INPUT.
    *    MODULE USER_COMMAND_0100.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.
    *  SET TITLEBAR 'xxx'.
      CALL METHOD go_grid->refresh_table_display
    *      EXPORTING
    *        IS_STABLE      =
    *        I_SOFT_REFRESH =
        EXCEPTIONS
          finished       = 1
          OTHERS         = 2.
      IF sy-subrc <> 0.
    *     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      TRANSLATE gd_okcode TO UPPER CASE.
    * Fetch changes on ALV grid
      go_grid->check_changed_data( ).
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN 'REFRESH'.
          PERFORM refresh_outtab.
        WHEN 'SAVE'.
          PERFORM save_data.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  BUILD_FIELDCATALOG_KNB1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_fieldcatalog .
    * define local data
      DATA:
        ls_fcat        TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = 'KNB1'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = gt_fcat
        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.
      " Set required fields editable
      LOOP AT gt_fcat INTO ls_fcat
                      WHERE ( fieldname = 'ZUAWA'  OR
                              fieldname = 'BUSAB' ).
        ls_fcat-edit    = abap_true.
        MODIFY gt_fcat FROM ls_fcat.
      ENDLOOP.
      DELETE gt_fcat WHERE ( fieldname = 'ZINRT' ).
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  SET_LAYOUT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM set_layout .
      CLEAR: gs_layout.
      gs_layout-cwidth_opt = abap_true.
      gs_layout-zebra      = abap_true.
    **  gs_layout-stylefname = 'CELLTAB'.
    ENDFORM.                    " SET_LAYOUT
    *&      Form  REFRESH_OUTTAB
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM refresh_outtab .
    * define local data
      DATA:
        ld_idx       TYPE i,
        ls_outtab    TYPE ty_s_outtab,
        ls_tmp       TYPE ty_s_outtab,
        lt_tmp       TYPE ty_t_outtab.
      " Simulate selection of data depending on value of ZUAWA
      ls_tmp-zuawa = '003'.
      ls_tmp-busab = 'K1'.  APPEND ls_tmp TO lt_tmp.
      ls_tmp-busab = 'K2'.  APPEND ls_tmp TO lt_tmp.
      ls_tmp-busab = 'K3'.  APPEND ls_tmp TO lt_tmp.
      LOOP AT gt_outtab INTO ls_outtab
                        WHERE ( zuawa = '003'
                        AND     busab IS INITIAL ).
        ld_idx = syst-tabix.
        LOOP AT lt_tmp INTO ls_tmp.
          ls_outtab-busab = ls_tmp-busab.
          IF ( syst-tabix = 1 ).
            MODIFY gt_outtab FROM ls_outtab INDEX ld_idx.
          ELSE.
            APPEND ls_outtab TO gt_outtab.
          ENDIF.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.                    " REFRESH_OUTTAB
    *&      Form  SAVE_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM save_data .
    * define local data
      DATA:
        ls_outtab    TYPE ty_s_outtab,
        ls_pbo       TYPE ty_s_outtab,
        lt_insert    TYPE ty_t_outtab,
        lt_delete    TYPE ty_t_outtab.
    " Compare PBO with PAI -> find deleted records
      LOOP AT gt_outtab_pbo INTO ls_pbo.
        READ TABLE gt_outtab INTO ls_outtab
             WITH KEY table_line = ls_pbo.
        IF ( syst-subrc NE 0 ).
          APPEND ls_outtab TO lt_delete.
        ENDIF.
      ENDLOOP.
    " Compare PAI with PBO data -> find new records
      LOOP AT gt_outtab INTO ls_outtab.
        READ TABLE gt_outtab_pbo INTO ls_pbo
             WITH KEY table_line = ls_outtab.
        IF ( syst-subrc NE 0 ).
          APPEND ls_outtab TO lt_insert.
        ENDIF.
      ENDLOOP.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
          i_structure_name = 'KNB1'
          i_grid_title     = 'New Records'
        TABLES
          t_outtab         = lt_insert
        EXCEPTIONS
          program_error    = 1
          OTHERS           = 2.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
          i_structure_name = 'KNB1'
          i_grid_title     = 'Deleted Records'
        TABLES
          t_outtab         = lt_delete
        EXCEPTIONS
          program_error    = 1
          OTHERS           = 2.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      gt_outtab_pbo = gt_outtab.  " do not forget !!!
    ENDFORM.                    " SAVE_DATA
    Regards
      Uwe

  • How to display a row after a subtotal field in ALV Grid

    Hi All,
    My requirement is to print a extra row with values and constant text after printing subtotal values in ALV Grid.
    e.g.      TOTAL      12.23       ---> Subtotal field
                 Tax            5.2         ---> extra row after subtotal field.
    Please help me....
    Thanks in advance.
    Regards
    Ajay

    Hi
    You can try using INSERT <WA> OR INSERT INITIAL LINE .
    fill the wa with tax value.
    INSERT  <wa> into table < internal table > 
    A row will be inserted into internal table with the values.
    Try this  and let me know.
    Thanks
    Hariharan

  • Adding new rows after displaying subtotals in an ALV report by using OOABAP

    Dear All,
    I am creating an ALV report, displaying subtotals and total by using Classes. I have used classes CL_SALV_AGGREGATIONS (Method : add_aggregation) and CL_SALV_AGGREGATIONS (Method : add_sort) for sorting and doing subtotals.
    Output of my report as follows :- (I have used * for displaying spaces between fields)
    Materia*******Quantity**SerialNo*Equipment**Value***WBS Element
    ISM-DBSVR****1********12363****31872565***2165***Q-0040358945.001010
    ISM-DBSVR****1********12364****31872566***2165***Q-0040358945.001010
    **************************************Subtotal***********4330
    -> If the value of "Quantity" is greater than 1 then the value of subtotal for the field "Value" is to be divided by the Quantity for that line item and needs to be displayed Quantity, SerialNo, Value details information after subtotal .
    -> Basically I need to add few more rows for displaying above additional information in the ALV grid after displaying subtotal .
    Q: Do we have any methods for change the layout for the above requirement.
    I Appreciate your early response.
    Thank you.
    RajaSekhar.

    Hi,
    For such type of requirement you need to use ALV hierchical table.
    You can have your main table in master table.
    For quantity greater than 1 you need to move the data into a seperate internal table....this internal table will have material as the key between the main table and the second table.
    *... §2 create an ALV hierseq table
      try.
          cl_salv_hierseq_table=>factory(
            exporting
              t_binding_level1_level2 = lt_binding
            importing
              r_hierseq               = gr_hierseq
            changing
              t_table_level1           = gt_master
              t_table_level2           = gt_slave ).
        catch cx_salv_data_error cx_salv_not_found.
      endtry.
    you can display both the tables together with the subtotals also.
    please refer to program SALV_DEMO_HIERSEQ_SIMPLE to see how to display the hierarchical display.
    Plr reward points if found helpful.
    Regards,
    Mayank

  • Insert  Blank row  After every Row  in alv report

    How to insert blank  row After every row  in Alv report

    what do you mean by a 'blank row'? ALV displays tabular data with 'any' number of columns. Now if you actually want a blank row (no columns at all, just a row), then that is just not possible. If I'm not mistaken, this question was posted before, so try to do a search on SCN. See what is says.

  • Add a row after Total row in ALV report

    Hi Experts,
    I have a report is displayed by  ALV format(not use function module to display it but use Class cl_gui_custom_container),I want to add a row after the total row. for example,
    Customer   amount1    amount2    amount3 
    10000         1,234        1,000         2,000
    10001         4,000        2,000         1,000
    10002         1,300        1,000         3,000
    11000         1,200        4,000         3,000
         Total:     7,734        8,000         9,000
    Ratio%        31.27       32.34          36.39
    the row of 'Total' is calculated by fieldcat-do_sum = 'X' But after the Total row we need a Ratio row to display the ratio. Yes we can calculate the total amout and ratio and then append it into the output itab, but we don't like this solution.We want to keep the total function in the ALV report.Any experts can poit me a direction. Thanks in advance.
    Joe

    Djoe,
    First you need to handle the user command,in order to capture the button action. For this you need to implment a class, i  am attaching sample codes here
    In top include write the following code
    CLASS lcl_event_handler DEFINITION .
      PUBLIC SECTION .
        METHODS:
         handle_toolbar  FOR EVENT toolbar                   " To add new functional buttons to the ALV toolbar
                         OF        cl_gui_alv_grid
                         IMPORTING e_object,
         handle_user_command FOR EVENT user_command          " To implement user commands
                            OF cl_gui_alv_grid
                            IMPORTING e_ucomm .
      PRIVATE SECTION.
    ENDCLASS.                                               " Lcl_event_handler DEFINITION
    Now   <b>Class implementation</b>
    CLASS lcl_event_handler IMPLEMENTATION .
      METHOD handle_toolbar.                                " Handle Toolbar
        PERFORM f9500_handle_toolbar USING e_object.
    ENDMETHOD .                                            " Handle_toolbar
      METHOD handle_user_command .                          " Handle User Command
        PERFORM f9600_handle_user_command USING e_ucomm .
      ENDMETHOD.
    ENDCLASS .                                              " lcl_event_handler IMPLEMENTATION
    FORM f9600_handle_user_command USING p_e_ucomm TYPE sy-ucomm.
      CONSTANTS:c_newl(4) TYPE c
                          VALUE 'NEWL',               " New line
                c_copy(4) TYPE c
                          VALUE 'COPY',               " Copy
                c_corr(4) TYPE c
                          VALUE 'CORR'.               " Correction
      CASE p_e_ucomm .
        WHEN c_newl.
    Create a new line
          PERFORM f9610_insert_new_line.
    ENDFORM.                                          " f9600_handle_user_command
    FORM f9610_insert_new_line .
    *Data Declarations
      DATA: lt_rows     TYPE lvc_t_row,                 " Itab for row property
            ls_rows     TYPE lvc_s_row,                 " Work area for row
            lv_cntid    TYPE i.                         " Counter
      DATA: gv_index TYPE sy-index.
      CLEAR gs_last.
      CALL METHOD gr_alvgrid->get_selected_rows
        IMPORTING
          et_index_rows = lt_rows.
      READ TABLE lt_rows INTO ls_rows INDEX 1.
      IF sy-subrc EQ 0.
        gv_index = ls_rows-index + 1.
      ELSE.
        gv_index = 1.
      ENDIF.
      DESCRIBE TABLE gt_last LINES lv_cntid.
      lv_cntid = lv_cntid + 1.
      gs_last-cntid = lv_cntid.
      INSERT gs_last INTO gt_last INDEX gv_index.
      LOOP AT gt_last INTO gs_last FROM gv_index TO gv_index.
    Make the new line editable
        PERFORM f9611_style.
      ENDLOOP.
      CALL METHOD gr_alvgrid->refresh_table_display
        EXCEPTIONS
          finished = 1
          OTHERS   = 2.
    ENDFORM.                    " f9610_insert_new_line
    You can ask questions doubts if any!
    regards
    Antony Thomas

  • Adding a New row in Workbook above Table values

    Hi,
    I have created a Workbook for which i need to add 2 additional rows manually at the top.  I added a row by deleting the Blue color line (with word 'Table').  But when i refresh the workbook, the blue color line is appearing again and the row which i added disappeared. 
    How do i make this possible?  Is there any way through which i can add the lines just above the Table values?
    Any help on this will highly be appreciated.
    Regards,
    Murali

    Hi,
    As per my view , Table name was written in the Backend with VB script hence its require change that first later you can include the Additinal rows .
    Regards,
    satya

  • How do you set the number of rows in a spreadsheet, so that even when you drag data in, in writes over those rows instead of adding a new row?

    How do you set the number of rows you want in a spreadsheet, so that even when you drag data in, in writes over those rows instead of adding a new row?

    After the discovery reported above, I filed this report :
    Bug ID# 10073038
    Summary:
    When Numbers is used on a system with decimal comma a csv file may be good AND wrong
    Steps to Reproduce:
    With Numbers v2, you introduced an interesting enhancement.
    In system using the comma as decimal separator, Numbers requires csv files using the semi-colon as values delimiter.
    In fact it’s true if we OPEN the document dragging its icon on Numbers one or thru the open dialog.
    This said.
    (1) Drag and drop a csv built with the 'semi-colon' standard on a table or on a sheet
    (2) Drag and drop a csv built with the 'comma' standard on a table or on a sheet
    Expected Results:
    Every normally constituted user assume that in
    case (1) he will get a perfectly built table
    case (2) he will get every cells of a row in a single cell
    Actual Results:
    In fact you forgot the drag and drop way of use and in
    case (1) every values separated by semi-colon are inserted in a single cell
    case (2) values separated by comma are correctly spread in a table
    isn’t it ridiculous ?
    Regression:
    Except looking in  QuickView to see which is exactly the structure of the file to decide the way we will insert it in a Numbers document, we may use an applescript fair enough to replace the semi-colons by TAB characters
    or
    to replace the commas by TABs and the decimal periods by commas
    Notes:
    While I am on this subject, I wish to make two proposals:
    (1)  It would be fine to format the date according to the ISO format year-mm-dd when you export a Numbers doc to csv.
    Doing that, dates would be imported correctly in every countries.
    At this time, on an English system, you export as mm/dd/year.
    If the doc is open on a system using the format dd/mm/year, the results will be odd.
    On a system using the format dd/mm/year, you export this way and so, if the doc is open on a system using the format mm/dd/year the results are odd too.
    As every localized versions accept the ISO format (at least on entry), using it in the export scheme would give a correct behavior everywhere.
    (2) It would be fine to add the format Tab Separated Values in the Export pane.
    TSV + ISO date format would give documents opening flawlessly everywhere.
    Yvan KOENIG (VALLAURIS, France) dimanche 4 septembre 2011 21:27:41
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • Adding an editable row in an non editable table.

    Hi,
    My requirement is to add an Editable row in a table which is in display mode only, i mean i cannot edit the data that is present in the table.
    But if the user presses the Add Row button on the Table Toolbar, a new editable row should be added in the end, so that he can save the new data entered.
    methods tried:
    1: I have used Inputfield as Cell Editors, with their Read only Property check marked, thougt that with the new element created, it would not be Read Only.
    2: Binded the read only property with a context attribute, but still was not able to achieve this functionality.
    3: Tried the above two steps with the "Enabled" property of the Table Coloumn Cell Editors as well, but no result.
    Please give me some pointers on this.
    Regards,
    Ashish

    Hi Ashish,
    The approach you were following was correct, but I am not sure where you have placed the Enabled property attribute in the context.
    Please follow these steps:
    1. The table you are creating should have the enabled property set.
    2. The context with you are binding the table should have an additional attribute say ISENABLED of type boolean.
    3. Bind this attribute with the ENABLED property of all the input enabled fields in your table.
    4. When binding the non-editable data into the table, set this property to ABAP_FALSE for each record. This will make the existing data non editable.
    5. Use the below code for adding a new row and set the ISENABLE property of the added row to ABAP_TRUE.
        elem_table = node_table->create_element( ).
        node_table->bind_element( new_item =  elem_table set_initial_elements = abap_false ).
        stru_table-isenable = abap_true .
        elem_new_row->set_static_attributes( static_attributes = stru_table ).
    Let me know how you go about it.
    Cheers,
    Pratibha

  • How to insert the new row after current row in RowIterator - Steve Muench

    Hi,
    Our client wants the new row to be added after current row on the front end instead of before current row.
    we were using "new JUActionBinding(this,iterBinding,JUActionBinding.ACTION_CREATE_INSERT_ROW);" this code inserts the new row after current row.
    I tried a lot to insert the new row after current row. Used new JUActionBinding(this,iterBinding,JUActionBinding.ACTION_LAST to move the cursor to last row in rowiterator and the used .ACTION_CREATE_INSERT_ROW but this thing inserts the new row as the second last row.
    Could somebody plesae help ?
    Message was edited by:
    user556161

    I am using JDeveloper 9.0.4.2.0 (Build 1459)

  • How to fix skewed table columns and rows after re-import XML

    My question is regarding XML Import in InDesign CS3.
    I have a XML that has a table of 5 columns and 5 rows, when I import it into InDesign, the table shows up fine with 5 columns and 5 rows. However when I revise my table to have an additional column, and re-import the XML file, the table gets updated, but instead of with an additional column, it gets 'appended' with an additional row instead (InDesign seems to blindly replace each cell from left to right, top to bottom, and ends up with 6 rows instead). The XML file specifies the number of columns and rows (5 and 5 before, 5 and 6 after), why doesn't InDesign recognize it and automatically add a new column when I re-import the file?  Is this problem fixed in CS5.5? Is there a script to fix this?
    Here is an example of my old XML vs new XML:
    Old:
    <frame5>
    <Table xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" aid:table="table" aid:trows="5" aid:tcols="5">
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1"></Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2006</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2005</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2004</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2003</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Stores at beginning of period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">846</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">805</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">753</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">678</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Stores opened during the period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">36</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">50</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">59</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">79</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Stores closed during the period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">13</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">9</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">7</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">4</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Total stores at end of period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">869</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">846</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">805</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">753</Cell>
    </Table>
    </frame5>
    New:
    <frame5>
    <Table xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/"
    xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/" aid:table="table" aid:trows="5" aid:tcols="6">
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1"></Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2007</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2006</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2005</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2004</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2003</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Stores at beginning of period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">123</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">846</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">805</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">753</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">678</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Stores opened during the period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">456</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">36</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">50</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">59</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">79</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Stores closed during the period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">789</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">13</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">9</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">7</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">4</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Total stores at end of period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">1368</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">869</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">846</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">805</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">753</Cell>
    </Table>
    </frame5>

    What I mean is, right now there is a "workaround" which requires a user to manually add an extra column before re-importing the XML (with an extra column), otherwise the results get skewed. If by providing a script we can simply ask the user to "run" it, it would be a more "acceptable" solution.  
    Right. So, one solution would be to use Convert Text to Tables. If you find that works for you, then you can script it.
    That's why I asked you...
    Of course if nothing is required from the user other than simply re-importing, then that would be the best solution.
    Well, one could imagine a script that was attached to the re-import command, or to the link update notification, but probably the first step is to get something that works reasonably well without automating it completely. Especially because triggers to run scripts silently can introduce hard-to-debug problems.
    Sure we can switch to use "CALS table and see if this works. The question is, why should we need to? In the 2nd XML there is clearly a different "aid:tcols" value, and yet InDesign seems to ignore it and assume the same # of columns? This sounds like an Indesign bug, can someone confirm? Is there any plans to fix this?
    Not to be snarky, but do you want it to work or not? There are the tools you have and the tools you wish you had, and you can't really do much with the ones you wish you had. I'm kind of assuming you are looking for a solution today, not a solution in 2013.
    Yes,  I believe two of us have confirmed this appears to be a bug.
    Plans to fix? Well, we can't really tell you. You could try asking Adobe, but that's not easy information to get out. But you can certainly open a support case at http://adobe.com/go/supportportal and ask. It's not like we have special information here...
    But you're probably better off filing a bug first, in that same fashion.
    But let's assume no one had filed the bug. CS6 is expected in the March/April 2012 timeframe. That means that they're probably just putting the finishing touches on it right now, and it's going to be very difficult to fix things in it now. So then the earliest you'd likely get it fixed in CS6.5/CS7/whatever which presumably comes out by 2Q2013, and that's assuming Adobe decides to fix it...
    I also can't find much documentation on how to update my table to a "CALS table", any examples?
    Try this thread:
    Re: Importing a CALS table into InDesign CS3

  • ALV Popup to modify row

    Hello everyone,
    I have an ALV Report (using FM, not OO). Now i need to call a popup that will have some of the fields (non-editable) of the selected row, and other input fields that can modify the referring fields of the row after pressing the 'SAVE' button.
    Is there a FM i can use, or the best way is to call a new screen? if so, how can i say that this new screen is a popup ?
        thank you in advance,
             Nuno Santos

    You should probably create your own screen.  When creating the screen, make sure to set the attribute on the attributes tab as "Modal Dialog Box", then when calling the screen, using the CALL SCREEN statement, make sure to use the STARTING and ENDING extensions of the statatement.
    call screen 100 starting at 1 1
                           ending at 50 50.
    Regards,
    Rich Heilman

Maybe you are looking for

  • In Windows 8.1, the Thunderbird window keeps resizing

    I have a new Transformer T100A laptop, running Windows 8.1 Pro. I run Thunderbird in desktop mode. The height of the Thunderbird window keeps getting small, while the width remains the same. I usually have my folder mails in the top pane, and the ope

  • Bundle dependencies problem

    Hi, I've a problem with a bundle: Import-Package: javax.jcr,version=[1.0,2) -- Cannot be resolved But in the pom file inside the bundle there's: <dependency>             <groupId>javax.jcr</groupId>             <artifactId>jcr</artifactId>           

  • Export data using SUBMIT

    I want to export a field from program1 into selct-options of another program....i recieved some reply  for this but they all  have use of export and import statement. but I have to do this only by SUBMIT statement.please suggest me for this with vey

  • CR 9.2.3.1699: Subreports first page will displayed 2 times

    Hi everbody, i have a problem with Crystal Reports 9. I have make a report with 5 subreports in his reports footer section. The subreports groups data on years. Means they show information for 2008,2009 ... and so on, on a single page. My problem is

  • I download different documents and forms to my computer and then when I try to open them I can't. I installed 'Open It', but it is not among the choices given.

    I have so much trouble opening documents etc. I can't even open the folders in my Mozilla profile like my favorites. Its a JSON file. Why does Mozilla use files that I can't open? removed email address from public as per [https://support.mozilla.org/