You'll have to check that specific code first. However, its most likely a transfer case issue, and a common problem on electronic shift transfer cases is the the encoder motor that shifts the case. But don't start throwing parts at it until you pin-point the problem. Other common issues with the transfer case are speed sensors, dash switches and sometimes the transfer case control mondule. The only "cheap" thing in that list is the dash switch and even then its about $70. The encoder motor is about $500 last time I checked.