At the beginning of the movie, Konakawa says the guy in the hallway represents the murder case he's working on. So what becomes of that? And for that matter, how does exploring yor own dreams help to solve a case?
Paprika's letter at the end congratulates him on solving his case.
My interpretation was that the case he was working on was reminiscent of the film he was making, thus distracting him and stressing him out by reminding him of the (possibly) repressed guilt he felt for abandoning his friend. Once he was able to move on from that he could focus on the actual case. Its all there in context. Or subtext.