I been having very little spotting &cramping for the last 4days now it stopped but I started getting cramps on my upper stomach while having sex. Help!?

Probably nothing. If its related to sex, pain in the upper abdomen is probably pain from the lower abdomen/pelvis that is referred, meaning it just feels like its in the upper abdomen but it really is from the lower abdomen. That is common with abdominal pain. Take some Ibuprofen and see if it improves. If not, you may need an evaluation by your doctor to look for reasons why it hurts with sex.
PID. Better see your gyn to make sure you have not contracted pid, pelvic inflamatory disease.