Skip to Content

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

Fill in with leading zeroes


I need to fill the zeroes to my Target field.

Source Field : ControlID

FieldDescription : Max. 16

Target Field : DocNum

Rule : Fill in with leading zeroes to a length of 16.

Please help me on this...

Thanks & Regards,


Former Member
Former Member replied

this UDF should work

int len=a.length(); // a is input string

for(int i=0; i<16-len;i++)

return a;

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