<?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: How to make recursive call inside method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-make-recursive-call-inside-method/m-p/8682975#M1669266</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Valerie,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that sounds like a reasonable approach, making the subforms private methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Adi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Apr 2012 14:17:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2012-04-27T14:17:25Z</dc:date>
    <item>
      <title>How to make recursive call inside method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-make-recursive-call-inside-method/m-p/8682974#M1669265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am learning OO and I tried to convert a function to method of global class.&lt;/P&gt;&lt;P&gt;In existing function, there is recuresive call of a sub routine defined in the function group.&lt;/P&gt;&lt;P&gt;Question is how can I make a recursive call of this routine inside my method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to create a local class inside my method M1 of global class A but got syntax issue.&lt;/P&gt;&lt;P&gt;So I created a private method in the class A and call this private method PM1 inside my method M1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this the right approach? I just want this private method known to my method only, Not inside the class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Funtion F1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perform&amp;nbsp; form1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Form&amp;nbsp; Form1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Loop at itab into struct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Do something here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; perform sub1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Do something more.&lt;/P&gt;&lt;P&gt;&amp;nbsp; endloop.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I convert to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class A definition.&lt;/P&gt;&lt;P&gt; public section.&lt;/P&gt;&lt;P&gt;&amp;nbsp; method M1.&lt;/P&gt;&lt;P&gt;Endclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class A implementation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Method M1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Loop at itab into struct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call method PM1a&lt;/P&gt;&lt;P&gt; endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Method PM1a&amp;nbsp; is private method inside class A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any better approach? &lt;/P&gt;&lt;P&gt;Thanks for your guidance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2012 14:10:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-make-recursive-call-inside-method/m-p/8682974#M1669265</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-04-27T14:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to make recursive call inside method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-make-recursive-call-inside-method/m-p/8682975#M1669266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Valerie,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that sounds like a reasonable approach, making the subforms private methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Adi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2012 14:17:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-make-recursive-call-inside-method/m-p/8682975#M1669266</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-04-27T14:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to make recursive call inside method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-make-recursive-call-inside-method/m-p/8682976#M1669267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The example you have written doesn't show any recursive calls. Recursive calls - calling the same routine internally in the called routine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case Form1 calls sub1 - both are different, so not a recursive call. Just go through the design patterns available and choose the appropriate one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can find the best examples of design patterns here &lt;A href="http://zevolving.com/category/abapobjects/oo-design-patterns/" title="http://zevolving.com/category/abapobjects/oo-design-patterns/"&gt;http://zevolving.com/category/abapobjects/oo-design-patterns/&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2012 10:08:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-make-recursive-call-inside-method/m-p/8682976#M1669267</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2012-04-30T10:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to make recursive call inside method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-make-recursive-call-inside-method/m-p/8682977#M1669268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I gues in your code you meant to &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Form&amp;nbsp; Form1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Loop at itab into struct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Do something here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; perform Form1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Do something more.&lt;/P&gt;&lt;P&gt;&amp;nbsp; endloop.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I think your current approach is correct which as per your example.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Method M1. &lt;/P&gt;&lt;P&gt;Loop at itab into struct. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call method &lt;STRONG&gt;PM1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;endloop. &lt;/P&gt;&lt;P&gt;Endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Method PM1.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;IF SOME CONDITION.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call method&lt;STRONG&gt; PM1.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; EXIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Endmethod.&lt;/STRONG&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2012 10:49:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-make-recursive-call-inside-method/m-p/8682977#M1669268</guid>
      <dc:creator>Private_Member_49934</dc:creator>
      <dc:date>2012-04-30T10:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to make recursive call inside method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-make-recursive-call-inside-method/m-p/8682978#M1669269</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;In OOP ABAP from inside a method of a class you can call other instance methods of the same class whether public or private using keyowrd ME.&lt;/P&gt;&lt;P&gt;ME is a self refrencing variable of a class object created automatically by runtime. i.e it contains reference of the its own object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thus you can use it like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;Class A implementation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;Method M1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;Loop at itab into struct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ME-&amp;gt;PM1a(&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; "using self referencing variable to call method of its own object.&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;endloop.&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;Method PM1a.&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;...&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;...&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;Endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;Endclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;Thank You.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 11:19:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-make-recursive-call-inside-method/m-p/8682978#M1669269</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-02-04T11:19:15Z</dc:date>
    </item>
  </channel>
</rss>

