<?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: FM in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm/m-p/2595970#M594573</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 function module assigns the next free numbers of a number range. A number is assigned as a default if no larger number is demanded in the parameter QUANTITY. If more than one number is demanded and not enough numbers are available up to the interval limit, the numbers are only assigned up to the interval limit. If the last number was assigned, the first interval number is provided again during the next call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The length of the number depends on the definition of the number range object. However, the length is not determined from the definition when allocating, but is calculated from the length of th from-number of the number range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All exceptions are created with MESSAGE ... RAISING ... .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Object HUGO, not year-dependent, next free number searched for&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: RC         LIKE INRI-RETURNCODE,&lt;/P&gt;&lt;P&gt;      NUMBER(10) TYPE C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   CALL FUNCTION 'NUMBER_GET_NEXT'&lt;/P&gt;&lt;P&gt;        EXPORTING OBJECT          = 'HUGO'&lt;/P&gt;&lt;P&gt;                    NR_RANGE_NR     = '01'&lt;/P&gt;&lt;P&gt;        IMPORTING RETURNCODE      = RC&lt;/P&gt;&lt;P&gt;                    NUMBER          = NUMBER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   CASE RC.&lt;/P&gt;&lt;P&gt;     WHEN ' '.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     everything o.k.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     WHEN '1'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     the assigned number lies in the critical area.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     WHEN '2'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     this was the last number, next time the first number&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      will be assigned&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Object EGON, year-dependent, next 5 free numbers for 1992 in company code 0001 searched for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: RC         LIKE INRI-RETURNCODE,&lt;/P&gt;&lt;P&gt;      NUMBER(10) TYPE C,&lt;/P&gt;&lt;P&gt;      YEAR       LIKE INRI-TOYEAR,&lt;/P&gt;&lt;P&gt;      QUAN       LIKE INRI-QUANTITY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   YEAR          = '1992'.&lt;/P&gt;&lt;P&gt;   QUAN          = 5.&lt;/P&gt;&lt;P&gt;   T001-BUKRS    = '0001'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   CALL FUNCTION 'NUMBER_GET_NEXT'&lt;/P&gt;&lt;P&gt;        EXPORTING OBJECT           = 'EGON'&lt;/P&gt;&lt;P&gt;                    NR_RANGE_NR      = '01'&lt;/P&gt;&lt;P&gt;                   SUBOBJECT        = T001-BUKRS&lt;/P&gt;&lt;P&gt;                   TOYEAR           = YEAR&lt;/P&gt;&lt;P&gt;        IMPORTING RETURNCODE       = RC&lt;/P&gt;&lt;P&gt;                    QUANTITY         = QUAN&lt;/P&gt;&lt;P&gt;                   NUMBER           = NUMBER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the last assigned number is in NUMBER&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the number of the assigned numbers is in QUANTITY&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the first free number is calculated from:&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NUMBER - QUANTITY + 1.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   CASE RC.&lt;/P&gt;&lt;P&gt;     WHEN ' '.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     everything o.k.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     WHEN '1'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     the assigned number lies in the critical area.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     WHEN '2'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     this was the last number, next time the first number will be        assigned&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;     WHEN '3'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     more numbers are demanded than are available,&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     the number of the assigned numbers is in QUAN.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;check FM documentation&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Satyendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Aug 2007 05:08:06 GMT</pubDate>
    <dc:creator>satykumar</dc:creator>
    <dc:date>2007-08-08T05:08:06Z</dc:date>
    <item>
      <title>FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm/m-p/2595966#M594569</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;  can u tell me about this function module NUMBER_GET_NEXT?&lt;/P&gt;&lt;P&gt;  How it will work ? What we have to pass?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  thanks&lt;/P&gt;&lt;P&gt;   srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2007 05:03:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fm/m-p/2595966#M594569</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-08T05:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm/m-p/2595967#M594570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create a serial number range object in SNRO transaction(give 01 in starting number) and every time you want a new number you can call the NUMBER_GET_NEXT function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'NUMBER_GET_NEXT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;nr_range_nr = '01' (or pass the Variable)&lt;/P&gt;&lt;P&gt;object = 'ObjectName'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;number = number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.erpgenie.com/sap/abap/code/abap33.htm" target="test_blank"&gt;http://www.erpgenie.com/sap/abap/code/abap33.htm&lt;/A&gt; ex---- General - Number Range Generation * In the 4.6x environment, SAP have included a number range generation * program just like those used for Purchase Order, Sales Order etc. * * This SAP number range generation is an include program. * * [code]INCLUDE ZRANGENO.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Always have to be included in the main program data declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;data: wnorange like INRI-NRRANGENR, "number range,&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;wsubobj like inri-SUBOBJECT, "sub object&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;wdocno(12).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Steps :-&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;1. Number range Sub Object must be maintain in table ZSGRP&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;You can used transaction SE16 to create a table entries.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;2. Maintain number range and intervals in transaction code SNUM&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Written by : SAP Basis, ABAP Programming and Other IMG Stuff&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com" target="test_blank"&gt;http://www.sap-img.com&lt;/A&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'NUMBER_RANGE_ENQUEUE'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;object = 'ZOWNNO' "Create with SNUM&lt;/P&gt;&lt;P&gt;exceptions&lt;/P&gt;&lt;P&gt;foreign_lock = 1&lt;/P&gt;&lt;P&gt;object_not_found = 2&lt;/P&gt;&lt;P&gt;system_failure = 3&lt;/P&gt;&lt;P&gt;others = 4.&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;message e086 with 'Lock error' sy-subrc.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'NUMBER_GET_NEXT'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;nr_range_nr = wnorange&lt;/P&gt;&lt;P&gt;object = 'ZOWNNO'&lt;/P&gt;&lt;P&gt;subobject = wsubobj&lt;/P&gt;&lt;P&gt;importing&lt;/P&gt;&lt;P&gt;number = wdocno "Number generated by SAP&lt;/P&gt;&lt;P&gt;exceptions&lt;/P&gt;&lt;P&gt;interval_not_found = 1&lt;/P&gt;&lt;P&gt;number_range_not_intern = 2&lt;/P&gt;&lt;P&gt;object_not_found = 3&lt;/P&gt;&lt;P&gt;quantity_is_0 = 4&lt;/P&gt;&lt;P&gt;quantity_is_not_1 = 5&lt;/P&gt;&lt;P&gt;internal_overflow = 6&lt;/P&gt;&lt;P&gt;others = 7.&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;message e086 with 'Number Range' sy-subrc.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'NUMBER_RANGE_DEQUEUE'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;object = 'ZOWNNO'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;endif&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2007 05:06:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fm/m-p/2595967#M594570</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-08T05:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm/m-p/2595968#M594571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srinivas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Used to get the next unique number in a number range. Use tcode SNRO for maintaining number ranges.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a serial number range object in SNRO transaction(give 01 in starting number) and every time you want a new number you can call the NUMBER_GET_NEXT function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'NUMBER_GET_NEXT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;nr_range_nr = '01' (or pass the Variable)&lt;/P&gt;&lt;P&gt;object = 'ObjectName'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;number = number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2007 05:07:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fm/m-p/2595968#M594571</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-08T05:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm/m-p/2595969#M594572</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;Check below the Fm documentation.&lt;/P&gt;&lt;P&gt;If you have access to the system then open this FM in SE37 and click Function module documentation else here is the documentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NUMBER_GET_NEXT&lt;/P&gt;&lt;P&gt;____________________________________________________&lt;/P&gt;&lt;P&gt;Short Text&lt;/P&gt;&lt;P&gt;NUmber range: Assigns next free number&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Preliminary comment&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This function module has been released.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The documentation is being revised so that it conforms to the requirements for released function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function module assigns the next free numbers of a number range. A number is assigned as a default if no larger number is demanded in the parameter QUANTITY. If more than one number is demanded and not enough numbers are available up to the interval limit, the numbers are only assigned up to the interval limit. If the last number was assigned, the first interval number is provided again during the next call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The length of the number depends on the definition of the number range object. However, the length is not determined from the definition when allocating, but is calculated from the length of th from-number of the number range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All exceptions are created with MESSAGE ... RAISING ... .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Object HUGO, not year-dependent, next free number searched for&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: RC         LIKE INRI-RETURNCODE,&lt;/P&gt;&lt;P&gt;      NUMBER(10) TYPE C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   CALL FUNCTION 'NUMBER_GET_NEXT'&lt;/P&gt;&lt;P&gt;        EXPORTING OBJECT          = 'HUGO'&lt;/P&gt;&lt;P&gt;                    NR_RANGE_NR     = '01'&lt;/P&gt;&lt;P&gt;        IMPORTING RETURNCODE      = RC&lt;/P&gt;&lt;P&gt;                    NUMBER          = NUMBER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   CASE RC.&lt;/P&gt;&lt;P&gt;     WHEN ' '.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     everything o.k.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     WHEN '1'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     the assigned number lies in the critical area.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     WHEN '2'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     this was the last number, next time the first number&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      will be assigned&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Object EGON, year-dependent, next 5 free numbers for 1992 in company code 0001 searched for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: RC         LIKE INRI-RETURNCODE,&lt;/P&gt;&lt;P&gt;      NUMBER(10) TYPE C,&lt;/P&gt;&lt;P&gt;      YEAR       LIKE INRI-TOYEAR,&lt;/P&gt;&lt;P&gt;      QUAN       LIKE INRI-QUANTITY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   YEAR          = '1992'.&lt;/P&gt;&lt;P&gt;   QUAN          = 5.&lt;/P&gt;&lt;P&gt;   T001-BUKRS    = '0001'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   CALL FUNCTION 'NUMBER_GET_NEXT'&lt;/P&gt;&lt;P&gt;        EXPORTING OBJECT           = 'EGON'&lt;/P&gt;&lt;P&gt;                    NR_RANGE_NR      = '01'&lt;/P&gt;&lt;P&gt;                   SUBOBJECT        = T001-BUKRS&lt;/P&gt;&lt;P&gt;                   TOYEAR           = YEAR&lt;/P&gt;&lt;P&gt;        IMPORTING RETURNCODE       = RC&lt;/P&gt;&lt;P&gt;                    QUANTITY         = QUAN&lt;/P&gt;&lt;P&gt;                   NUMBER           = NUMBER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the last assigned number is in NUMBER&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the number of the assigned numbers is in QUANTITY&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the first free number is calculated from:&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NUMBER - QUANTITY + 1.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   CASE RC.&lt;/P&gt;&lt;P&gt;     WHEN ' '.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     everything o.k.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     WHEN '1'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     the assigned number lies in the critical area.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     WHEN '2'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     this was the last number, next time the first number will be        assigned&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;     WHEN '3'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     more numbers are demanded than are available,&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     the number of the assigned numbers is in QUAN.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2007 05:07:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fm/m-p/2595969#M594572</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-08-08T05:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm/m-p/2595970#M594573</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 function module assigns the next free numbers of a number range. A number is assigned as a default if no larger number is demanded in the parameter QUANTITY. If more than one number is demanded and not enough numbers are available up to the interval limit, the numbers are only assigned up to the interval limit. If the last number was assigned, the first interval number is provided again during the next call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The length of the number depends on the definition of the number range object. However, the length is not determined from the definition when allocating, but is calculated from the length of th from-number of the number range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All exceptions are created with MESSAGE ... RAISING ... .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Object HUGO, not year-dependent, next free number searched for&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: RC         LIKE INRI-RETURNCODE,&lt;/P&gt;&lt;P&gt;      NUMBER(10) TYPE C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   CALL FUNCTION 'NUMBER_GET_NEXT'&lt;/P&gt;&lt;P&gt;        EXPORTING OBJECT          = 'HUGO'&lt;/P&gt;&lt;P&gt;                    NR_RANGE_NR     = '01'&lt;/P&gt;&lt;P&gt;        IMPORTING RETURNCODE      = RC&lt;/P&gt;&lt;P&gt;                    NUMBER          = NUMBER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   CASE RC.&lt;/P&gt;&lt;P&gt;     WHEN ' '.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     everything o.k.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     WHEN '1'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     the assigned number lies in the critical area.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     WHEN '2'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     this was the last number, next time the first number&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      will be assigned&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Object EGON, year-dependent, next 5 free numbers for 1992 in company code 0001 searched for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: RC         LIKE INRI-RETURNCODE,&lt;/P&gt;&lt;P&gt;      NUMBER(10) TYPE C,&lt;/P&gt;&lt;P&gt;      YEAR       LIKE INRI-TOYEAR,&lt;/P&gt;&lt;P&gt;      QUAN       LIKE INRI-QUANTITY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   YEAR          = '1992'.&lt;/P&gt;&lt;P&gt;   QUAN          = 5.&lt;/P&gt;&lt;P&gt;   T001-BUKRS    = '0001'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   CALL FUNCTION 'NUMBER_GET_NEXT'&lt;/P&gt;&lt;P&gt;        EXPORTING OBJECT           = 'EGON'&lt;/P&gt;&lt;P&gt;                    NR_RANGE_NR      = '01'&lt;/P&gt;&lt;P&gt;                   SUBOBJECT        = T001-BUKRS&lt;/P&gt;&lt;P&gt;                   TOYEAR           = YEAR&lt;/P&gt;&lt;P&gt;        IMPORTING RETURNCODE       = RC&lt;/P&gt;&lt;P&gt;                    QUANTITY         = QUAN&lt;/P&gt;&lt;P&gt;                   NUMBER           = NUMBER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the last assigned number is in NUMBER&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the number of the assigned numbers is in QUANTITY&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the first free number is calculated from:&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NUMBER - QUANTITY + 1.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   CASE RC.&lt;/P&gt;&lt;P&gt;     WHEN ' '.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     everything o.k.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     WHEN '1'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     the assigned number lies in the critical area.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     WHEN '2'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     this was the last number, next time the first number will be        assigned&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;     WHEN '3'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     more numbers are demanded than are available,&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     the number of the assigned numbers is in QUAN.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;check FM documentation&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Satyendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2007 05:08:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fm/m-p/2595970#M594573</guid>
      <dc:creator>satykumar</dc:creator>
      <dc:date>2007-08-08T05:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm/m-p/2595971#M594574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srinivas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is used for number range to get the next number&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2007 05:09:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fm/m-p/2595971#M594574</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-08T05:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm/m-p/2595972#M594575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This fun module is used to generate continuous numbers for any document:&lt;/P&gt;&lt;P&gt;First you have to create an object in the SNRO Transaction, and that has to be passed to this fun module.&lt;/P&gt;&lt;P&gt;see the sample code:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form GET_NEXT_NUMBER&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM get_next_number_class.&lt;/P&gt;&lt;P&gt;DATA: inumber(10) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM klah WHERE class = 'PRODUCTCODE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc NE 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;entry in KLAH is not yet exiting =&amp;gt; get next number&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'NUMBER_GET_NEXT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;nr_range_nr = '01'&lt;/P&gt;&lt;P&gt;object = 'KLASSE'&lt;/P&gt;&lt;P&gt;quantity = '1'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SUBOBJECT = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TOYEAR = '0000'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IGNORE_BUFFER = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;number = inumber&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;QUANTITY =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;RETURNCODE =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;INTERVAL_NOT_FOUND = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NUMBER_RANGE_NOT_INTERN = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OBJECT_NOT_FOUND = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;QUANTITY_IS_0 = 4&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;QUANTITY_IS_NOT_1 = 5&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;INTERVAL_OVERFLOW = 6&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;BUFFER_OVERFLOW = 7&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 8&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;entry is already existing =&amp;gt; take the number&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;inumber = klah-clint.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM. " GET_NEXT_NUMBER&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2007 05:16:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fm/m-p/2595972#M594575</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-08T05:16:55Z</dc:date>
    </item>
  </channel>
</rss>

