<?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: Serial number generation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/serial-number-generation/m-p/4063136#M971245</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chk this link..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/table%2bmaintenance%2bin%2babap]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward If helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sachin M M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Jun 2008 10:54:53 GMT</pubDate>
    <dc:creator>sachin_mathapati</dc:creator>
    <dc:date>2008-06-30T10:54:53Z</dc:date>
    <item>
      <title>Serial number generation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/serial-number-generation/m-p/4063131#M971240</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;I have a Z table, it has a component serial no.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is to auto generate a serial no. when a record is inserted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me solve the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Sai.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2008 10:50:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/serial-number-generation/m-p/4063131#M971240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-30T10:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: Serial number generation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/serial-number-generation/m-p/4063132#M971241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;YOu have to create a number range for your Z table:&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/b4/185f28179c4f3cb8d00988cd139500/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/b4/185f28179c4f3cb8d00988cd139500/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YOu have to use the function module:&lt;/P&gt;&lt;P&gt;NUMBER_GET_NEXT to get the next free number in your number range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2008 10:53:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/serial-number-generation/m-p/4063132#M971241</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-30T10:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Serial number generation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/serial-number-generation/m-p/4063133#M971242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi...&lt;/P&gt;&lt;P&gt;Before using the insert statement,&lt;/P&gt;&lt;P&gt;read the last record , u ll get the current value of the field and add 1 to it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this ll be simple 2 line code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;vinsee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2008 10:53:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/serial-number-generation/m-p/4063133#M971242</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-30T10:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: Serial number generation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/serial-number-generation/m-p/4063134#M971243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;from where ll u insert the record, se11 or u ll code some thiing&lt;/P&gt;&lt;P&gt;if u code then it is very simple.send me the further information.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2008 10:53:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/serial-number-generation/m-p/4063134#M971243</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-30T10:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Serial number generation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/serial-number-generation/m-p/4063135#M971244</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;Define a number range object using tcode "SNUM" for data element serial no. and generate next number using function module "NUMBER_GET_NEXT" passing object no.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2008 10:53:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/serial-number-generation/m-p/4063135#M971244</guid>
      <dc:creator>alpesh_saparia3</dc:creator>
      <dc:date>2008-06-30T10:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Serial number generation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/serial-number-generation/m-p/4063136#M971245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chk this link..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/table%2bmaintenance%2bin%2babap]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward If helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sachin M M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2008 10:54:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/serial-number-generation/m-p/4063136#M971245</guid>
      <dc:creator>sachin_mathapati</dc:creator>
      <dc:date>2008-06-30T10:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Serial number generation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/serial-number-generation/m-p/4063137#M971246</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;Thanks for your help, I am inserting records into Z table from an alv grid. I this is done when the user performs save.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which is the best way to handle this sutation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Sai.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2008 11:01:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/serial-number-generation/m-p/4063137#M971246</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-30T11:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Serial number generation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/serial-number-generation/m-p/4063138#M971247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mohan Das,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function module you have to use is &lt;STRONG&gt;Number_get_next.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Check out the sample implementation of that Function module..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA:
NUMBER TYPE I.

CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
   nr_range_nr = '01'
   object = 'ZDEMO'
IMPORTING  
  NUMBER = NUMBER
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
.
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.

Write :/ 'Next available number is: ', Number.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before doing the above process check in SNUM transaction whether the number range has buffering or not.&lt;/P&gt;&lt;P&gt;so, if you do not want to have any gaps on your range, on transaction SNUM , from the menu choose "Edit -&amp;gt; Set-up buffering":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 - no buffering (with this you will have gaps on your range)&lt;/P&gt;&lt;P&gt;2 - main memory (no gaps on your range)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On both you have to consider your "update methods". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this would help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Narin Nandivada.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Narin Nandivada on Jun 30, 2008 4:44 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2008 11:12:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/serial-number-generation/m-p/4063138#M971247</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-30T11:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Serial number generation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/serial-number-generation/m-p/4063139#M971248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Create a Number range using the Transaction SNRO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By doing this you can create a number range object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NUMBER_GET_INFO &lt;/P&gt;&lt;P&gt; Number range: Provides information for a number range number&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;VIjay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2008 11:56:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/serial-number-generation/m-p/4063139#M971248</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-30T11:56:48Z</dc:date>
    </item>
  </channel>
</rss>

