Anas (Allah be pleased with him) reported
We were with the Messenger of Allah (ﷺ) on a journey. Some of us had been observing the fast and some of us had not been fasting. We got down at a place on a hot day. Most of us had the cloth for shelter. There were also those amongst us who sheltered (themselves against the rays of the) sun with the help of their hands. The observers of the fast fell down (on account of weakness). Those who had not observed it got up and pitched tents and watered the mounts. Thereupon the Messenger of Allah (ﷺ) said: The breakers of the fast have taken away the reward today.
Anas (Allah be pleased with him) reported that the Messenger of Allah (ﷺ) was journeying (along with his Companions). Some of them had observed the fast whereas the others had broken it. Those who did not fast girded up their loins and worked, but the observers of the fast were too weak to work. Upon this he (the Messenger of Allah) said
Today the breakers of the fast have gone with the reward.
Qaza'a reported
I came to Abu Sa'id al-Khudri (Allah be pleased with him) and he was surrounded (by people), and when they dispersed I said to him: I am not going to ask you about what these people were asking. I ask you about fasting on a journey. Upon this he said: We travelled with the Messenger of Allah (ﷺ) towards Mecca and we had been observing fast. We halted at a place. There the Messenger of Allah (ﷺ) said: You are nearing your enemy and breaking of fast would give you greater strength, and that was a concession (given to us). But some of us continued to observe the fast and some of us broke it. We then got down at another place and he (the Holy Prophet) said: You are going to encounter the enemy in the morning and breaking of the fast would give you strength, so break the fast. As it was a point of stress, so we broke the fast. But subsequently we saw ourselves observing the fast with the Messenger of Allah (ﷺ) on a journey.