Here's a start. This will get you the first 7 letters of the last name as long as you have their full name in User Manager for Domains.

$LNAME = SUBSTR(@FULLNAME,1,7)