He said that he ______ the letter.
He said that he ______ the letter.
Explanation
The reporting verb "said" is in the past tense, so the reported speech must also shift to the past perfect.
Therefore, "He said that he had written the letter" is the correct indirect narration.