make sure that the IDOC has no material number and it will post using the next number from the internal number range
Or use the function module NUMBER_GET_NEXT to fetch an internal number from your number range when you create the IDOC..
Who is creating the Idoc? What is the process?