Skip to Content

Number Format leading with zero

Dear Expert,

I'd like to know how can I format the number that are generated from NumberRange.DrawNumber("XXXXX");

Ex. result = NumberRange.DrawNumber("XXXXX") ; // return 5

Then I need the output is "PO000005"

Best Regards,

Krit R.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jan 13, 2016 at 11:17 AM

    Hi Kirt R,

    I think SAP don't have any function to format number values and I don't know for what purpose you want this format 😕 . If you want the leading zero format as a constant format, you can hard-code it in scripting.😎

    hardcode.PNG (2.9 kB)
    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Senz

      Thank you very much.

      However I decide to create ShareLibrary for this purpose.

      The function take 2 parameters expected length and base number.

      Then I subtract the length of those 2 parameters and find the remain number of zero that should be added in base number as prefix.

      Best Regards,

  • Posted on Jan 14, 2016 at 03:41 PM

    Hi Krit,

    there is a Build-in Function for Identifiers AddLeadingsZeros (hier is a Link, ->Build-In Functions->Build-In Functions for Identifiers)



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.