You use this method to deselect all marked text:
CALL METHOD document->clear_selection EXPORTING no_flush = no_flush IMPORTING error = error retcode = retcode.