<?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: enhancement for adding number range in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/enhancement-for-adding-number-range/m-p/5873381#M1323727</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;in the USEREXIT_NUMBER_RANGE (include RV60AFZZ) the internal number range specified in the billing type table (TVFK-NUMKI) can be changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in your coding, you must get from the Ztable, the custom number range and, if valued, replace the value US_RANGE_INTERN with the new value determined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hereafter an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM userexit_number_range USING us_range_intern.
     data: my_numki type tvfk-numki.
     SELECT SINGLE numki INTO my_numki FROM ztable     "This is an example
                                   WHERE bukrs EQ vbrk-bukrs             "This is an example
                                     AND vkorg EQ vbrk-vkorg                "This is an example
                                     AND fkart EQ vbrk-fkart.                  "This is an example
                                    

      IF my_numki IS INITIAL.
        MESSAGE e333(s1) WITH .......                                  "Send Error Message?
      ENDIF.

    us_range_intern = my_numki .
ENDFORM.                                                                          "USEREXIT_NUMBER_RANGE
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards.&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jul 2009 09:32:54 GMT</pubDate>
    <dc:creator>andrea_olivieri</dc:creator>
    <dc:date>2009-07-22T09:32:54Z</dc:date>
    <item>
      <title>enhancement for adding number range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enhancement-for-adding-number-range/m-p/5873379#M1323725</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;my requirement is that a Ztable is been given and in that a field called number range is given RV60AFZZ program , now i need to use the user exit &lt;/P&gt;&lt;P&gt;userexit_number_range to update the system field us_range_intern .&lt;/P&gt;&lt;P&gt;I would like to know the logic which i need to put in the above exit ..&lt;/P&gt;&lt;P&gt;kindly please help me out&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2009 06:22:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enhancement-for-adding-number-range/m-p/5873379#M1323725</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-22T06:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: enhancement for adding number range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enhancement-for-adding-number-range/m-p/5873380#M1323726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shilpa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First you need to define the number range object for that field using Tcode SNRO and then use the following logic to get sequence number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  GET_NEXT_NUMBER
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM get_next_number .
  DATA: w_quant   LIKE inri-quantity,    "dummy
        w_code    LIKE inri-returncode.  "returncode
* To lock the number range object
  CALL FUNCTION 'NUMBER_RANGE_ENQUEUE'
    EXPORTING
      object           = 'ZLCBGREG'
    EXCEPTIONS
      foreign_lock     = 1
      object_not_found = 2
      system_failure   = 3
      OTHERS           = 4.
* To raise the exception to the corresponding exception of
* 'NUMBER_RANGE_ENQUEUE'
  IF sy-subrc NE 0.
    MESSAGE e368(00) WITH text-006."'Object is not found'
  ENDIF.                         "IF sy-subrc NE 0
* To get the next number from the object
  CALL FUNCTION 'NUMBER_GET_NEXT'
    EXPORTING
      nr_range_nr             = 'Z2'
      object                  = 'ZLCBGREG'
      toyear                  = '2008'
    IMPORTING
      number                  = l_lbc_next
      quantity                = w_quant
      returncode              = w_code
    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.
    CLEAR ok_code.
    MESSAGE e368(00) WITH text-006."'Object is not found'
  ENDIF.               "IF sy-subrc &amp;lt;&amp;gt; 0
* To unlock the number range object
  CALL FUNCTION 'NUMBER_RANGE_DEQUEUE'
    EXPORTING
      object           = 'ZLCBGREG'
    EXCEPTIONS
      object_not_found = 1
      OTHERS           = 2.
  IF sy-subrc NE 0.
    CLEAR ok_code.
    MESSAGE e368(00) WITH text-006."'Object is not found'
  ENDIF.              "IF sy-subrc NE 0
ENDFORM.                    " GET_NEXT_NUMBER
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raju.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2009 06:44:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enhancement-for-adding-number-range/m-p/5873380#M1323726</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-22T06:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: enhancement for adding number range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enhancement-for-adding-number-range/m-p/5873381#M1323727</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;in the USEREXIT_NUMBER_RANGE (include RV60AFZZ) the internal number range specified in the billing type table (TVFK-NUMKI) can be changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in your coding, you must get from the Ztable, the custom number range and, if valued, replace the value US_RANGE_INTERN with the new value determined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hereafter an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM userexit_number_range USING us_range_intern.
     data: my_numki type tvfk-numki.
     SELECT SINGLE numki INTO my_numki FROM ztable     "This is an example
                                   WHERE bukrs EQ vbrk-bukrs             "This is an example
                                     AND vkorg EQ vbrk-vkorg                "This is an example
                                     AND fkart EQ vbrk-fkart.                  "This is an example
                                    

      IF my_numki IS INITIAL.
        MESSAGE e333(s1) WITH .......                                  "Send Error Message?
      ENDIF.

    us_range_intern = my_numki .
ENDFORM.                                                                          "USEREXIT_NUMBER_RANGE
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards.&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2009 09:32:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enhancement-for-adding-number-range/m-p/5873381#M1323727</guid>
      <dc:creator>andrea_olivieri</dc:creator>
      <dc:date>2009-07-22T09:32:54Z</dc:date>
    </item>
  </channel>
</rss>

