Variability of elemental abundances in the local neighborhood and its effect on planetary systems