<?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: BW/ABAP- Function module is called infinitely by Datasource Extractor. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bw-abap-function-module-is-called-infinitely-by-datasource-extractor/m-p/3811781#M916887</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to raise the EXEPTION NO_MORE_DATA afte the last record is populated in the output table. Otherwise the program goes into an infinite loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* From now on records get fetched from the database or gets read from the internal table
    FETCH NEXT CURSOR v_cursor
               APPENDING CORRESPONDING FIELDS
               OF TABLE &amp;lt;internal table&amp;gt;
               PACKAGE SIZE i_s_if-maxsize.

    IF sy-subrc &amp;lt;&amp;gt; 0.
      CLOSE CURSOR v_cursor.
      RAISE no_more_data.
    ENDIF.
* Populate the Output Data Structure into table E_T_DATA and you need to raise the EXEPTION NO_MORE_DATA and close the cursor to avoid any memory leaks
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Oct 2009 09:18:25 GMT</pubDate>
    <dc:creator>ShyamPindiproli</dc:creator>
    <dc:date>2009-10-01T09:18:25Z</dc:date>
    <item>
      <title>BW/ABAP- Function module is called infinitely by Datasource Extractor.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bw-abap-function-module-is-called-infinitely-by-datasource-extractor/m-p/3811780#M916886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A quick ABAP question related to Function Modules and BW data source extractors.&lt;/P&gt;&lt;P&gt;I&amp;#146;ve written a function module to select data from a database and simply output the data as a table. I then created a text Datasource using transaction rso2 and set it to Extraction by Function Module.&lt;/P&gt;&lt;P&gt;When I test this using transaction rsa6, I can manipulate the number of calls to my function module using the Display Extra Calls field.&lt;/P&gt;&lt;P&gt;However, when I test this using transaction rsa1, my function module seems to be called infinite times. So, the number of records being retrieved is increasing exponentially and finally ends with a dump.&lt;/P&gt;&lt;P&gt;My question: Do I need to include something in my code such that the Function Module by itself will only be called once?&lt;/P&gt;&lt;P&gt;Or is there some configuration for the Datasource that will limit my function module call to once only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Tried so far&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; Introducing a static variable in the function module that exits as soon as the value is greater than 1. &lt;/P&gt;&lt;P&gt;o Is there another way out?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Preethi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 12:27:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bw-abap-function-module-is-called-infinitely-by-datasource-extractor/m-p/3811780#M916886</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T12:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: BW/ABAP- Function module is called infinitely by Datasource Extractor.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bw-abap-function-module-is-called-infinitely-by-datasource-extractor/m-p/3811781#M916887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to raise the EXEPTION NO_MORE_DATA afte the last record is populated in the output table. Otherwise the program goes into an infinite loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* From now on records get fetched from the database or gets read from the internal table
    FETCH NEXT CURSOR v_cursor
               APPENDING CORRESPONDING FIELDS
               OF TABLE &amp;lt;internal table&amp;gt;
               PACKAGE SIZE i_s_if-maxsize.

    IF sy-subrc &amp;lt;&amp;gt; 0.
      CLOSE CURSOR v_cursor.
      RAISE no_more_data.
    ENDIF.
* Populate the Output Data Structure into table E_T_DATA and you need to raise the EXEPTION NO_MORE_DATA and close the cursor to avoid any memory leaks
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2009 09:18:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bw-abap-function-module-is-called-infinitely-by-datasource-extractor/m-p/3811781#M916887</guid>
      <dc:creator>ShyamPindiproli</dc:creator>
      <dc:date>2009-10-01T09:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: BW/ABAP- Function module is called infinitely by Datasource Extractor.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bw-abap-function-module-is-called-infinitely-by-datasource-extractor/m-p/3811782#M916888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to raise the EXEPTION NO_MORE_DATA afte the last record is populated in the output table. Otherwise the program goes into an infinite loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* From now on records get fetched from the database or gets read from the internal table
    FETCH NEXT CURSOR v_cursor
               APPENDING CORRESPONDING FIELDS
               OF TABLE &amp;lt;internal table&amp;gt;
               PACKAGE SIZE i_s_if-maxsize.

    IF sy-subrc &amp;lt;&amp;gt; 0.
      CLOSE CURSOR v_cursor.
      RAISE no_more_data.
    ENDIF.
* Populate the Output Data Structure into table E_T_DATA and you need to raise the EXEPTION NO_MORE_DATA and close the cursor to avoid any memory leaks
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2009 09:18:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bw-abap-function-module-is-called-infinitely-by-datasource-extractor/m-p/3811782#M916888</guid>
      <dc:creator>ShyamPindiproli</dc:creator>
      <dc:date>2009-10-01T09:18:31Z</dc:date>
    </item>
  </channel>
</rss>

