Hi Selva,
First of all there is info in standard BPC help: Custom Logic and BADI
QUERY=ON - will put the scope before badi call into CT_DATA. OFF - CT_DATA will be empty.
WRITE=ON - will write the contents of CT_DATA at the end of badi call to the cube. OFF - no write.
Vadim