C (gcc), 165 164 140 138 137 136135 bytes
#define W(b,c);for(;X b;putchar(c)) x,y,X;f(s,w)char*s;{x=y=0 W(=*s=*s++,33){X=97X-*s++W=97 W(%w<x,8276)x--W(%w>x,7682)x++W(/w<y,6885)y--W(/w>y,8568)y++;}} 1 25 27 28 byte shaved off thanks to ceilingcat! Ungolfed:
int x, y, X, Y; f(char *s, int w) { x = 0; // Starting position is (0, 0) y = 0; while (*s) { // For each character X = (*s - 'a') % w; // Get its x coordinate Y = (*s - 'a') / w; // Get its y coordinate s++; while (X > x) putchar('R'), x++; // Print R for each step we need to move right while (X < x) putchar('L'), x--; // ...et cetera... while (Y > y) putchar('D'), y++; while (Y < y) putchar('U'), y--; putchar('!'); // We are there, print ! } }