Preheat the oven to 180°C (160°C fan)/350°F (325°F fan)/gas mark 4 (gas mark 3 fan).
Spread a little béchamel sauce over the bottom of a gratin dish or baking tray.
Arrange a layer of sweet potato at the base of the dish, scatter with some beans and rosemary and season. Spoon over some of the béchamel and repeat the process, alternating sweet potato, beans, rosemary and béchamel, finishing with a layer of sweet potato, but leaving some béchamel in the jar.
Cover with the remaining béchamel, then scatter over the breadcrumbs and the reserved chopped rosemary.
Bake in the oven for 1 hour or so, until the breadcrumbs are golden and the sweet potato is tender when a knife is stuck in.
Leave to cool for a few minutes, then serve with steamed green vegetables, if you like.