The present invention relates to (thio)morpholine derivatives of the formula (I), wherein R1 is selected from cyano, (2-)alkynyl, (1-)alkyl, (3-)cycloalkyl, (4-)cycloalkenyl, (6-)bicycloalkyl, (8-)bicyclic group, each optionally substituted with (1-)alkyl, phenyl, biphenyl, naphthyl, each optionally substituted with one or more substituenls independently selected from halogen, (1-)alkyloptionally substituted with one or more fluoro atoms, (2-)alkynyl, (l-)alkoxy optionally substituted with one or more fluoro atoms,amino, di(l-)alkylamino, -SO-(l-)alkyl, -CO-( 1-)alkyl, -CO-O-(1-)alkyl, -NH-CO-(1-)alkyl and (3-)cycloalkyl, phenyl substituted with phenoxy, benzyl, benzyloxy, phenylethyl or monocyclic hete-rocycle, each optionally substituted with (1-)alkyl, monocyclic heterocycle optionally substituted with halogen, (1-)alkyl or with phenyl optionally substituted with (1-)alkyl, and bicyclic heterocycle optionally substituted with (1-)alkyl; A is selected from -CO-O-, -O-CO-, -NH-CO-, -CO-NH, -C=C-, -CCH,-O- and the linking group -Y-(CH)-X- wherein Y is attached to Rl and selected from a bond, -O-, -S-, -SO-, -SO-, -CH-O-, -CO-, -O-CO-, -CO-O-, -CO-NH-, -NH-CO-, -C=C-and -C≡C-; n is an integer from 1 to 10; and X is attached to the phenylene / pyridyl group and selected from a bond, -O-, -S-, -SO-, -SO-, -NH, -CO-, -C=C-and -C≡C-; ring structure B optionally contains one nitrogen atom; R2 is H, (1-)alkyl optionally substituted with one or more fluoro atoms, (1-)alkoxy optionally substituted with one or more fluoro atoms, or halogen; and R3 is (l-)alky-lene-R5 wherein the alkylene group may be substituted with (CH)to form a cyclopropyl moiety or one or two halogen atoms, or R3 is (3-)cycloalkylene-R5 or -CO-CH-R5, wherein R5 is -OH, -POH, -OPOH, -COOH, -COO(1-)alkyl or tetrazol-5-yl; R4 is Η or (1-)alkyl; R6 is one or more substituents independently selected from II, (1-4C)alkyl or oxo; W is -O-, -S-, -SO-or -SO-; or a pharmaceutically acceptable salt, a solvate or hyd