Have you followed these instructions from this website?
Connect your iPhone, iPad, iPod touch, and Mac using Continuity - Apple Support
- Your iPhone, iPad, and iPod touch need to use iOS 8.1, and your Mac needs to use OS X Yosemite.
- Sign in to iMessage on your iPhone, your other iOS devices, and your Mac using the same Apple ID.
- On your iPhone:
- Go to Settings > Messages > Send & Receive > You Can Be Reached By, and add a check to both your phone number and email address.
- Go to Messages > Text Message Forwarding, and enable the device(s) you would like to forward messages to.
- Your Mac, iPad, or iPod touch will display a code. Enter this code on your iPhone to verify the SMS feature.
If you did all of that and still do not see the code, make sure that you are signed into iCloud in Settings>iCloud. If all of that has been set up as it should be, try signing out of your Apple ID in Settings>iTunes & App Store>Apple ID. Restart your iPad then go back to the settings and sign in again.