51 23 100 Removing and installing/replacing right engine compartment lid lock
WARNING: This page does not describe the selected car, but rather 21 other vehicles, including the 2017 BMW 550i GT xDrive, 2017 BMW 535i GT xDrive, 2017 BMW 535i GT, 2016 BMW 550i GT xDrive, and 2016 BMW 535i GT xDrive. However, it is still accessible from the selected car via links, so may be relevant.
Operations are described in:
Removing and installing/replacing LEFT ENGINE COMPARTMENT LID LOCK
Operations on right side analogous to left side shown. Use graphics in a mirror-inverted way.