Saying the OK Google hotword is detected by the Google Now service and opens up the Google search app. To enable OK Google on Galaxy S7 (Edge) from any screen, you just need to do as follows:
1. Open the Google app on your Galaxy S7 or S7e
2. Tap the 3-small-line icon on the top left of the screen and touch the Settings option
3. Under the Search & Now settings, Open the Voice settings
4. Go to the "Ok Google" detection settings
5. Now make sure, both From the Google app and From any screen options are toggled ON (You may have to repeat the OK Goolge hotword in order to let the device identify how you pronounce it
6. From now on, to get the most of your Google Now and Google Search, you just need to say OK Google from any screen.
Tip: If the OK Google is not working on your Galaxy S7 (Edge) and it doesn't detect your voice, make sure both the options are toggled ON and try deleting your current voice model and record a new one.