Skip to Content

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

Formatting input field from 123456789 to 123-45-6789

Hi all,

I need to format an input field. When the user enters a value like 123456789, I need to default it to looks like 123-45-6789. After that I need to save the 123-45-6789 back as 123456789. Anyone have any ideas? Thanks.

Former Member
replied

Hi Siong,

You can try out following statement

DATA: input(9) type c,

output(11) type c.

input = '123456789'.

concatenate input(3) '-' input3(2) '-' input5 into output.

write:/ output.

The output should be

123-45-6789

Regards

Abhinav Sharma

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