<?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: saving into Ztable and generate a number through coding in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-into-ztable-and-generate-a-number-through-coding/m-p/5532402#M1263911</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sameera,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you mentioned that you are new to module pool. i wanna add a few things to Sesh's  answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition is that you need to write this code in the sy-ucomm of the save button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The mentioned function module takes number range object as input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you need to create this number range in SNRO transaction and set a from interval and to interval&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sajimon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Apr 2009 07:17:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-15T07:17:28Z</dc:date>
    <item>
      <title>saving into Ztable and generate a number through coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-into-ztable-and-generate-a-number-through-coding/m-p/5532400#M1263909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I am very new to Module Pool.Here in my screen header i have vendor number,Vendor name,&lt;/P&gt;&lt;P&gt;bank Name, Branch, LC value and Due date fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for item details i have to take table control.In the item details i have the fields Sl No, PO Number and Po Value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and Two push buttons i need to put.SAVE and CANCEL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i click on SAVE all my screen details should be saved in a ZTABLE and should generate a LCDOCUMENT-Number from the system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i proceed.Plz provide me with ur inputs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 05:06:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-into-ztable-and-generate-a-number-through-coding/m-p/5532400#M1263909</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T05:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: saving into Ztable and generate a number through coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-into-ztable-and-generate-a-number-through-coding/m-p/5532401#M1263910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; In ABAP number generation is generally done using Number range objects. Transaction SNRO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the function module NUMBER_GET_NEXT to generate a number once you create your number range object and interval.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For saving to the Ztable you should use INSERT or MODIFY statement.&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, 15 Apr 2009 06:10:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-into-ztable-and-generate-a-number-through-coding/m-p/5532401#M1263910</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2009-04-15T06:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: saving into Ztable and generate a number through coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-into-ztable-and-generate-a-number-through-coding/m-p/5532402#M1263911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sameera,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you mentioned that you are new to module pool. i wanna add a few things to Sesh's  answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition is that you need to write this code in the sy-ucomm of the save button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The mentioned function module takes number range object as input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you need to create this number range in SNRO transaction and set a from interval and to interval&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sajimon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 07:17:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-into-ztable-and-generate-a-number-through-coding/m-p/5532402#M1263911</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T07:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: saving into Ztable and generate a number through coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-into-ztable-and-generate-a-number-through-coding/m-p/5532403#M1263912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi thanks for ur inputs and Any sample code for my requirement plz?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If u have any sample code for the above plz let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sameera shaik on Apr 15, 2009 10:45 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 08:17:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-into-ztable-and-generate-a-number-through-coding/m-p/5532403#M1263912</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T08:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: saving into Ztable and generate a number through coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-into-ztable-and-generate-a-number-through-coding/m-p/5532404#M1263913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sameera,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following link can help you for getting sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1917311"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Smita&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 11:38:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-into-ztable-and-generate-a-number-through-coding/m-p/5532404#M1263913</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-16T11:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: saving into Ztable and generate a number through coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-into-ztable-and-generate-a-number-through-coding/m-p/5532405#M1263914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sameera,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see the below example to create and call ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Tables used for ranges:

NRIV Number range intervals. Note: Field NRLEVEL Contains the last assigned
number.                                  

TNRO Definition of number range objects

Ranges are maintained in transaction SNRO




Q:

Just another chance to show my ignorance.  Isn't there a function for returning
a unique key and isn't there also a configuration method for describing the
range of those objects.  I know that there is something like that for EDI but I
can't identify it.  I need to retrieve a key for a user defined field in IS-U
CCS 1.2 for sap 4.0B.

A:

You can use a range object . You define ranges in transaction SNRO. The number in the ranges automatically increment ebvery time you use a new number.

Use the function NUMBER_GET_NEXT to get the next number in the range:

   call function 'NUMBER_GET_NEXT'                               
        exporting                                                
             nr_range_nr		= '01'                      
             object		= 'ZCOSTA'                  
             quantity		= '1'                       
        importing                                                
             number		= i_zcostafstm-zafstemnr    
*           quantity		= ' '                      
*           RETURNCODE              =                           
        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                         
             others                  = 7.                        

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 11:42:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-into-ztable-and-generate-a-number-through-coding/m-p/5532405#M1263914</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-16T11:42:23Z</dc:date>
    </item>
  </channel>
</rss>

