Heat the oven to 180°C, or 160°C for a fan oven, or Gas Mark 4. Line a 9 x 12-inch baking tin with greaseproof paper and set it aside.
Place the margarine and sugar into a large mixing bowl and beat together until the mixture becomes pale and fluffy.
Add the eggs individually, beating well after each addition so that every egg is fully incorporated before the next is added.
Sift the self-rising flour into the bowl, then fold it in gently until a smooth, even batter has formed.
Spoon the batter into the prepared tin and level the surface evenly. Bake for 30 to 40 minutes, or until the cake is well risen, lightly golden, and a skewer inserted into the centre comes out clean.
Remove the cake from the oven and leave it in the tin for a few minutes so it can settle and firm slightly.
Transfer the cake to a wire rack and allow it to cool completely. This helps prevent moisture from collecting underneath.
Once the cake is fully cold, warm the jam in the microwave for about 20 seconds, if desired, to make it easier to spread.
Cover the top of the cake with the jam, taking it right to the edges and into the corners.
Scatter the shredded coconut evenly over the jam to finish.