BMW E39 builds from September 1995 till June 2003 (sedan).
For 2001 and older, make sure to use the certified ICOM C to connect to the DME port under the hood, see below:
For 2001 and newer , make sure you select EDIABAS under the VCI settings tab under Interface type.
Select No under Ethernet as preferred communication channel when connected via ICOM.
See below: