theres a small clip on the shifter linkage that can break or pop out. i had a similar problem. take out the ashtray / shifter cover piece there and look under there, you will see the linkage and a U Shaped clip should be there. pull the linkage back into place, (towards the rear of the X) then slide the clip in place. its a tight fit, but this could be the problem area.
http://www.realoem.com/bmw/showparts...98&hg=25&fg=20
part#9 it shows one near the shifter, but there is one near part 6 as well.