The enzyme catalyses the reincorporation into peptidoglycan of the tripeptide L-alanyl-γ-D-glutamyl-2,6-meso-diaminoheptanedioate released during the maturation and constant remodeling of this bacterial cell wall polymer that occur during cell growth and division. The enzyme can also use the tetrapeptide L-alanyl-γ-D-glutamyl-meso-2,6-diaminoheptanedioyl-D-alanine or the pentapeptide L-alanyl-γ-D-glutamyl-meso-2,6-diaminoheptanedioyl-D-alanyl-D-alanine in vivo and in vitro. Requires Mg2+.