The month of Ramadan is a blessed one and an opportunity for every Muslim to draw near to Allah, increase his or her spirituality, and gain abundant rewards. Fasting during Ramadan is one of the five pillars of Islam and of paramount significance. A Muslim who is serving in the army and is fighting may break his fasting if he is undergoing an intolerable amount of hardship. Dr. Salah Sultan, president of the American Center for Islamic Research, Columbus, Ohio, and member of the European Council for Fatwa and Research, states that:
Unlike the vast majority of scholars, Imam Ibn Al-Qayyim is of the opinion that the mujahid in the battle may break his fast. Ibn Al-Qayyim based his argument in a number of evidences, one of which is the hadith stating that “it is not out of righteousness to fast while traveling.” In another version of the hadith, Prophet Muhammad (peace and blessings be upon him) is reported to have said, “You will be encountering your enemy in the morning, and breaking your fasting would help you against them.”
But other scholars disagree with Ibn Al-Qayyim, and they limit the exemption from fasting to the cases mentioned in the Qur’an and Sunnah such as sickness, traveling, and menstruation.
this said, the person in the army may experience different situations. If he is not fighting and is doing training, then he may not break his fast. If he is fighting and he is undergoing intolerable amount of hardship that he cannot cope with, then he may break his fast. If there is no hardship, he should observe fasting.