My wife is in 40th week of pregnancy. Scanning reports are normal. Doctors have prescribed magnesium sulphate injection. Why is that prescribed?

Unusual. Magnesium sulfate is often used to treat preterm labor (@40 wks, that's not it...). We also use it for seizure prophylaxis (prevention) if diagnosis is preeclampsia (pih, toxemia). It's given via an IV unless there is no IV access in emergencies & the dose is 8-10 grams im (rarely done). Ask your OB what the indication is & like all docs, they should explain any med or treatment you are receiving.
Unusual. Magnesium sulfate has four main uses in pregnancy: 1. To stop preterm labor for the administration of corticosteroids, 2. For neuroprotection of a preterm fetus, 3. To replace magnesium in patients with low magnesium, 4. Seizure treatment and prophylaxis in pre eclampsia. At 40wks it can still be used to hold off labor in special circumstances such as varicella infection.