Ups, with the code you have only repeated calculations may happen. The result will be correct!
*SELECT(%SAP_CODES%,SAP_CODE,ENTTIY,SAP_CODE<>'')
Can result in:
%SAP_CODES%=CODE1,CODE3,CODE1,CODE2,CODE2...
Vadim
P.S. Anyway, second property is better solution!