I have flown several trips with code shared segments. It can be pretty confusing sometimes (read my blog post on
challenges with Code-shares). In your case, as UA and ANA are partners, you should have no problem at all.
Make sure though, that you have the UA and ANA confirmation codes. There will be two. If you go to the UA website and look on your 'My Itineraries' page, it should show both. The reason for this is that should need to talk to ANA, they will see your ANA confirmation code only in their system.