The factory manual has two different methods.
– Switch on the ignition and close the doors. If necessary, close the sunroof.
– Pull the sunroof control switch and hold it in that position for 10 seconds.
– The sunroof panel will lift, it will open all the way and then it will close.
* Keep pulling the sunroof switch during the adaptation process.
* This completes the adaptation process.
"Use Vehicle Diagnostic Tester to code or perform an adaptation via Guided Functions or in Guided Fault Finding in diagnosis address 46 after replacing the Power Sunroof Control Module -J245- or Roof Shade Control Module -J394-.", with no further information.