Widebody; Low Wing; 2 Turbojet Eng
Flight Crew Multiengine; Flight Crew Air Transport Pilot (ATP); Flight Crew Instrument
ATC Issue All Types; Deviation - Speed All Types; Inflight Event / Encounter Wake Vortex Encounter
Flight Crew Took Evasive Action
Environment - Non Weather Related; Procedure
We were following a heavy 787 on departure from NRT on 34L; and were quite heavy ourselves (405;000 lbs or more).  Vref 30+40 was 215 KIAS and Vref 30+80 was 255 KIAS; so we had to use the airspeed tape F bug to retract Flaps 1; approximately 241 KIAS.  Turbulence from the 787's wake struck as we retracted Flaps 1; causing the airspeed to increase faster than the AP (autopilot) could compensate; and because of the small margin between 241 KIAS and the 250 max for Flaps 1; I disengaged the AP to gently pitch up in order to not exceed 250 KIAS until the flaps were up.  The clacker went off for less than a second before the flaps fully retracted and we continued with a high-speed climb out of 265-270 KIAS (we had requested and were approved for high-speed by ATC when we retracted Flaps 5 to 1) and flew normally down to ZZZZ.  I wrote up the flap overspeed; which lasted less than a second and did not appear to exceed 252 KIAS until the flaps had fully retracted; and informed maintenance after landing.
Air Carrier Captain reported experiencing a momentary stall warning after encountering wake turbulence departing RJAA in trail of a heavy B787.