<?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 Recursion in ABAP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursion-in-abap/m-p/4455380#M1056182</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;Is there any specific way by which we can achieve recursion in ABAP programming, or is there only the basic call-within-call structure which should contain an exit criteria?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is a specific way to achieve recursion, is there a concept of stack, something like we have in C++? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me to understand this better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Vidya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Sep 2008 07:17:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-09-08T07:17:14Z</dc:date>
    <item>
      <title>Recursion in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursion-in-abap/m-p/4455380#M1056182</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;Is there any specific way by which we can achieve recursion in ABAP programming, or is there only the basic call-within-call structure which should contain an exit criteria?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is a specific way to achieve recursion, is there a concept of stack, something like we have in C++? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me to understand this better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Vidya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Sep 2008 07:17:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/recursion-in-abap/m-p/4455380#M1056182</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-08T07:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Recursion in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursion-in-abap/m-p/4455381#M1056183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this recursion program example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Link:https://wiki.sdn.sap.com/wiki/display/Snippets/Inverse&lt;EM&gt;BOM&lt;/EM&gt;Explosion&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Sep 2008 07:21:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/recursion-in-abap/m-p/4455381#M1056183</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2008-09-08T07:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: Recursion in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursion-in-abap/m-p/4455382#M1056184</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;&lt;/P&gt;&lt;P&gt;Check the below subroutine where it is calling the same function and it displays Fibonacci series &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM fibo  USING   value(p_p_num)
           CHANGING p_w_res.
  DATA :
     w_temp TYPE i,                    " Temporary Variable
     w_no1 TYPE i,                     " Number Variable One
     w_no2 TYPE i,                     " Number Variable TWO
     w_add TYPE i.                     " Stores Sum Of Above 2 Variables

  w_temp = p_p_num.
  IF w_temp EQ 1 OR w_temp EQ 2.
    p_w_res = 1.
  ELSE.
    w_add = 0.
    w_no1 = w_temp - 1.
    w_no2 = w_temp - 2.
    PERFORM fibo USING w_no1 CHANGING p_w_res.
    w_add = w_add + p_w_res.
    PERFORM fibo USING w_no2 CHANGING p_w_res.
    w_add = w_add + p_w_res.
    p_w_res = w_add.
  ENDIF.                               " END IF
ENDFORM.                               " END FORM&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Sep 2008 07:22:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/recursion-in-abap/m-p/4455382#M1056184</guid>
      <dc:creator>bpawanchand</dc:creator>
      <dc:date>2008-09-08T07:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Recursion in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursion-in-abap/m-p/4455383#M1056185</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;ABAP is also a programming language like C++. Here we can write subroutines and loops etc stuff.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Logically, Recursion is a loop kind of thing which runs till some condition is met.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here also you can write a subroutine and pass the parameters to that subroutine with in a loop and endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With this you can achieve the recursion even in abap also. The way of coding is different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this gives a clear picture.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RSS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Sep 2008 07:24:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/recursion-in-abap/m-p/4455383#M1056185</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-08T07:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Recursion in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursion-in-abap/m-p/4455384#M1056186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply Keshu...I have seen the code and understand it. But in general, can you explain how recusion works in ABAP? Is something like a stack maintained? Can the results of the iterations be used in previous iterations, like it happens in C++?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all for your replies. I shall try the fibonacci series code and understand how recursion is achieved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vidya.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vidya D on Sep 8, 2008 9:29 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Sep 2008 07:28:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/recursion-in-abap/m-p/4455384#M1056186</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-08T07:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Recursion in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursion-in-abap/m-p/4455385#M1056187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vidya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this example for recursion:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/recursion-with-loop-checking-in-sap.htm" target="test_blank"&gt;http://www.sap-img.com/abap/recursion-with-loop-checking-in-sap.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chandra Sekhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Sep 2008 07:31:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/recursion-in-abap/m-p/4455385#M1056187</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-08T07:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Recursion in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursion-in-abap/m-p/4455386#M1056188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Recursion can be achieved in ABAP also. Recursion is nothing but to execute a block of code repeatedly until some condition is met.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;in ABAP we can use do loop like&lt;/P&gt;&lt;P&gt;do &amp;lt;n&amp;gt; times.&lt;/P&gt;&lt;P&gt;  statements.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt; or we can use while statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Sep 2008 08:14:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/recursion-in-abap/m-p/4455386#M1056188</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-08T08:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Recursion in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursion-in-abap/m-p/4455387#M1056189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;May be a little late, but nevertheless.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-1-&lt;/P&gt;&lt;P&gt;If your recursion is defined within a database table. And the recursive data is found in that table. (think of tree like structures like a BOM).&lt;/P&gt;&lt;P&gt;In that case you might found it easy to use the CONNECT BY clause offered by oracle (embedded SQL) in order to traverse thrue the structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-2-&lt;/P&gt;&lt;P&gt;If your data can be represented in XML cannonical form, i would make use of XPATH expressions to traverse thrue those structures. Even when in the ABAP stack. (serialize &amp;lt;-&amp;gt; deserialize).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-3-&lt;/P&gt;&lt;P&gt;If your data can be represented in ABAP-Objects i would propose using linked lists or tree like structures to traverse thrue the structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Stef Snijders&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Sep 2010 06:10:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/recursion-in-abap/m-p/4455387#M1056189</guid>
      <dc:creator>snijdersSAM</dc:creator>
      <dc:date>2010-09-08T06:10:32Z</dc:date>
    </item>
  </channel>
</rss>

