The code “D” that is associated with the 401k contribution does not have any bearing on the position in box 12 that the information prints. From the IRS W-2/W-3 instructions:
“Box 12 – Codes. Complete and code this box…. Note that the codes do not relate to where they should be entered for boxes 12a-12d on Form W-2.”
If you wish more explanation regarding printing of your W-2 information, there is a copy of the W-2/W-3 instructions in pdf format located in the IRS forms folder inside the Payroll folder on the hard drive of your computer, or you can download a copy from the IRS web site.