Hypernuclei formation at CERN and SIS energies