I just had the same codes on my 2001 740i
P0171 - System Too Lean (Bank 1)
P0174 - System Too Lean (Bank 2)
Spent hours trying to find a nonexistent vacuum leak - everything looked good, no idle changes while coating vacuum leak zones with carb cleaner, etc.
Cleaned the MAF (Mass Airflow Sensor) with electrical contact cleaner - to no avail. I had cleaned this sensor a few years back, and it actually got my 'Service Engine Soon' lamp to go out, but not this time around.
******THE FIX*******
Realizing that the fault codes pertain to
both banks of cylinders, I decided to just replace the MAF, and you can achieve this for the cost of a tank of gas...
The factory Bosch BMW replacement part costs about $300.
After some research - mostly within Bimmerfest (THANK YOU!) - I found that a cool suggestion based on part interchangbility actually works!
The interchangeable sensor in question is meant for the VW Beetle, Golk, and Jetta MkIV. Here is a link for the specific item:
http://secarpart.com/products.php?product=Mass-Air-Flow-Sensor-%2d-06A906461A
You will notice that the factory Bosch VW MAF is much smaller than the factory Bosch BMW MAF. The actual sensor, though is the exact same and can be extracted from the VW unit by removing the (2) torx head security screws holding it in place. These look to be FIVE-point torx-plus security screws, about 25mm. I do not have those bits, and carefully removed the screws with some knipex pliers.
After removing the faulty MAF from my 740i - held in place with (2) torx security 20mm screws - I inserted the VW Bosch MAF into the orifice and seated it down with the BMW 20mm torx security screws. After plugging in the MAF harness I started the car and needless to say I was very pleased with the results - even more so after test driving.
The throttle response on ALL levels of the power band is now consistent and crisp. The hesitation I would experience when flooring the vehicle is completely absent and the acceleration is back to 100%.
Would definitely like to thank the member whom posted the alternative Bosch part suggestion earlier in the forum. It is a logical fix that saves you a lot of time, money in aimless shop hours, and remedies a car that does not perform as it should based on vague OBD fault codes.
Good luck - hopefully this helps!