Upvote:9
You must obtain prior approval from the Ministry of Health, Labor, and Welfare. The forms are here: fill them and mail them to the bureau with jurisdiction over your port of entry (address on the last page), along with a prescription, a self-addressed envelope and an International Reply Coupon (or Japanese stamps if you can get them). Then wait for it to come back, and keep it with you when you pass customs. Since codeine is a "restricted article", you must declare it (this will be mentioned on the customs form you will be given on the plane).