Can i put an 05 4.6 from expedition into a 97 f150
AFAIK, you would have to bring the computer and wireing harness along with it. I don't know much about PATS, but if the '05 has it, you've got to deal with that as well. Best bring engine and trans together along with all electronics.
There might be a simpler way to go, like just using the long block and bolting everything induction, exhaust, electrical, sensor etc from your motor to it.