I was motivated by the comments to change the RAM without removing all the parts. After removing the monitor glass (easy) I just took out the fan (and the HDD as I changed it too) I just unscrewed all four brews of the main board to be able to lift it slightly.
Releasing the RAM was easy, but be careful just to touch the releasers of the RAM and not to scratch the mainboard.
Putting in the new RAM was a bit more tricky as also the unscrewed mainboard still does not give much space. The trick is to put in the “inner” RAM first, the one you do not see at the edge od the mainboard. Just put it in, but do not bend it down to lock it. Now put in the “outer” RAM, bend it down to lock it and then do the same with the inner.
If you do it vice versa it is much more difficult as the outer RAM take the sight and space.
For the full operation I had put up the iMac vertically, small side down at the table to better have a look into the space between the mainboard and the case.