A racetrack memory is a device where the information is stored as magnetic domains (bits) along a nanowire (track). To read and record the information, the bits are moved along the track by current pulses until they reach the reading/writing heads. In particular, 3D racetrack memory devices use arrays of vertically aligned wires (tracks), thus enhancing storage density. In this work, we propose a novel 3D racetrack memory configuration based on functional segments inside cylindrical nanowire arrays. The innovative idea is the integration of the writing element inside the racetrack itself, avoiding the need to implement external writing heads next to the track. The use of selective magnetic segments inside one nanowire allows the creation of writing and storage sections inside the same track, separated by chemical constraints identical to those separating the bits. Using micromagnetic simulations, our study reveals that if the writing section is composed of two segments with different coercivities, one can reverse its magnetization independently from the rest of the memory device by applying an external magnetic field. Spin-polarized current pulses then move the information bits along selected tracks, completing the writing process by pushing the new bit into the storage section of the wire. Finally, we have proven the efficacy of this system inside an array of 7 nanowires, opening the possibility to use this configuration in a 3D racetrack memory device composed of an array of thousands of nanowires produced by low-cost and high-yield template-electrodeposition methods.