The defenses specifically enumerated in subdivisions 15-6-12(b)(1) to (6), whether made in a pleading or by motion, and the motion for judgment mentioned in § 15-6-12(c) shall be heard and determined before trial on application of any party, unless the court orders that the hearing and determination thereof be deferred until the trial.
SDCL 15-6-12(d)