In this paper we apply the direct-mapping density-functional theory (DFT) to open-shell systems, in order to get many-electron wave functions having the same transformation properties as the eigenstates of the exact Hamiltonians. Such a case is that of spin, where in order to get the magnetic properties, the many-particle states must be eigenstates not only of S(z) but also of S2. In this theory the Kohn and Sham [Phys. Rev. A 140, 1133 (1965)] potential is expressed directly as a mapping of the external potential. The total energies of the molecules calculated were satisfactory as their relative deviations (deltaEE) from the exact Hartree-Fock ones were of the order of 10(-4). This accuracy is much higher than that of the standard DFT in its local exchange potential approximation. This method does not need an approximate density as input, as the effective potential is derived directly from the external potential.