Spiritually a Cop (1989)
A young man wants to be a Hong Kong police officer but is too short to qualify. However, he doesn't let that stop him: he goes around impersonating an officer, investigating crimes and busting criminals. One day, he interrupts a bank robbery (by three men in drag), gets shot in the process and dies. When the case is assigned to a female investigator, he returns as a ghost to lend a hand at solving the robbery.