Hi Vadim,
Thanks so much for the suggested!
I purposely not to put in the whole script text. I have repeatedly tested the script and the whole script could be validated successfully when I removed the "Lookup" part.
So, I locked the error with the "Lookup" part.
And to me, it sounds very much like the problem is coming from the "ENDLOOKUP" function as I found the "ENDWHEN" hit the color differentiation (which I assume it means BPC could recognize this function, but unfortunately it is not the case for "ENDLOOKUP").
Please let me know if I'm on the right track. Or, I will post the requested info immediately.
Again, thanks a lot for your quick response.
Antony