mine also having same issue last week..after flashing some mods my s4 suddenly lost connection.Bar signal up and down like crazy.When i try to access ussd code it show "no network registered".
I try everything such as flash stock rom few times, wipe data/factory reset and do rooting process on every stock roms.But it seems noting chg..At last i send to Samsung service centre to check wht going on with my s4..After half an hour it done..everything back to nornal.I ask to tech person, they inf. that my S4 just missing few digit of imei..So, they might do recovery imei.
My S4 rockin' again.
My current device : hTC One Black 32gb stock
Device history from 2011 until today :
hTC Flyer 32gb by Maxis, Galaxy Ace 2 GT-i8160, iphone 4s 32gb by Maxis, Galaxy W GT-i8150 , s.e CK13i, )s.e Xperia Ray, hTC Desire C by Maxis, iphone 4 16gb (Locked by AT&T), Blackberry Bold 3 9780 (use for 2 days only), Galaxy S3 i9300, ́phone 3GS 32gb, Nokia Lumia 520, Samsung Galaxy S4 i9500 16gb Black mist..