LOOP….WHERE condition was included recently in ABAP. Could you please verify your version? This will work only on a version of 7.0 Ehp2 or higher.