My wall drain pipe clears the vanity, but there is not enough depth for trap. That's why I am thinking running a 90 degree bend out of the wall upward. My concern is losing the trap seal.
Since wall drain pipe clears the vanity, I am thinking running 90 degree going up and then attaching the rest to the p-trap.
Not sure if this matters. Within the wall, drain pipe doesn't go straight down. It turns left and goes towards toilet.
Best Answer
No you can't do that.
The P-trap depends on the weir which requires critical trap arm length and a slope that does not siphon the trap dry. Your drawing siphons the trap. You could add an aav but opening the wall might be easier.
https://www.jlconline.com/how-to/plumbing/maximum-length-for-fixture-drains_o
The other thing I've done is to make the p-trap assembly in a straight line to the back of the cabinet and then make a cut out in the shelf to accommodate the trap. I've done this with both drawers and with shelves.