Crystal Reports Next() function

I was trying to use this to get the Next record and compare to the current.  In this case 

if next(ItemCode) =ItemCode then ...

When I use it the report wont run and I get the below message.  I am guessing this function is just not allowed within Sage 100. 
I guess I just wanted to have someone confirm this.

If I am correct, I guess I will have to use variables and comparisons and lots of excludes.  This solution would have been very clean :-(

Thanks