Together with DpaA, catalyzes the conversion of dihydrodipicolinate to dipicolinate (DPA), which constitutes up to 10% of the dry weight of the spore. (S)-2,3-dihydrodipicolinate + NADP(+) = dipicolinate + H(+) + NADPH Dipicolinate synthase likely consists of DpaA and DpaB, since both proteins are required for DPA synthesis. Is not expressed during vegetative growth; is expressed at stage 5 of sporulation specifically in the mother cell compartment, under the control of the sigma-K factor. Is repressed by GerE. Disruption of this gene has no effect on vegetative growth but causes a sporulation defect, characterized by very low sporulation frequencies and heat-sensitive spores devoid of DPA, which can be cured by supplementation with dipicolinate.