ALV - Editing a Row after Sorting  - REAL HEADACHE.....

Hi,
I have a ALV table with a DropDown in one of the columns. The user can enter a value in the dropdown boxes.
Now the proble is, lets say I have SORTED the table by another column. Now the user enters a value in one of the rows of the dropdown and clicks the SAVE Button.
How do i find out, which Row the User Has entered the value ?
I tried using the table it_modified_cells in the event handler for ON_DATA_CHECK . However it gives wrong row indexes, that is if, the row number '10' is Row number '1', after sorting, and if this row is modified, then it_modified_cells table gives Row '1' as modified rather than Row '10'.
So ina  nut shell, after sorting , if a row is edited, How to find out which is this row...... ?

Nithya,
Look at this thread of mine....
Re: ALV - Lead Selection of Node When FILTERS ACTIVE
I had this issue when after filtering in ALV Table, th e bound Node wtill held original records......
So is it something likeSORTING Updates the context,,,,,FILTERING does not ?
Thanks
Anand

Similar Messages

  • Selecting top row after sorting

    hi,
    i have a table emp, whose primary key is empid(varchar2),
    i want to sort the empid and select the top row after sorting,
    i can sort the table using "select * from emp order by empid desc,
    i can select the top row using "select * from emp where rownum=1"
    i want a combination of the 2,
    pls provide me the required query
    Thanks and Regards,
    Saurabh Jhunjhunwala

    SEELCT *
       FROM ( SELECT e.*
                               , ROWNUM  row_num
                       FROM emp e
                     ORDER BY empid desc
    WHERE row_num =  1Regards
    Arun

  • CheckBox Item Renderer checks wrong grid row after sorting

    I have an advanced Data Grid that has a checkBox ItemRenderer. The underlying object being displayed (Server) in the dataGrid is being bound to the checkBox with a selectedForDeployment:Boolean property.
    I had this working just fine until the datagrid is sorted. After the grid is sorted I can click on the checkBox in row 2 and the checkBox in row 8 will be selected for instance. Or in some cases all checkBoxes will become checked. Also, if I have some already checked and then sort, the checkBox will become unchecked.
    I have an example of my itemRender below. Any idea on how I can get this to work:
    public class CheckBoxRenderer extends CheckBox
            override public function set data(value:Object):void {
                if(value){
                    super.data = value;
                    Server(super.data).addEventListener("setSelectionChanged", valueChange);
                    this.selected = value.selectedForDeployment;
            public function CheckBoxRenderer(){
                focusEnabled = false;
                BindingUtils.bindSetter(selectionChange, this, "selected");
            //this method occurs the checkbox is clicked
            public function selectionChange(value:Boolean):void{
                trace(value);
                this.selected = value;
                if(this.data){
                    this.data.selectedForDeployment = value;
            //This method occurs when the selectedForDeployment boolean in the object changes
            public function valueChange(event:Event):void{
                this.selected = event.target.selectedForDeployment;
            /* center the checkbox if we're in a datagrid */
            override protected function updateDisplayList(w:Number, h:Number):void
                super.updateDisplayList(w, h);
                if (listData is DataGridListData)
                    var n:int = numChildren;
                    for (var i:int = 0; i < n; i++)
                        var c:DisplayObject = getChildAt(i);
                        if (!(c is TextField))
                            c.x = (w - c.width) / 2;
                            c.y = (h - c.height) / 2;

    This usually works for me:
    package renderers
        import flash.events.Event;   
        import mx.controls.CheckBox;
        public class CheckBoxRenderer extends CheckBox
            public function CheckBoxRenderer()
                super();
                addEventListener(Event.CHANGE, handleChange);
            override public function set data(value:Object):void {
                if(value){
                    super.data = value;
                    selected = value.selectedForDeployment;
            private function handleChange(event:Event):void{
                data.selectedForDeployment = event.target.selected;

  • Showing selected row after sorting

    I have big JTable with lots of columns. Selection of row is highlighted
    using some background color. Sorting is also provided on TableHeader.
    After selecting some row, when user does the sorting, this selected row
    goes outof visible view of table.
    My requirement is to show the same selected row again after doing sorting. I was thinking of calling method like setSelectedRow(), but
    unfortunately there is nothing like this method.
    I was also thinking of using AccessibleJTable, but couldnt go
    anywhere.
    Is there any way to do this?
    Thanks in advance.
    Anup

    I have big JTable with lots of columns. Selection of row is highlighted
    using some background color. Sorting is also provided on TableHeader.
    After selecting some row, when user does the sorting, this selected row
    goes outof visible view of table.
    My requirement is to show the same selected row again after doing sorting. I was thinking of calling method like setSelectedRow(), but
    unfortunately there is nothing like this method.
    I was also thinking of using AccessibleJTable, but couldnt go
    anywhere.
    Is there any way to do this?
    Thanks in advance.
    Anup

  • Field should not display in the subtotal row in ALV report after sorting .

    we have a requirement, after sorting and subtotaling, the output in ALV is -
    vbeln        amount1  amount2  amount3
    123           11              12            13
    123           12             13             14
    123           23             25             27 
    133           11              12            13
    133           12             13             14
    133           23             25             27
    Now the customer wants the ALV outpput in this fashion -
    123           11              12            13
    123           12             13             14
                     23             25             27    --->123 (vbeln) should not come in subtotaling row
    133           11              12            13
    133           12             13             14
                      23             25             27--->133(vbeln) should not come in subtotaling row

    Hi,
    if it helps you could create a hierachy. In this way you can define the field catalog for the lines and for the subtotal columns. The only thing is that you would always show the subtotal rows.
    You have references of hierachy alvs in
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c060fcb4-2c62-2b10-d2b2-f32407a5cc6f
    ALV Hierarchy
    alv hierarchy
    In this case it also sorts
    Sorting for ALV hierarchy
    I hope it helps.
    Edited by: Oscar Pecharroman on Aug 2, 2010 1:13 PM

  • 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

  • Row selection messed up after sorting

    JDev version: 11.1.1.4 (but also reproducable in 11.1.2.1)
    See http://kpdwiki.be/Bart_L/tableIteratorSortSync.zip (open BO726.jws and run runThis.jspx)
    Situation:
    - iterator 'EmployeesIterator' which points to a view with Employees -> ChangeEventPolicy='none'
    - Bindings which all point to this iterator:
    - Tree binding 'Employees' used for an af:table with employees (firstname, lastname)
    - Attribute bindings 'FirstName' and 'LastName' which is used in a formLayout to show the currently selected employee
    - Operation Bindings to iterate through the employees (First, Previous, Next, Last)
    - runThis.jspx
    - formlayout with FirstName and LastName
    -> partialtriggers: Next-button and table (for the rest, no partialtriggers)
    - Next-button
    - table with employees
    Problem:
    1) if you select one of the employees in the table, and sort one of the columns, the first row will be selected. This is normal behaviour
    2)
    a) select the first row
    b) press the 'Next' button a few times. Now the selected employee in the iterator is 'X'
    c) in the table, select employee 'X' by clicking on its row
    d) sort one of the columns.
    Result: In the iterator, the first row of the table is selected, while the table selection shows something different!
    --> this is different behavior than the situation described in 1)
    --> after doing something with the table (sorting, filtering, selecting rows, ...), I would expect that the selected row in the table is always the same as the selected row in the iterator.
    Questions:
    1) Is this a bug?
    2) If yes, is this a known bug?
    3) If no: am I doing something which is not allowed? Or should I do something different here?

    I can reproduce the problem in 11.1.1.4.
    First employee is Steven King, which is selected. I then press next a few times till the output text reads Bruce Ernst (the table selection is still on Steven King, while the iterator points to Bruce Ernst). I then click on Bruce Ernst in the table, so it is selected (iterator stays on the same record). If I then sort the table, the table selection stays on Bruce Ernst, while the output text shows the first record in the table after the sort.
    We have the same issue using a non-modal popup to edit table rows (non-isolated task flow, sharing data controls & transaction). Our edit popup has navigation controls. When we scroll through records in the popup, the table selection doesnt refresh (changeEventPolicy = none). If we then select the record in the table that we scrolled to in the popup , without closing the popup, and then sort the table (with the popup still open), the selection stays on the previously selected record, whille the popup shows the first record in the table after the sort.

  • 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

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

  • How To Edit Selected Row In ALV Table

    Hello Experts,
    In My Webdynpro Application, I am displaying records from database table into an ALV Table.
    I want to edit only selected record from  ALV table.
    Please Suggest How to achieve this.
    Thanks,
    Pratibha

    The link given above is for the UI element 'Table' and does not pertain to ALV.
    To Make an ALV Editable on lead selection for that particular lead selected row.
    1. The ALV should be made lead selectable, when initializing
    2. The ON_LEAD_SELECT function should be invoked.
    3. Withing this function the index has to be retrieved to know which row was selected.
    4. Based on the index retrived all the columns have to pass FALSE to read_only in the column properties.
    Regards,
    Pramod

  • 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

  • Row doesn't get selected after sorting

    I have a table bond to a javabean data control. I have enabled multi row selection. I get some rows on the table and then I select one of those rows, after that I use the value of the selected row for some operations.
    I have 3 columns, first name, lastname , email. The first 2 are sortable. If I click on the header of firstname, the information gets sorted ok (asc / desc). The problem is that after sorting, I can NOT select any rows. When I click on the row, it doesn't get highlighted, and If I try to use the value of the selected row I get a null pointer exception.
    Again this is happening only after sorting. If I don't sort, it works ok.
    I'm using JDEV + ADF 11.1.1.5.
    This is my code
    <af:table value="#{bindings.User1.collectionModel}" var="row" partialTriggers="::cb1"
    rows="#{bindings.User1.rangeSize}"
    emptyText="#{bindings.User1.viewable ? identityBundle.no_data_to_display : identityBundle.access_denied}"
    fetchSize="#{bindings.User1.rangeSize}" rowBandingInterval="0"
    id="t1" rowSelection="multiple"
    selectionListener="#{AssignRolesBean.onTableSelect}"
    binding="#{AssignRolesBean.searchResultsTable}"
    columnStretching="last">
    <af:column sortProperty="firstname" sortable="#{AssignRolesBean.columnSortable}"
    headerText="#{bindings.User1.hints.firstname.label}" id="c1"
    width="136">
    <af:outputText value="#{row.firstname}" id="ot4"/>
    </af:column>
    <af:column sortProperty="lastname" sortable="#{AssignRolesBean.columnSortable}"
    headerText="#{bindings.User1.hints.lastname.label}" id="c2"
    width="182">
    <af:outputText value="#{row.lastname}" id="ot2"/>
    </af:column>
    <af:column sortProperty="mail" sortable="#{AssignRolesBean.columnSortable}"
    headerText="#{bindings.User1.hints.mail.label}" id="c4"
    width="361">
    <af:outputText value="#{row.mail}" id="ot5"/>
    </af:column>
    <af:column sortProperty="uid" sortable="false"
    headerText="#{bindings.User1.hints.uid.label}" id="c3"
    visible="false">
    <af:outputText value="#{row.uid}" id="ot3"/>
    </af:column>
    </af:table>
    I have a selection listener only, I don't have a sort listener.
    My bean;
    AssignRolesBean
    public void onTableSelect(SelectionEvent selectionEvent) {
    GenericTableSelectionHandler.makeCurrent(selectionEvent);
    My makeCurrent method
    public static void makeCurrent( SelectionEvent selectionEvent){
    RichTable _table = (RichTable) selectionEvent.getSource();
    CollectionModel tableModel = (CollectionModel) table.getValue();
    JUCtrlHierBinding adfTableBinding = (JUCtrlHierBinding) tableModel.getWrappedData();
    DCIteratorBinding tableIteratorBinding = adfTableBinding.getDCIteratorBinding();
    Object selectedRowData = table.getSelectedRowData();
    JUCtrlHierNodeBinding nodeBinding = (JUCtrlHierNodeBinding) selectedRowData;
    Key rwKey = nodeBinding.getRowKey();
    tableIteratorBinding.setCurrentRowWithKey( rwKey.toStringFormat(true));
    SHOULD I IMPLEMENT A SORT LISTENER FOR THIS TABLE IN ORDER TO HANDLE ROW SELECTION PROPERLY AFTER SORTING?
    Is there a guideline for handling row selection after sorting?
    Thanks

    I have a table bond to a javabean data control. I have enabled multi row selection. I get some rows on the table and then I select one of those rows, after that I use the value of the selected row for some operations.
    I have 3 columns, first name, lastname , email. The first 2 are sortable. If I click on the header of firstname, the information gets sorted ok (asc / desc). The problem is that after sorting, I can NOT select any rows. When I click on the row, it doesn't get highlighted, and If I try to use the value of the selected row I get a null pointer exception.
    Again this is happening only after sorting. If I don't sort, it works ok.
    I'm using JDEV + ADF 11.1.1.5.
    This is my code
    <af:table value="#{bindings.User1.collectionModel}" var="row" partialTriggers="::cb1"
    rows="#{bindings.User1.rangeSize}"
    emptyText="#{bindings.User1.viewable ? identityBundle.no_data_to_display : identityBundle.access_denied}"
    fetchSize="#{bindings.User1.rangeSize}" rowBandingInterval="0"
    id="t1" rowSelection="multiple"
    selectionListener="#{AssignRolesBean.onTableSelect}"
    binding="#{AssignRolesBean.searchResultsTable}"
    columnStretching="last">
    <af:column sortProperty="firstname" sortable="#{AssignRolesBean.columnSortable}"
    headerText="#{bindings.User1.hints.firstname.label}" id="c1"
    width="136">
    <af:outputText value="#{row.firstname}" id="ot4"/>
    </af:column>
    <af:column sortProperty="lastname" sortable="#{AssignRolesBean.columnSortable}"
    headerText="#{bindings.User1.hints.lastname.label}" id="c2"
    width="182">
    <af:outputText value="#{row.lastname}" id="ot2"/>
    </af:column>
    <af:column sortProperty="mail" sortable="#{AssignRolesBean.columnSortable}"
    headerText="#{bindings.User1.hints.mail.label}" id="c4"
    width="361">
    <af:outputText value="#{row.mail}" id="ot5"/>
    </af:column>
    <af:column sortProperty="uid" sortable="false"
    headerText="#{bindings.User1.hints.uid.label}" id="c3"
    visible="false">
    <af:outputText value="#{row.uid}" id="ot3"/>
    </af:column>
    </af:table>
    I have a selection listener only, I don't have a sort listener.
    My bean;
    AssignRolesBean
    public void onTableSelect(SelectionEvent selectionEvent) {
    GenericTableSelectionHandler.makeCurrent(selectionEvent);
    My makeCurrent method
    public static void makeCurrent( SelectionEvent selectionEvent){
    RichTable _table = (RichTable) selectionEvent.getSource();
    CollectionModel tableModel = (CollectionModel) table.getValue();
    JUCtrlHierBinding adfTableBinding = (JUCtrlHierBinding) tableModel.getWrappedData();
    DCIteratorBinding tableIteratorBinding = adfTableBinding.getDCIteratorBinding();
    Object selectedRowData = table.getSelectedRowData();
    JUCtrlHierNodeBinding nodeBinding = (JUCtrlHierNodeBinding) selectedRowData;
    Key rwKey = nodeBinding.getRowKey();
    tableIteratorBinding.setCurrentRowWithKey( rwKey.toStringFormat(true));
    SHOULD I IMPLEMENT A SORT LISTENER FOR THIS TABLE IN ORDER TO HANDLE ROW SELECTION PROPERLY AFTER SORTING?
    Is there a guideline for handling row selection after sorting?
    Thanks

  • 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

  • Problem in deleting Rows of JTable after sorting it

    Hi all,
    I'm getting problems in Removing Row(s) after sorting a JTable.
    Please find the code snippets at this URL. Thanks for your time...
    http://forum.java.sun.com/thread.jsp?forum=31&thread=459736&start=15&range=15&hilite=false&q=

    Hi Abhijeet,
    I tried it the way you said using
         wdContext.nodeBirhtday_List().nodeItab().moveFirst();
         //     loop backwards to avoid index troubles
         for (int i = n - 1; i >= 0; --i)
              current_date  = wdContext.nodeBirhtday_List().nodeItab().currentItabElement().getGbdat().getDate();
              current_month = wdContext.nodeBirhtday_List().nodeItab().currentItabElement().getGbdat().getMonth();
              if (( current_date != date_today ) && ( current_month != month_today ))
                   wdContext.nodeBirhtday_List().nodeItab().removeElement(wdContext.nodeBirhtday_List().nodeItab().
                                  getElementAt(i));                
              wdContext.nodeBirhtday_List().nodeItab().moveNext();     
    It adds records...
    According to Valerys Solution, the IPrivate<CustomController> doesnt show me the required nodes. and gives me 'Unable to resolve' error.
    Can you please suggest where I am going wrong
    Regards
    Abdullah

  • ALV: Edit, change and delete/insert rows

    Hi all,
    starting from an ALV layout (5 rows) empty and ready for inserting data I can insert data but I select two rows, for example, and by pressing the "delete" icon, after the refresh
    CALL METHOD lo_grid->set_selected_rows
    EXPORTING
    it_row_no = loc_t_nrows
    is_keep_other_selections = ''.  "
    CALL METHOD lo_grid->refresh_table_display.
    I find my new layout without the selected rows but empty.
    How can I maintain the data in my layout (passing them to internal tables) to have my layout always up to date?
    Thanks for your kind support.
    Regards,
          Giovanni

    HI
    BCALV_EDIT_04  BCALV_EDIT_04 Check these programs.
    Cheers
    Ram

Maybe you are looking for