It could be a fuel pump problem. There's also a suction jet pump in the fuel tank that transfers fuel from one side of the tank to the other.
But I agree that the fuel filter would be the first thing to change. It's easier than changing the fuel pump.
I just did that last weekend on my 2001 530i. I didn't have any codes, but the mile to empty would drop very quickly when the fuel level low. I don't know it that problem is fixed, but it appears my fuel economy has improved.
2001 530i/5 S+P CDV delete/Akebono ceramic pads
M5 SSK/RedLine MTL/M5 rear sway bar/Bilstein HD
BMWCCA Member #337964