title: ABAP String Templates - Embedded Expressions with GROUP BY
body: <p>I am refering to this question: <a href="https://stackoverflow.com/questions/62956466/loop-at-group-by-with-dynamic-group-key">LOOP AT... GROUP BY with dynamic group key</a></p>
  <p>I also want to do some dynamic GROUP-BY-Aggregations.</p>
  <p>I want to dynamize a GROUP-BY-Statement like the following snippet:</p>
  <pre><code>      WHEN 'vkorg'.
  
          LOOP AT ls_output-merged_data INTO ls_tmp
            GROUP BY (  sales_org = ls_tmp-sales_org
                        group_quantity = GROUP SIZE )
  
             ASCENDING ASSIGNING FIELD-SYMBOL(&lt;fs_tmp_2&gt;).
  
            lt_tmp_dim1 = VALUE #( BASE lt_tmp_dim1 (
                                sales_org = &lt;fs_tmp_2&gt;-sales_org
                                group_quantity  = &lt;fs_tmp_2&gt;-group_quantity
                                ) ).
          ENDLOOP.
  </code></pre>
  <p>Curently I have some smiliar to this:</p>
  <pre><code>  LOOP AT ls_output-merged_data INTO ls_tmp
        GROUP BY COND #( WHEN iv_dim1 EQ 'vkorg' THEN |{ ls_tmp-sales_org }| ) 
  
  
                                 ASCENDING ASSIGNING FIELD-SYMBOL(&lt;total_group&gt;).
  
  
      LOOP AT GROUP &lt;total_group&gt; ASSIGNING FIELD-SYMBOL(&lt;line_data&gt;).
        ASSIGN COMPONENT 'vkorg' OF STRUCTURE &lt;line_data&gt; TO FIELD-SYMBOL(&lt;vkorg&gt;).
        EXIT.
      ENDLOOP.
  
  
  
  
    ENDLOOP.
  </code></pre>
  <p>The issue here is, that I also need the GROUP SIZE field. However I am not able to put it into the embedded expression like: |{ ls_tmp-sales_org GROUP SIZE }|</p>
  <p>I tried several positions and syntax but I was not able to make it work.</p>
  <p>Does someone did something similiar before and can help me out?</p>