Abdominal muscle spasms and cramps can be caused by muscle overuse and injury, low levels of calcium and potassium, dehydration, alcoholism, hypothyroidism (underactive thyroid), certain medication, pregnancy, menstruation, and kidney failure. Applying heat to the muscle for 15 minute intervals, properly stretching, drinking plenty of fluids, and getting enough potassium and calcium in your diet may help prevent worse muscle spasms in the future.