Drain the sauerkraut from the can in a sieve and cook in a saucepan with water until soft (approx. 40 min.). In the meantime, cook the mushrooms separately until soft.
When the cabbage is soft, drain back in the colander and place in the saucepan. Then continue to cook on a low heat. Add butter, chopped onion and mushrooms to the cabbage and sprinkle with flour. Continue cooking while stirring. Season to taste with salt, pepper and sugar.