NOVELTY - Substituted heterocyclic compounds (I) are new.    USE - (I) are useful to control or prevent an infestation of plants, propagation material, harvested crops or non-living materials by phytopathogenic or spoilage microorganisms or organisms potentially harmful to man (claimed). (I) are also useful to treat or prevent diseases in plants caused by phyotpathogen gram positive and gram negative bacteria including Xanthomonas spp, Pseudomonas spp, Erwinia amylovora and Ralstonia spp. (II)-(IV) are useful as intermediates to prepare (I).    ADVANTAGE - (I): exhibit excellent activity at low rates of application and well tolerated by plants; and is environmentally safe.    DETAILED DESCRIPTION - Substituted heterocyclic compounds of formula (I) and their salts or N-oxides are new.    A = x-C(=O)-, x-C(=S)-, x-C(R10R11)-C(=O)-, x-C(R12R13)-C(=S)-, x-O-C(=O)- , x-O-C(=S)-, x-N(R14)-C(=O)-, x-N(R15)-C(=S)-, x-C(R16R17)-SO2- or x-N=C(R26 )- (where x indicates the bond connected to R1);    T = CR18 or N;    G = O or S;    Y1, Y2 = CR19 or N;    Q = -C(=O)-z, -C(=S)-z, -C(=O)-O-z, -C(=S)-O-z, -C(=O)-N(R20)-z, -C(=S)-N(R21)-z or-SO2-z- (where z indicates the bond that is connected to R9);    n, p = 1 or 2;    R1 = phenyl, pyridyl, imidazolyl or pyrazolyl (all optionally substituted by 1-3 1-4C alkyl, 1-4C haloalkyl, halo, CN, OH or NH2);    R2-R7, R10-R13, R16-R19, R26 = H, halo, CN, 1-4C alkyl or 1-4C haloalkyl;    R8, R14, R15, R20, R21 = H, 1-4C alkyl or 1-4c alkoxy;    R9 = phenyl, benzyl or 1,2,3,4-tetrahydro-naphthalene-1-yl (all optionally substituted by 1-3 phenylsulfonyl, phenylsulfinyl (both optionally substituted by 1-3 1-4C alkyl, 1-4C haloalkyl, 1-4C alkoxy, 1-4C haloalkoxy, halo or CN), 1-4C alkyl, 1-4C haloalkyl, 1-4C alkoxy, 1-4C haloalkoxy, halo, CN, OH, N(R27)2, SH, 1-4C alkylthio or NO2); and    R27 = phenylsulfonyl, phenylsulfinyl (both optionally substituted by 1-3 1-4C alkyl, 1-4C haloalkyl, 1-4C alkoxy, 1-4C haloalkoxy, halo or CN), H or 1-4C alkyl.    Provided that when n is 2 then p is 1. INDEPENDENT CLAIMS are also included for: substituted heterocyclic compounds of formulae (II)-(IV); and #fungicidal composition comprising (I) and a carrier, optionally an adjuvant and at least one additional fungicidally active compound.    R1a = 1-8C alkyl.