I know that, with the FM - NUMBER_GET_NEXT_V1, I can get the next # for most document #s.
But, this FM is ONLY applicable to INTERNAL NUMBER RANGE.
1 - But., am working with EXTERNAL NUMBER RANGE, so looking forward for a FM/BAPI, which gives me next free # for use.
2 - If nothing is there, How to get it done? Is directly grabbing the latest # from the table/data base?
3 - Any other ideas?
You can try writing a wrapper to RFC enable the FM NUMBER_GET_NEXT_V1,. Note though, whether you use this approach or the ggrab-last-rec-# approach, there is no protection that the number selected will not get used while you are still processing in the external function, since SAP does not 'know' that an instance of get-nest_number is in use. Of course, if you hare doing this to populate your custome Y or Z table, and you have complete knowledge of what all occassions the number range is called, you are in the clear.
For an example
Look at Attributes for SAP function ' L_TO_CONFIRM_SU' . Observe the radio button 'REmote-enabled function module - 2nd one.
Then you can see under source code it calls other SAP FMs. This is where you call the SAP FM you found.
A remote enabled fm requires a Logical destination when called from a program- you might already know that.