The small handheld scanners can't code modules to the car, you need BMW INPA and NCS Expert to do that on a Laptop. You can buy the software as a package together with the interface to plug into the car.
https://www.ebay.co.uk/itm/154762028275?epid=1274524309&hash=item24088924f3:g:8XYAAOSweURc5xFk
Setting up on a laptop can be a bit of a faff but as long as you get the settings correct it works fine. For a Z4 it plugs into the 16pin OBD2 socket, for Z3 models it needs an extra 20pin to 16pin cable changer to plug into the round 20pin diagnostic socket in the engine bay.
https://www.ebay.co.uk/itm/154762028275?epid=1274524309&hash=item24088924f3:g:8XYAAOSweURc5xFk
Setting up on a laptop can be a bit of a faff but as long as you get the settings correct it works fine. For a Z4 it plugs into the 16pin OBD2 socket, for Z3 models it needs an extra 20pin to 16pin cable changer to plug into the round 20pin diagnostic socket in the engine bay.
