<?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 Code for counter logic in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-counter-logic/m-p/6818983#M1469923</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;I am planning to write a code in start routine for an ODS update rules where I need to populate document number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I already have some code but having some difficulty in finishing it. Below is the code I was talking about.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lv_random(5) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'QF05_RANDOM_INTEGER'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;RAN_INT_MAX = 99999&lt;/P&gt;&lt;P&gt;RAN_INT_MIN = 1&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;RAN_INT = lv_random&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;INVALID_INPUT = 1&lt;/P&gt;&lt;P&gt;OTHERS = 2.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC 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;P&gt;&lt;/P&gt;&lt;P&gt;Loop at data_package.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate 'B' sy-uzeit+2(4) lv_random into data_package-ac_doc_no.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify data_package.&lt;/P&gt;&lt;P&gt;lv_random = lv_random + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear lv_random.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no doc number in data package from source ODS. How can I write then.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone give me some input to finish this? How can you write this for an ODS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;AB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Mar 2010 23:37:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-03-30T23:37:10Z</dc:date>
    <item>
      <title>Code for counter logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-counter-logic/m-p/6818983#M1469923</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;I am planning to write a code in start routine for an ODS update rules where I need to populate document number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I already have some code but having some difficulty in finishing it. Below is the code I was talking about.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lv_random(5) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'QF05_RANDOM_INTEGER'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;RAN_INT_MAX = 99999&lt;/P&gt;&lt;P&gt;RAN_INT_MIN = 1&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;RAN_INT = lv_random&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;INVALID_INPUT = 1&lt;/P&gt;&lt;P&gt;OTHERS = 2.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC 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;P&gt;&lt;/P&gt;&lt;P&gt;Loop at data_package.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate 'B' sy-uzeit+2(4) lv_random into data_package-ac_doc_no.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify data_package.&lt;/P&gt;&lt;P&gt;lv_random = lv_random + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear lv_random.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no doc number in data package from source ODS. How can I write then.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone give me some input to finish this? How can you write this for an ODS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;AB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Mar 2010 23:37:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-counter-logic/m-p/6818983#M1469923</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-30T23:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: Code for counter logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-counter-logic/m-p/6818984#M1469924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe your question would be better in a different forum, like &lt;SPAN __jive_macro_name="forum" id="132"&gt;&lt;/SPAN&gt; (just guessing)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyhow, not quite sure I understand what you're trying to accomplish. Are you possibly looking already at aggregated data and that's why there's no document number? If for some strange reason you need to generate numbers, you're better off with using function module GUID_CREATE, which is designed to create a unique identifier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers, harald&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Mar 2010 05:10:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-counter-logic/m-p/6818984#M1469924</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-31T05:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: Code for counter logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-counter-logic/m-p/6818985#M1469925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the suggestion. I will do that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Mar 2010 18:12:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-counter-logic/m-p/6818985#M1469925</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-31T18:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: Code for counter logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-counter-logic/m-p/6818986#M1469926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;opening in BI&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Mar 2010 18:12:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-counter-logic/m-p/6818986#M1469926</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-31T18:12:20Z</dc:date>
    </item>
  </channel>
</rss>

