Hi Vadamalai,
just an advice..you should not use SELECT query on CDHDR and CHPOS as they are huge table and SAP does not recommend SELECT on any such huge table.in production it can cause an performance issue.
try using FM CHANGEDOCUMENT_READ_HEADERS to read header and CHANGEDOCUMENT_READ_POSITIONS for items.
how to pass the data to these FMs you can check on below link.
Function Module to Read Change Documents from T... | SCN
Regards,
Menka