Could be a wheel sensor as others have said. I had a similar intermittent problem a couple of years ago and it turned out to be the ABS module. There were several posts at the time as a few of us seemed to be seeing the same type of issue. The error code was 096 and the conclussion was it was probably do to a dry solder joint on the module board. Fixes at the time were change the ABS module with a good second hand one (BMW list price was £1500, used around £100), get it repaired by ECS for about £200 or diy repair by cutting the top off the module and resoldering.
Lets hope it is just a wheel sensor, if not there is plenty of info on how to fix the more serious problems.