It is narrated from Sayyiduna Anas bin Malik (may Allah be pleased with him) as marfu' (attributed to the Prophet) that the Messenger of Allah (peace and blessings be upon him) said: "Indeed, Allah Almighty gives this world (as well) for the intention and aim of the Hereafter, but He has refused to give the Hereafter for the intention of this world alone."
Abu Ya'la recorded it, and its chain contains a narrator who is not explicitly named.