Yes, trapped wind / gas is a common cause of abdominal pain (especially cramping abdominal pain) and can be very uncomfortable.
Whenever you swallow (food, drink, saliva etc.) small amounts of air are also swallowed. This air enters the digestive system and can build up. Some people find certain types of food increase the amount of air swallowed.
The air in the digestive system can become trapped causing abdominal cramps/pain and bloating. Some people find the pain from trapped wind/gas can be incredibly severe and debilitating.
Most trapped wind resolves itself naturally. However certain medical conditions such as Irritable Bowel Syndrome (IBS) can increase the risk of trapped wind and may require additional medications to resolve the problem. A common medication given for trapped wind is antispasmodic medication such as Buscopan.