Hi JoyDeb,
If you want to calculate the Total, go for the above said example. But you need suon sb total, better calculate it in the smartform itself. Inside the table of the smartform, use EVENT ON SORT END. You can calculate the subtotal for each header.
Thanks.
VIJAY