Skip to Content

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

add 0's

How to fill a char variable with 0's to the right?

For example:

v = 'abc'.

And if the length of data element is 8 i would like :

v = 'abc00000'

Thanks

Tags:
Former Member
Former Member replied
DATA: lenght TYPE i.
DATA: diff TYPE i.

lenght = strlen( v ).
diff = 8 - lenght.

DO diff TIMES.
  CONCATENATE v '0' INTO v.
ENDDO.

Regards,

Valter Oliveira.

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