Praise be to Allah.
There is nothing wrong with writing a letter stating salary details for employees who request that, unless it is to be submitted to a riba-based bank with the aim of taking out a loan. In that case it is not permissible to write it, because that is helping them to disobey Allaah, and to commit a major sin.
The Standing Committee (15/58) was asked about an employee in the copy department of a university who wrote letters for the university employees so that they could take riba-based loans from one of the banks – is that permissible?
It is not permissible to make these copies or write these letters if the one who is doing that knows that the letter will help the person to engage in riba-based transactions, because of the general meaning of the hadeeth according to which the Messenger of Allaah (peace and blessings of Allaah be upon him) cursed the one who consumes riba, the one who pays it, the one who writes it down and the two who witness it, and he said: they are all the same. Narrated by Muslim in his Saheeh. And because of the general meaning of the verse in which Allaah says (interpretation of the meaning):
“Help you one another in Al‑Birr and At‑Taqwa (virtue, righteousness and piety); but do not help one another in sin and transgression”
And Allaah knows best.