Not sure what you're saying but if you mean the sunroof slides closed but the rear doesn't come down and seat fully, the I'd start by looking to make sure nothing is in the way of it fully closing, also when was the last time you greased the slides on the sun roof?
Probably the receiver for the key chip. It has to go back on. But it doesn't have to be programmed. Replace it and the security will go off. With the key of course.