Here's what I found:
The Army Bean: The army bean was probably the most appreciated ration to the soldier. Although they were cooked in above ground stone ovens, by far the most popular method was to bake them in the ground. When the bean ration was distributed to the men, invariably this is the way they would cook them. It was not practicle to cook a single ration like this so the men either saved their rations until a good baking could be made or 10 or 12 of the men would combine their rations to make one big pot. Many men saved their cooked bean rations for a couple of days to make it last, so valued as it was.And the song is "The Army Bean", which you can find here.