I had a flat on my rear wheel. My bicycle is equipped with Shimano Nexus SG-7C18 7-speed coaster brake and in order to change a tube you need to remove both the chain and the internal Nexus 7 hub cassette joint.
That part seemed easy to do, but the trouble came when I tried to reinstall the Shimano Nexus 7 hub cassette joint with cable and lock ring. Even when hub twist shifter was set to speed 1 as advised and had the matching yellow arrows (shifter cassette joint) and dots (lock ring) properly positioned, lock ring wouldn’t lock by turning. It seemed as there wasn’t enough space between the ring and the cassette joint as the lock ring locks in grooves behind the casing.
After I took the bicycle to a mechanic, he told me he had a hard time locking the lock ring, too. His advise was to put shifter in position (speed) 1, put the cassette joint on the hub, use your fingers to open (tension) the cassette joint as wide as possible and this creates enough space for the lock ring to be locked. I hope I won’t have to repeat this procedure as it seems overly complicated. One would expect better from Shimano.
Complete list of Shimano Nexus 7 internal hub parts as well as installation instructions are available as PDF files directly from Shimano website.

Loved Tracks
I struggled just like you at first until I read the proper alignement sequence in the shimano tech doc: http://techdocs.shimano.com/media/techdocs/content/cycle/SI/Nexus/CoasterHub/SI-7C26C-EN_v1_m56577569830605809.pdf
Author Guillaume, 9:04 pm January 15, 2013