<?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 ID to database in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-id-to-database/m-p/3305368#M791545</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be you can try with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a number range using SNRO and call fm  'NUMBER_GET_NEXT' system will give you next number &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jan 2008 02:36:20 GMT</pubDate>
    <dc:creator>former_member194669</dc:creator>
    <dc:date>2008-01-23T02:36:20Z</dc:date>
    <item>
      <title>Saving ID to database</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-id-to-database/m-p/3305367#M791544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have these codes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE USER_COMMAND_9000 INPUT.&lt;/P&gt;&lt;P&gt;   CASE SY-UCOMM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   WHEN 'SAVE'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    retrieve table from control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      CALL METHOD CODE_EDITOR-&amp;gt;get_text_as_r3table&lt;/P&gt;&lt;P&gt;          IMPORTING&lt;/P&gt;&lt;P&gt;              table = DYN_CODE_TABLE&lt;/P&gt;&lt;P&gt;          EXCEPTIONS&lt;/P&gt;&lt;P&gt;              OTHERS = 1.&lt;/P&gt;&lt;P&gt;LOOP AT DYN_CODE_TABLE INTO wa_lv.&lt;/P&gt;&lt;P&gt;     MOVE wa_lv-Line TO WA_PROGRAM-PROGRAM_LINE.&lt;/P&gt;&lt;P&gt;      MOVE wa_lv-LINE TO WA_PROGRAM-PROGRAM_CODE.&lt;/P&gt;&lt;P&gt;     APPEND WA_PROGRAM TO ITAB_PROGRAM.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;      IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;        CALL FUNCTION 'POPUP_TO_INFORM'&lt;/P&gt;&lt;P&gt;             EXPORTING&lt;/P&gt;&lt;P&gt;                  titel = g_repid&lt;/P&gt;&lt;P&gt;                  txt2  = space&lt;/P&gt;&lt;P&gt;                  txt1  = text-003.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my codes for the save function. Whenever I clicked on the save button, the system will auto generate an ID number and save to my database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg, when I click the first time of the save button, the ID will be 1 and second time is 2. However, after I exit my application and come back again, the ID will be 3 automatically. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please give me code examples as I am very new to ABAP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 02:24:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-id-to-database/m-p/3305367#M791544</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-23T02:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Saving ID to database</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-id-to-database/m-p/3305368#M791545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be you can try with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a number range using SNRO and call fm  'NUMBER_GET_NEXT' system will give you next number &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 02:36:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-id-to-database/m-p/3305368#M791545</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2008-01-23T02:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: Saving ID to database</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-id-to-database/m-p/3305369#M791546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can give the code example for me to understand better?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 02:42:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-id-to-database/m-p/3305369#M791546</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-23T02:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Saving ID to database</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-id-to-database/m-p/3305370#M791547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use snro create number range such as 'ALE_CP'&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           = 'ALE_CP'&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;&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&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'&lt;/P&gt;&lt;P&gt;               object                      = 'ALE_CP'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           QUANTITY                    = LV_CPIDENTCOUNT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;             IMPORTING&lt;/P&gt;&lt;P&gt;               number                      = im_cpidentmax&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           QUANTITY                    = LV_QUANTITY&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           RETURNCODE                  = LV_RETURNCODE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;              interval_overflow           = 6&lt;/P&gt;&lt;P&gt;              OTHERS                      = 7&lt;/P&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;    CALL FUNCTION 'NUMBER_RANGE_DEQUEUE'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        object           = 'ALE_CP'&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        object_not_found = 1&lt;/P&gt;&lt;P&gt;        OTHERS           = 2.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 02:55:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-id-to-database/m-p/3305370#M791547</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-23T02:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Saving ID to database</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-id-to-database/m-p/3305371#M791548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you explain the parameters used in the codes to me or show me how the declaration goes?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 02:58:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-id-to-database/m-p/3305371#M791548</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-23T02:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: Saving ID to database</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-id-to-database/m-p/3305372#M791549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;While creating a number range using transaction SNRO, a number object is created. This is the object you mention in the EXPORTING field OBJECT. In the field NR_RANGE_NR, you mention the interval that you have created in the Number Range Object. I cannot put up screens here, but I can tell you the path.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SNRO&lt;DEL&gt;&amp;gt;Put object name&lt;/DEL&gt;&amp;gt;Display&lt;DEL&gt;&amp;gt;Goto(Menu Bar)&lt;/DEL&gt;&amp;gt;Number Ranges--&amp;gt;Intervals and in the table control the first field, No. is put in NR_RANGE_NR. This is the path in 4.7 SAP version. In 4.6C, I think Intervals comes as soon as you put object name in SNRO Transaction. There are many more fields in the function module, but I suspect that you want the basic functionality.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 03:15:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-id-to-database/m-p/3305372#M791549</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-23T03:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Saving ID to database</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-id-to-database/m-p/3305373#M791550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any tutorial for 'Get_Next_Number' function? I still don't really get it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 06:58:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-id-to-database/m-p/3305373#M791550</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-23T06:58:03Z</dc:date>
    </item>
  </channel>
</rss>

