on 06-20-2008 4:25 PM
Hi,
Do we have any stnd FM/Program which generates a unique number based on the combinations of the incoming data!
Appreciate your help and <removed_by_moderator>
Edited by: Julius Bussche on Jun 24, 2008 6:52 PM
Hi,
First creat NUMBER RANGE in SNRO tcode,
next use below code:
CALL FUNCTION 'NUMBER_RANGE_ENQUEUE'
EXPORTING
object = w_object
EXCEPTIONS
foreign_lock = 1
object_not_found = 2
system_failure = 3
OTHERS = 4.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = '01'
object = w_object
IMPORTING
number = zcor_header-cornr
EXCEPTIONS
interval_not_found = 1
number_range_not_intern = 2
object_not_found = 3
quantity_is_0 = 4
quantity_is_not_1 = 5
interval_overflow = 6
buffer_overflow = 7
OTHERS = 8.
CALL FUNCTION 'NUMBER_RANGE_DEQUEUE'
EXPORTING
object = w_object
EXCEPTIONS
object_not_found = 1
OTHERS = 2.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My requirement is, I have a falt file coming in with 5 fields. First field is blank and we have data for the next 4 fields. I have created a table with 5 fields and now need to upload the data from the file by assigning a unique number to the first field, based on each unique combination of the last 4 fields data.
Hi Venu,
YOu have to create a Number range Object for your Z table key field.
check this link:
http://www.saptechnical.com/Tutorials/ABAP/SNRO/SNRO.htm
Regards,
Ravi kanth talagana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I create a Number Range Object for my Z Object, can I assing my own value to it instead of fetching it from Number Range interval during loading!
Like for ZABC, i have my interval as 0001-999
But in my loading i wanted to give it as 1200 which is away from the above interval, I mean i dont want to access any Number Range object for some cases.!
Try FM: AL_LAZY_GET_UNIQUE_NO
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.