2010 Oct 05 12:34 PM
Hi Gurus
How can we add Serial Number in SAP Query? There is a field named Counter which gives Total number of count. But i need numbers to be displayed with each line item.
2010 Oct 06 6:01 PM
Hi MAZ,
What means "Serial Number" for you? please be more specific...
Do you mean a field with unique number across all live of table?
2010 Oct 07 7:07 AM
2010 Oct 07 5:17 PM
OK,
So you need to create a Number Range Object (tr SNRO), this create a object like ZNUM.
then, each time you need insert a new record to table only call this FM:
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = '01'
object = 'ZNUM'
IMPORTING
number = itab-field
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.
at this point, ITAB-FIELD contains the next number in the range ZNUM.
I hope this help,
X.S.