Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to make each column of the file with a fixed width

Hello

I have a "MII Transaction" and need to create a TXT file where each column is separated by a delimiter character ";" and also each column will have its fixed size.

With the action "Write File" and a simple "Repeater" I have created the file with delimiter ";" character. But now I'm looking for ideas on how to make each column of the file with a fixed width. Any suggestions?

Former Member
replied

Hi Michel,

If you want to do it inside the Expression Editor, this will work:

stringleft(<columnvalue> & Local.PadString, Local.ColumnWidth)

Where <columnvalue> is the string you want to pad out to the ColumnWidth length using the PadString.

You can left-pad the value to a fixed length in a similar manner using stringpart() .

Regards, Steve

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question