That will work. There's a simpler, and more conventional way to do it:
void getdat(byte pdata)
pdata = 'a';
pdata = 'b';
Either way, the same address gets passed to getdata(). In the function declaration for getdat(), I would use 'byte pdata' rather than 'byte *pdata' because I will be referencing pdata as an array rather than a character pointer. Once again, the way you did it was equivalent, but saying it's an array makes it a tiny bit more self-documenting.
By the way, if you wanted to change the value of two variables in getdat(), rather than using an array, here's one way to do it:
void getdat(byte *d1,byte *d2)
*d1 = 'a';
*d2 = 'b';
Personally, I'd use an array, as you did.