See here:
How to forward SMS/MMS text messages from your iPhone to your iPad, iPod touch or Mac - Apple Support
As long as your iPhone is turned on and connected to Wi-Fi or a cellular
network, new SMS/MMS texts can be sent and received on the devices that
you added.
Since your phone will be off while its serviced, SMs and MMS messages will not be received on your iPad..
Users if Apple devices can continue to message you normally, and they should be received on your iPad as long as they are sent as an iMessage.
Users of Android devices or Apple devices sending SMS messages will need to find a different way to message you as those will not be received by your iPad, while your iPhone is not available.
Apple devices users will need to use iMessage, and Android users will need other messaging services if you have them such as Skype, or Facebook Messenger if you use them.
Also, if you use Whatsapp, it will not work on the iPad either.