‎2008 Oct 23 5:50 AM
Hi Experts,
i have a requirment to create SERIAL No for a serialized material so please let me know the name of required bapi for this.
THANKS AND REGARDS
SWATI
‎2008 Oct 23 6:01 AM
Hi,
u can do this by Number Ranges...
Hi,
Maintain number range and intervals in transaction code SNUM
Use this in code..
call function 'NUMBER_RANGE_ENQUEUE'
exporting
object = 'ZOWNNO' "Create with SNUM
exceptions
foreign_lock = 1
object_not_found = 2
system_failure = 3
others = 4.
if sy-subrc ne 0.
* message e086 with 'Lock error' sy-subrc.
endif.
call function 'NUMBER_GET_NEXT'
exporting
nr_range_nr = wnorange
object = 'ZOWNNO'
subobject = wsubobj
importing
number = wdocno "Number generated by SAP
exceptions
interval_not_found = 1
number_range_not_intern = 2
object_not_found = 3
quantity_is_0 = 4
quantity_is_not_1 = 5
internal_overflow = 6
others = 7.
if sy-subrc ne 0.
* message e086 with 'Number Range' sy-subrc.
endif.
call function 'NUMBER_RANGE_DEQUEUE'
exporting
object = 'ZOWNNO'.
if sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
‎2008 Oct 23 6:02 AM
‎2008 Oct 23 6:11 AM
Try BAPI_MATERIAL_GETINTNUMBER for getting the next no of material for a material type
Regards
Shiba Prasad Dutta