How come I cramp when I exercise even though I am not on my period?

Blood flow . Exercise moves blood out of your organs and into your muscles. If your organs were busy doing something like digesting food, the sudden rerouting of blood flow can cause the functioning of the organ to be disturbed because it is suddenly getting less oxygen. That's why warming up and not eating right before exercise helps easy the transition. See your doctor if that persists after trying this.
Two different things. You can cramp when you exercise for a variety of reasons including insufficient warm up, fatigue, etc.. These cramps can happen in a muscle in your arm, your leg, your belly, or your back. The cramp during your period is a menstrual cramp. This has nothing to do with exercising.