My sunroof wasn'r working at all and i got from scrap yard a motor and ecu, but its driving me crazy. i tryed to reset it as it was sayd in tis but no luck from the first step. 
on the colose position i am supose to push the button untill the sunroof comes to a stand and its completely closed but it doesn't, it tilts up about half way. if i tilt up at max it tilts stays there 2-3 secs(some clicks can be heard) and it comes down about half way of the tilt position. if i turn the knob to full open it opens perfect but when i close it it slides to closed position then opens again 

. it is driving me crazy
this is what tis says 
Motor (Gears, Control Unit), Adjust 
  Adjust
Ignition on. 
Calibration run 
1
 Hold preselector switch rotary knob down until motor comes to a standstill. Cover (glass) cover is in closed position. 
First
 Learning run 
2
 Preselector switch rotary knob to lift – roof tilts. 
3
 Preselector switch rotary knob to closed, hold pressed until roof closed. 
Second
 Learning run 
4
 Preselector switch rotary knob to open – roof opens. 
5
 Preselector switch rotary knob to closed, hold pressed until roof closed. 
Caution
If the roof opens automatically after a closure command (points 3 and 5), repeat points 2 to 5 (1st and 2nd learning runs) by up to three times.