Narrative:

On departure from runway xxl from ZZZ; we were to fly the RNAV departure to zzzzz. When we took the runway; I saw zzzzz on my lower display screen. We took off and at 400 feet [and] I called for LNAV. Soon after VNAV was engaged; the aircraft turned left. I looked over the yoke to see where the aircraft was headed; I saw ZZZZZ1 as the active waypoint. It was at this time ATC asked if we were turning to zzzzz; we said we were flying the departure route. They told us to turn to heading 300; then shortly after; said make an immediate turn to 320 [heading]. I disengaged the autopilot and made a sharp right turn to 320 [heading]; I could see another aircraft off to our left that looked to be somewhere between 500 to 1;000 feet below us. We rejoined the departure route with no other incident. In our turn to the 320 heading; we did receive one traffic warning from our TCAS. This could have been avoided had I not let myself get rushed and double checked the first officer's FMC route inputs. He had mistakenly put in runway xyl not runway xxl; which was our departure runway. I also should have looked over the yoke to make sure of the first point on the RNAV route. I failed to slow down and double check; it is my fault the incident happened.

Google
 

Original NASA ASRS Text

Title: Air carrier flight crew reported improper FMS programing resulted in an airborne conflict.

Narrative: On departure from RWY XXL from ZZZ; we were to fly the RNAV departure to ZZZZZ. When we took the runway; I saw ZZZZZ on my lower display screen. We took off and at 400 feet [and] I called for LNAV. Soon after VNAV was engaged; the aircraft turned left. I looked over the yoke to see where the aircraft was headed; I saw ZZZZZ1 as the active waypoint. It was at this time ATC asked if we were turning to ZZZZZ; we said we were flying the departure route. They told us to turn to heading 300; then shortly after; said make an immediate turn to 320 [heading]. I disengaged the autopilot and made a sharp right turn to 320 [heading]; I could see another aircraft off to our left that looked to be somewhere between 500 to 1;000 feet below us. We rejoined the departure route with no other incident. In our turn to the 320 heading; we did receive one traffic warning from our TCAS. This could have been avoided had I not let myself get rushed and double checked the First Officer's FMC route inputs. He had mistakenly put in RWY XYL not RWY XXL; which was our departure runway. I also should have looked over the yoke to make sure of the first point on the RNAV route. I failed to slow down and double check; it is my fault the incident happened.

Data retrieved from NASA's ASRS site and automatically converted to unabbreviated mixed upper/lowercase text. This report is for informational purposes with no guarantee of accuracy. See NASA's ASRS site for official report.