Skip to Content

How to fix a row in normal ALV

Hi Guys,

I have a scenario where I want to fix the row at a particular position in normal ALV wherein if we perform any filter or sort(up and down) or subtotals, that row should remain only at the end of the table.

My Code.

while finally appending to the final internal table.

if sy-tabix = total no. of lines of Internal table. i am calculating the percentage and appending. supporting screen shot pasted below.

That 61% should not go up and down if sorted or filetered. It should remain in only 1 place at the end as summation appears at last.

Any suggestions on this.


fix-row.png (1.4 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Mar 05, 2018 at 12:06 PM

    IMHO strange requirement, nevertheless you could define an hidden field, value 0 for this record and 1 for other records, and insure that this field is always first SORT criteria (handle event AFTER_REFRES there get current sort criteria GET_SORT_CRITERIA, if required add the first field SET_SORT_CRITERIA and force a REFRESH_TABLE_DISPLAY)

    Else for a correct output, in my own view, you could add a column for percentage, and handling same event, get reference and update the subtotals with GET_SUBTOTALS before triggering a new display.

    The easiest way of course would be display this total % in a top of page html header.

    Add comment
    10|10000 characters needed characters exceeded

    • Yes, strange. I'd opt for the solution of displaying the percentage in the totals line, and in a new column, and setting the percentage text by using the **event** SUBTOTAL_TEXT (cf demo program BCALV_TEST_GRID_EVENTS)