The observation deck at NRT is landside, i.e. you'll have to clear Japanese immigration and customs to get there. Not exactly worth it for a 2-hour layover. However, there are plenty of huge windows at Terminal 1 (where UA operates out of) to see most of the action at the main runway (remember, NRT now has two runways), although you'll be looking into the sun in the afternoon. As for the airside shopping in Terminal 1, I don't recall seeing anything particularly interesting. Pretty much the standard stuff like electronics, books & magazines, a few overpriced cafes, duty-free tobacco, alcohol and perfumes, etc. No aviation-related shops that I can think of. There are a few airside shops over at Terminal 2 (where JAL & ANA operates) where they sell JAL and ANA memorabilia, including huge inflatable Jumbo jets!! But I don't think you can go freely between T1 and T2 airside, unless you show a ticket/boarding pass from an airline that operates at the other terminal.
Haven't been to SFO for ages, so I can't comment on that.