A war machine cannot be attacked in close combat while it still has crew. A war machine that has had its crew wiped out or broken in close combat is assumed to be spiked or otherwise disabled by the attackers, on the condition that they don't pursue or overrun.
If a war machine is already abandoned when charged. it is destroyed, but no combat results are worked out, no Panic tests required, no overrun can be made, etc.