Assume that you are using REUSE_ALV_GRID_DISPLAY function.
In order to make it happen, you need to setup the following two parameters:
it_fieldcat-do_sum = 'X'. " Which columns are going to have a summary number.
it_sort-subtot = 'X'. " Which columns are the factors of Sub-total summary numbers
![](https://i-blog.csdnimg.cn/blog_migrate/99ab40835d93548e518117bbb3a92f62.jpeg)
![](https://i-blog.csdnimg.cn/blog_migrate/feb2d38777d427559f69418007f08e90.jpeg)