Go to RSRT, give the query name and click on the "Generate Report" button. When you do so, the DEFINE method will get called.
The Gen Report needs to be done each time you write/change the DEFINE method.
Only after the Gen report is done, will the query start using the BAdI