This is a total shot in the dark but it could be the linkage underneath the truck. It's basically just a flat metal bar(arm) with a bolt attached to it. It could be loose. Also, how are the shift bushings?
It wouldn't be solenoids unless there was a problem with shifting through gears while in "D".
Shifting into Park/Neutral/Reverse is purely a mechanical thing and doesn't involve any shift solenoids.
I would check your fluid and the shift linkage first.
BTW, what year is your truck and how many miles? When was the fluid last changed? The fact that you have a code for a solenoid means you may have a few problems with your tranny.