If you've had shoulder surgery, even getting your hand behind your neck can be difficult.
The problem is that many people start to avoid these more difficult motions, and gradually lose function in the joint.
The hand behind the neck movement is actually a form of lateral rotation, which is an essential plane of motion for the shoulder to function fully.
In the early days following surgery or an injury it may be that you don't have enough shoulder flexion to perform this exercise. In this case perform the alternative lateral rotation that is detailed below.
The first exercise is simple - simply lift your arm, and bend at the elbow to reach behind your neck. That's simple enough, but the trick is to do so while keeping your elbow out to the side. If your elbow moves forward, then you are performing shoulder flexion, but no lateral rotation.
If you don't have the shoulder flexion to do this, try this alternative:
Stand with your arm against your side. The arm needs to stay there throughout the movement, so you might like to hold a small rolled-up towel between the upper arm and the ribcage to avoiding this.
Bend your arms to 90 degrees and cross them over your stomach as if you were crossing your arms. Then, keeping your elbow tight in to your side and bent, rotate your hand and forearm outwards as far as is comfortable. Relax and repeat ten times.