Become not interested in my research topic after two years of my PhD?
This is a conversation you need to have with your supervisor. If they are any good at supervising, they can help with strategies to either reignite your interest in your topic or salvage what you have done and apply it to something else. If you dislike your topic now, writing it up will be even worse and you may not be able to produce something passable. This is exactly what PhD supervisors are for.