It is narrated from Sayyiduna Abu Umamah (may Allah be pleased with him) that a man asked the Prophet (peace and blessings be upon him), saying: I touched my private part while I was praying. He (peace and blessings be upon him) said: "There is no harm; it is only a part of your own body."
Hadith Referenceالمعجم الكبير للطبراني / باب الصاد / 7914