RE: How a Code datatype field can be auto-incremented
[quote user="Mohana Yadav"]
IncrementDocumentNo function will be doing the same so why to reinvent the wheel?

[/quote]
There can be many situation where you want to increment a code field or a text string without connecting a no, series to it. And in those cases incstr is the correct way to handle it.
There can also be situations where using the NoSeriesManagement codeunit causes locking in your system, then you need and alternative way to increase your code field.
So "one wheel" does not always fit all scenarios.