<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Create new serial number in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-new-serial-number/m-p/1783677#M337638</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chk this sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;General - Number Range Generation &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; INCLUDE ZRANGENO.

data: wnorange like INRI-NRRANGENR,      "number range,
      wsubobj  like inri-SUBOBJECT,            "sub object
      wdocno(12).

* Steps :-
* 1. Number range Sub Object must be maintain in table ZSGRP
*    You can used transaction SE16 to create a table entries.
* 2. Maintain number range and intervals in transaction code SNUM
*

*

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 &amp;lt;&amp;gt; 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anver&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 17 Dec 2006 08:40:42 GMT</pubDate>
    <dc:creator>anversha_s</dc:creator>
    <dc:date>2006-12-17T08:40:42Z</dc:date>
    <item>
      <title>Create new serial number</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-new-serial-number/m-p/1783675#M337636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am looking for FM which creates new serial number.&lt;/P&gt;&lt;P&gt;Thanks in advanced,&lt;/P&gt;&lt;P&gt;Assaf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Dec 2006 08:19:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-new-serial-number/m-p/1783675#M337636</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-17T08:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create new serial number</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-new-serial-number/m-p/1783676#M337637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are looking to get the next number from a Serial Number Range object that you have, then you will have to use the NUMBER_GET_NEXT function module and pass the Number Range object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;Note - Please mark all the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Dec 2006 08:35:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-new-serial-number/m-p/1783676#M337637</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-17T08:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create new serial number</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-new-serial-number/m-p/1783677#M337638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chk this sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;General - Number Range Generation &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; INCLUDE ZRANGENO.

data: wnorange like INRI-NRRANGENR,      "number range,
      wsubobj  like inri-SUBOBJECT,            "sub object
      wdocno(12).

* Steps :-
* 1. Number range Sub Object must be maintain in table ZSGRP
*    You can used transaction SE16 to create a table entries.
* 2. Maintain number range and intervals in transaction code SNUM
*

*

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 &amp;lt;&amp;gt; 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anver&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Dec 2006 08:40:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-new-serial-number/m-p/1783677#M337638</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2006-12-17T08:40:42Z</dc:date>
    </item>
  </channel>
</rss>

