In Dorothy Baker's The Street, a 1951 novel about working-class people in the West Midlands, the rhyme is reproduced as:
Ham, ham, pig's bum,
When I have a party
You shan't come.
Bread without butter
Tea without sugar
Ham, ham, pig's bum.
(Recited by a schoolgirl to her teacher when asked if anybody in the class could say some poetry.)
Ham and pig's bum are obviously semantically connected. I'd imagine that subsequent variants are arising as children playing with sounds and finding rhymes for "bum". That is certainly the most enticing word to keep in the song and to highlight by wordplay. In the sibling answer by annie is an intermediate form, where we have a rhyme for "bum" with "rum" instead of "sugar", plus the replacement of "ham" with "yum" for yet another rhyme.
The root imagery here is common to many nursery rhymes - punishment based on denying food, or some other treat such as a party invitation. A 1794 version (the oldest recorded version) of the old woman who lived in a shoe is:
There was an old woman who lived in a shoe.
She had so many children, she didn't know what to do.
She gave them some broth without any bread;
She whipp'd all their bums, and sent them to bed.
I'm presenting this not as a strict precursor, but as evidence that there are lots of songs and rhymes for children which include the same sorts of words and ideas.
I think the "pig's bum" rhymes seem more adapted to playground chants or skipping rhymes, given the rhythm and nonsensical content, and especially the use of a taboo word. But the 1951 example, in addition, is perhaps a little closer to conventional nursery rhymes. It may not be possible to find a real answer for where this particular one originated, given the informal nature of the material.