<?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 no generation in custom program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606977#M1662873</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello everybody,&lt;/P&gt;&lt;P&gt;in my requirement i have developed a modulepool program through which the end user enters the records into custom table,&lt;/P&gt;&lt;P&gt;for each entry i have designed manual code to generate the serial no of that record and when the user pressed enter (save button) the record will be saved into &lt;/P&gt;&lt;P&gt;custom table with the generated serial no and when the user presses new(custom button) a new serial no will be generated based on previous highest record&lt;/P&gt;&lt;P&gt;every thing is working fine,but my problem was when there are more records to enter , 2 or 3 users trying simultaneously to enter the records , problem was&lt;/P&gt;&lt;P&gt;distinct serial nos r not generating for each user until the first user saved his record.&lt;/P&gt;&lt;P&gt;here my requirement is if multiple users r simultaneously working, each user has to get distinct serial no without saving the first record( first user used ).&lt;/P&gt;&lt;P&gt;can any body plz help me that how can i achieve this.&lt;/P&gt;&lt;P&gt;thanks &amp;amp; regards&lt;/P&gt;&lt;P&gt;mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Mar 2012 05:24:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2012-03-13T05:24:28Z</dc:date>
    <item>
      <title>re: serial no generation in custom program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606977#M1662873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello everybody,&lt;/P&gt;&lt;P&gt;in my requirement i have developed a modulepool program through which the end user enters the records into custom table,&lt;/P&gt;&lt;P&gt;for each entry i have designed manual code to generate the serial no of that record and when the user pressed enter (save button) the record will be saved into &lt;/P&gt;&lt;P&gt;custom table with the generated serial no and when the user presses new(custom button) a new serial no will be generated based on previous highest record&lt;/P&gt;&lt;P&gt;every thing is working fine,but my problem was when there are more records to enter , 2 or 3 users trying simultaneously to enter the records , problem was&lt;/P&gt;&lt;P&gt;distinct serial nos r not generating for each user until the first user saved his record.&lt;/P&gt;&lt;P&gt;here my requirement is if multiple users r simultaneously working, each user has to get distinct serial no without saving the first record( first user used ).&lt;/P&gt;&lt;P&gt;can any body plz help me that how can i achieve this.&lt;/P&gt;&lt;P&gt;thanks &amp;amp; regards&lt;/P&gt;&lt;P&gt;mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2012 05:24:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606977#M1662873</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-13T05:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: re: serial no generation in custom program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606978#M1662874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use Transaction SNRO OR SNUM and create number range object by this you will get distinct number ... Remember one thing number should get when user press SAVE by this your number loss probability will be less ... search on SDN for this topic you will get data for this &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/5.0.1/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2012 05:32:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606978#M1662874</guid>
      <dc:creator>Aashish28</dc:creator>
      <dc:date>2012-03-13T05:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: re: serial no generation in custom program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606979#M1662875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mahesh,&lt;/P&gt;&lt;P&gt;I think you are generating serial no when user clicks on New button. I think you have to Generate your serial No when user clicks on save button with your logic of highest no in custom table.&lt;/P&gt;&lt;P&gt;Mudassar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2012 05:35:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606979#M1662875</guid>
      <dc:creator>former_member756927</dc:creator>
      <dc:date>2012-03-13T05:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: re: serial no generation in custom program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606980#M1662876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank u ashish for immediate response,&lt;/P&gt;&lt;P&gt;i have tried using number range object while developing this app, problem was&lt;/P&gt;&lt;P&gt;the end users previously uploaded the data for specific periods thru a bdc prog&lt;/P&gt;&lt;P&gt;with the single no&amp;nbsp; for all records , by using snro we can generate a fixed no series(6-saleorder,5-gr)&lt;/P&gt;&lt;P&gt;right?, what my clients r asking is the new no should start from the previuos highest no &lt;/P&gt;&lt;P&gt; and for the next year the no should also repeats so i have used custom code previously&lt;/P&gt;&lt;P&gt;the new no generates when the previous no was saved,now they r asking for distinct no generation&lt;/P&gt;&lt;P&gt;for distinct user without saving the first used user no.&lt;/P&gt;&lt;P&gt;like generation of stas(out bound deleveries or etc..).&lt;/P&gt;&lt;P&gt;can u pls suggest me any links for reference ,how sap is generating serial nos using snro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2012 05:50:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606980#M1662876</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-13T05:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: re: serial no generation in custom program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606981#M1662877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes praniya,&lt;/P&gt;&lt;P&gt;until unless the first user saves his no all the other users r getting the same no&lt;/P&gt;&lt;P&gt;now i need to avoid that and i had to generate distnct no for distinc users without pressing svae.&lt;/P&gt;&lt;P&gt;pls help me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2012 05:59:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606981#M1662877</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-13T05:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: re: serial no generation in custom program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606982#M1662878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;SNRO transaction uses NUMBER_GET_NEXT Function module to generate the no sequence.&lt;/P&gt;&lt;P&gt;for detail go through the link&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://axsap.wordpress.com/2011/07/05/snro-sequence-number-range-object/"&gt;http://axsap.wordpress.com/2011/07/05/snro-sequence-number-range-object/&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I suggest you genrate the no on click of save button beacuse it will be very difficult to manage for the multiple user to generate no on click of new because either you have to save it inot a temp var for the particular user and generate the higher no for the othr user using that temp var and then after that once it has saved u hav to replace temp var with the current highest no in custom table. The logic could be complicated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2012 06:19:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606982#M1662878</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-13T06:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: re: serial no generation in custom program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606983#M1662879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mahesh ,&lt;/P&gt;&lt;P&gt;SNRO LINK - &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'book antiqua', palatino;"&gt;&lt;SPAN style="color: #ff0000; font-family: arial, helvetica, sans-serif;"&gt;&lt;EM&gt;Link to blocked site removed by moderator&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; As you write 1) next year the no should also repeats.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2) new no should start from the previous highest no.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As i understand this is your 2 main requirement , But as per condition which you wrote SNRO will not resolve your problem because in SNRO number will get loss if transaction will not completed but you can use it if no loss is not problem you can set your number range as year wise repeated also but just go with my example ,&lt;/P&gt;&lt;P&gt;Your Number - 00002 Year - 2012&lt;/P&gt;&lt;P&gt;Assume 3 users open same transaction they all will get 00003 2012 as next number &lt;/P&gt;&lt;P&gt;You have to make recursion function which will check your generated number in your table at time of save than possibility of saving same number will become less. &lt;/P&gt;&lt;P&gt;all 3 press save than check this function .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is basic Idea . &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/5.0.1/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Vinod Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2012 06:30:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606983#M1662879</guid>
      <dc:creator>Aashish28</dc:creator>
      <dc:date>2012-03-13T06:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: re: serial no generation in custom program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606984#M1662880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Mahesh,&lt;/P&gt;&lt;P&gt;Again I suggest you to generate serial no when user clicks on save button.&lt;/P&gt;&lt;P&gt;I don't know whether you want to show serial no to user or not when they entering details for new records.&lt;/P&gt;&lt;P&gt;Because it was difficult to maintain serial no if u want to display serial no. to user when multiple users r simultaneously working.&lt;/P&gt;&lt;P&gt; I suggest you to generate serial no in background with previous highest no when user clicks on save button and display generated serial no in message as " Record No. : "Your Serial No." Saved ".&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2012 06:43:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606984#M1662880</guid>
      <dc:creator>former_member756927</dc:creator>
      <dc:date>2012-03-13T06:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: re: serial no generation in custom program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606985#M1662881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks praniya,&lt;/P&gt;&lt;P&gt;i am doing the same the no is generated after pressing the save button only,&lt;/P&gt;&lt;P&gt;req is custom screen contains header data fields and table control for item details.&lt;/P&gt;&lt;P&gt;they enter header details and item check the screen.fgino is automatically generated&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/81033" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2012 07:04:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606985#M1662881</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-13T07:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: re: serial no generation in custom program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606986#M1662882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ohk...&lt;/P&gt;&lt;P&gt;Is it mandatory to show FGINO on screen?&lt;/P&gt;&lt;P&gt;If i am not wrong u r using two custom tables to store the data and Generated FGINO in "Headerdetails" is entered into every line of "Itemdetails". Right?&lt;/P&gt;&lt;P&gt;If its not mandatory to show FGINO in "Headerdetails" and "Itemdetails" then your problem can be solved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2012 08:30:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606986#M1662882</guid>
      <dc:creator>former_member756927</dc:creator>
      <dc:date>2012-03-13T08:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: re: serial no generation in custom program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606987#M1662883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ,&lt;/P&gt;&lt;P&gt;thanks for reply,&lt;/P&gt;&lt;P&gt;i dont know wether it is mandatory&amp;nbsp; r not but they asked it for reference.&lt;/P&gt;&lt;P&gt;if consider ur suggestion, how multiple users enters the data simultaneously and how the header &lt;/P&gt;&lt;P&gt;and item data r linked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2012 09:08:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606987#M1662883</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-13T09:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: re: serial no generation in custom program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606988#M1662884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I consider that u r using two tables one for header details and one for itemdetails.&lt;/P&gt;&lt;P&gt;when user clicks on save button first of all serial no will be generated and one variable will hold the value of serialno.&lt;/P&gt;&lt;P&gt;after that write two insert statements for saving records in custom tables.&lt;/P&gt;&lt;P&gt;1st statement will be for header details which will be stored in header table.&lt;/P&gt;&lt;P&gt;2nd statement will be for item details which will be stored in detail table.&lt;/P&gt;&lt;P&gt;In header table make FGINO (serialno) primary key field and in item table FGINO (serialno) field as foreign key. this way link between two tables will be created. and ya in item table make itemno field as primary key.&lt;/P&gt;&lt;P&gt;you can take reference of many header and detail tables like EKKO as header table for PO header data and EKPO as PO Irtem Detail Table.&lt;/P&gt;&lt;P&gt;And for reference you can show them FGINO in message as i suggested in earlier post.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2012 10:11:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606988#M1662884</guid>
      <dc:creator>former_member756927</dc:creator>
      <dc:date>2012-03-13T10:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: re: serial no generation in custom program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606989#M1662885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I can suggest you to get&amp;nbsp; 'Lock' on the custom table(s) to get the next available number, use it along with year to make it unique, create the records in both the tables, and then release the 'Lock'.&lt;/P&gt;&lt;P&gt;This way you can ensure you always get unique number.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2012 10:42:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606989#M1662885</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-13T10:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: re: serial no generation in custom program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606990#M1662886</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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; use FM 'enqueue_&amp;lt;lockname&amp;gt;',while updating the custom table to with unique key is fyear and then release the lock by using dequeue_&amp;lt;lockname&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gurunath Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2012 12:39:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-serial-no-generation-in-custom-program/m-p/8606990#M1662886</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-13T12:39:14Z</dc:date>
    </item>
  </channel>
</rss>

