title: Calculate total and subtotal without loop?
body: <p>I am starting learning the new abap. But i have problems. I want to make result output as below without using "LOOP" and "AT" statements.</p>
  
  <p>I have internal table like:</p>
  
  <pre><code>Category Amount
      AAA     10
      AAA     20
      BBB     30
      CCC     40
      CCC     50
      CCC     60
  </code></pre>
  
  <p>I need to display output as:</p>
  
  <pre><code>Category Amount
      AAA       10
      AAA       20
      SUBTOTAL  30
      BBB       30
      SUBTOTAL  30
      CCC       40
      CCC       50
      CCC       60
      SUBTOTAL  150
      TOTAL     210
  </code></pre>
  
  <p>Can anyone help with this?</p>