If you have replaced the battery in your BMW and now it won't start, try this
Get in the car and close the door
Insert and rotate the ignition key three times
Remove the key, get out of the car, and close the door
Walk away from the car, with the key, for ten minutes. I do not know how far, but in our case, 50 feet was enough.
After 10 minutes, get back in, close the door, and start the car. Things should be back to normal.
This procedure worked on my 1997 E38 740i after we had the battery disconnected overnight while changing the heater blower.