Catalyzes the liberation of D-alanyl moieties present on wall teichoic acid (WTA) and lipoteichoic acid (LTA) (PubMed:26861022). Affects the methicillin resistance level and autolysis in the presence of Triton X-100 as well as the cell wall structure (PubMed:22564846). [(4-D-Ala)-(2-GlcNAc)-Rib-ol-P]n-[Gro-P]m-beta-D-ManNAc-(1->4)-alpha-D-GlcNAc-P-peptidoglycan + n H2O = [(2-GlcNAc)-Rib-ol-P]n-[Gro-P]m-beta-D-ManNAc-(1->4)-alpha-D-GlcNAc-P-peptidoglycan + n D-alanine.