Yes it is true that the Holy Prophet (SAWA) never encourages anyone to
abandon the Hereafter for this world nor this world for the Hereafter.
In the narrations one of the pious companions Usman ibn Madh’oon عثمان بن مظعون who was one of the earliest Muslims (13th or 14th) and who suffered a lot
from the enemies of the Muslims in Makkah and who had migrated to
Abyssinia twice, first with the Muslims of Madinah were who led by him
and the second time he migrated to Abyssinia with a group of Muslims
led by Ja’far ibn Abi Talib.
Usman ibn Madh’oon participated in the Muslim army in the battle of
Badr. He was spending his days in fasting and the nights in
worshipping. He sought permission from the Holy Prophet (SAWA) to
abandon this world and remain in worshipping Allah (SWT) only. The
Holy Prophet (SAWA) did not allow this and told him : “No, I was not
sent to abandon this world for the Hereafter nor to abandon the
Hereafter for sake of this world”. The Hadeeth says : “Do for your
worldly life as if you will remain in the world forever and do for
your Hereafter as if you are leaving this world tomorrow. (Mustadrak
al-Wasaa’il vol. 13 pg. 58 and Bihar al-Anwar vol. 44 pg. 139). Even
in the Holy Qu’ran in Surah al-Qasas verse 77, Allah (SWT) says :
“Seek with what Allah (SWT) has bestowed on you the Hereafter and
don’t forget your lawful portion from this world”.