Skip to Content
0

How to fix a row in normal ALV

Mar 05 at 10:11 AM

68

avatar image

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.

Thanks,

fix-row.png (1.4 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Raymond Giuseppi
Mar 05 at 12:06 PM
1

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.

Show 1 Share
10 |10000 characters needed characters left 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)

0