Conventional devices have a valve needle and a shape memory element which, by the application of a controllable magnetic field, executes a control stroke travel that operates the actuator, and having a coil that excites the magnetic field which is situated in a magnet housing which, at its end face, is bordered with respect to an actuating axis by a front wall in each case, the front walls having a through opening radially within the coil. It is a disadvantage that the magnetic field excited around the coil is conducted unfavorably, so that at most a slight magnetic field develops in the shape memory element. The shape memory element has a magnetic field flowing through it, in the direction of its longitudinal extension, if at all. Since the shape memory element has a high magnetic resistance and is developed to be very long in the axial direction, only a very weak magnetic field can be induced in the shape memory element. In response to the magnetic field that is weak at most, the shape memory element can generate only a very slight lift of the valve needle. In the device according to the present invention, a strong magnetic field is conducted through the shape memory elements, and in this way, a large control stroke travel is achieved. The shape memory element(s) is / are positioned generally only in the through opening(s).