car shuts down when put in drive or reverse

91 BMW 735i

I have a 91 BMW 735i and recently found no vacuum leaks, i replaced fuel pump, sparkplug wires and Distributor cap. did disconnect erg valve and ran smoother but still engine shut down when i put it in gear. I also disconnected the hose from fuel pressure regulator and there was no difference the way engine ran. I then installed another new fuel pump and now it doesn’t want to start and just cranks. I do have a bad battery and need to jump start each time to start the car. What do you think the problem can be? thanks

Double check your work if it started and ran before the second pump swap.

A quick test of the idle air control valve could be performed. Press the accelerator pedal down half way and try to start it. If it starts then you know it is an internal vacuum leak, since you already stated you have no external vacuum leaks.

First rule of test and diagnosing is to start with a GOOD, fully charged battery.