title: How to combine select max and count?
body: <p>I've got this:</p>
  
  <pre><code>select ordernr 
  from users 
  having count(ordernr) = 
  ( select max(count(ordernr)) 
      from users where ordernr = ordernr 
      group by ordernr ) 
  group by ordernr
  </code></pre>
  
  <p>to get the most used order-number (ordernr) from all users.</p>
  
  <p>How to get it into ABAP SAP System? I've tried this:</p>
  
  <pre><code>select SINGLE ordernr 
  from ZDEVXXX_PROJECT3 INTO ordernrU 
  having count( * ) = 
  ( select max( count( * ) ) 
      from ZDEVXXX_PROJECT3 
      where ordernr = ordernr 
      group by ordernr )
  </code></pre>
  
  <p>But I get this error:</p>
  
  <pre><code>"Unknown columnname COUNT("
  </code></pre>
  
  <p>How to combine max and count in ABAP? The SQL Query above is working in Oracle for me.
  Thanks!</p>