07-31-2008 4:52 AM
Hi Experts,
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?
thanq
07-31-2008 5:09 AM
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.
07-31-2008 4:55 AM
You can use:
select max( fldname ) into ws_next from tablename .......
ws_next = ws_next + 1
will give you the next number.
Regards,
Subramanian
07-31-2008 5:09 AM
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.
07-31-2008 5:47 AM
thanq
good analysis.
can i hv some breif idea/logic that, How to write a wrapper for RFC for get_next_number FM?
thanq
07-31-2008 6:07 AM
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.