this was for an E46 but when you replace the throttle body you are suppose to do the following.
1. Using a breakout box check the wiring from the DME to the MDK for open or
short to ground.
2. If the wiring is correct then the MDK should be replaced. Important: After
MDK motor replacement, the DME adaptation values must be cleared.
Failure to clear the adaptation values will result in reoccurring faults.
3. Switch off the ignition off for 30 seconds.
4. Turn on the ignition and delete DME adaptations and fault code memory.
5. Press the accelerator pedal to wide open throttle (WOT) four times.
I would say step 5 is very important!