Skip to Content

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

Add leading Zeros

Hi all,

I want to add leading zeros for a number which is of type character.

For example

Data : w_lan type char12.

w_lan = 4030.00

i want this to be w_lan = 000004030.00

The function modules CONVERSION_EXIT_ALPHA_OUTPUT and CONVERSION_EXIT_ALPHA_INPUT wont work in this case. Suggest some other way .



Former Member
Former Member replied


calculate the string length and loop it and concatenate 0 and the number untill u get the desired status .....

l = strlen(w_lan).

v = 0.

while l < 10.

concatenate v to l into target.


now the value will be stored in the target.

reagrds .

chandu reddy.

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