<?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: Regarding the function module Number_Get_Next in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596527#M1083692</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 function you need to create Number Range Object&lt;/P&gt;&lt;P&gt;using tcode OYSN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vishal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Oct 2008 07:03:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-15T07:03:10Z</dc:date>
    <item>
      <title>Regarding the function module Number_Get_Next</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596525#M1083690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      We have created one custom transaction. We need to generate one number when we save. The number will be generated using the function module NUMBER_GET_NEXT. How can i capture the number which will be generated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When we create Sales Order, the sales order number gets generated and that number will go to the DB Table right. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly i need to save the number in one custom table which gets generated for my transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ibrahim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2008 06:54:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596525#M1083690</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-15T06:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding the function module Number_Get_Next</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596526#M1083691</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;The code should be like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF RANGE_OPEN IS INITIAL.
      CALL FUNCTION 'NUMBER_GET_INFO'
           EXPORTING
                NR_RANGE_NR        = &amp;lt;Nr range&amp;gt;
                OBJECT             = &amp;lt;Object range&amp;gt;
           EXCEPTIONS
                INTERVAL_NOT_FOUND = 1
                OBJECT_NOT_FOUND   = 2
                OTHERS             = 3.
      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.
      RANGE_OPEN = 'X'.
    ENDIF.

    CHECK RANGE_OPEN = 'X'..

    CALL FUNCTION 'NUMBER_GET_NEXT'
         EXPORTING
              NR_RANGE_NR             = &amp;lt;Nr range&amp;gt;
              OBJECT                  = &amp;lt;Object range&amp;gt;
         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.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I don't understand if you need an your own number or the number used for the sales order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2008 07:00:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596526#M1083691</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-15T07:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding the function module Number_Get_Next</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596527#M1083692</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 function you need to create Number Range Object&lt;/P&gt;&lt;P&gt;using tcode OYSN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vishal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2008 07:03:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596527#M1083692</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-15T07:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding the function module Number_Get_Next</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596528#M1083693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ibrahim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When ever any user want to create a record throught your custom transactions into your custom table, frist lock the table custom table, then get the max of the incrementing filed ,&lt;/P&gt;&lt;P&gt;then pass that value to the FM you will get the next record number , then insert the data, commit it.&lt;/P&gt;&lt;P&gt;then you unlock your custom table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;comment on it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Kumar M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2008 07:06:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596528#M1083693</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-15T07:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding the function module Number_Get_Next</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596529#M1083694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Max,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       i just gave the example of Sales Order. I need my own number. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     I guess, the importing parameter of this function module will give me the generated number. Am i right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2008 07:17:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596529#M1083694</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-15T07:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding the function module Number_Get_Next</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596530#M1083695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When assigning numbers internally, call the function module NUMBER_GET_NEXT in order to determine the next number(s) available.&lt;/P&gt;&lt;P&gt;	If you have asked for more than one number using the import parameter QUANTITY, the last number assigned will be inserted into the export parameter NUMBER after the function module call. (The numbers available thus lie within the interval: (NUMBER - QUANTITY + 1) to NUMBER.)&lt;/P&gt;&lt;P&gt;	Whenever the last number of the interval has been assigned, number assignment begins again with the interval's initial number!&lt;/P&gt;&lt;P&gt;	The return code allows you to see if the number can be assigned without any problems, or if it lies within a critical area.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2008 07:21:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596530#M1083695</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-15T07:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding the function module Number_Get_Next</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596531#M1083696</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;Maintain number range and intervals in transaction code SNUM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this in code..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2008 07:22:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596531#M1083696</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-15T07:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding the function module Number_Get_Next</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596532#M1083697</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;You need to create number range object using transaction 'SNRO' where you would provid number range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In FM '&lt;STRONG&gt;NUMBER_GET_NEXT&lt;/STRONG&gt;', you have to provide the number range object as export parameter. You can capture the next generated number in IMPORT parameter of this FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this information helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Phani Diwakar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2008 08:13:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596532#M1083697</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-15T08:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding the function module Number_Get_Next</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596533#M1083698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What should we pass to the exporting paramater NR_RANGE_NR of the fn. module NUMBER_GET_NEXT?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ibrahim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 13:37:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596533#M1083698</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-21T13:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding the function module Number_Get_Next</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596534#M1083699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Go to tcode SNUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Give the Object name (ZOWNNO)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Press the button "NUMBER RANGES'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Press 'STATUS'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. u see the value under 'NO' in the table ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    that is the 'nr_range_nr' eg. '01'....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 05:08:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-the-function-module-number-get-next/m-p/4596534#M1083699</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-22T05:08:48Z</dc:date>
    </item>
  </channel>
</rss>

