<?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: Recursive call in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254550#M1213883</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;PRE&gt;&lt;CODE&gt;LOOP AT i_orgeh INTO wa_orgeh.
PERFORM set_node_level USING wa_orgeh-orgeh 0 sy-tabix.
ENDLOOP.

FORM set_node_level USING
fp_orgson TYPE ty_orgeh_rel-orgson
fp_level TYPE ty_orgeh_rel-level
fp_tabix type sy-tabix.

DATA : l_1levelup TYPE ty_orgeh_rel-level,
l_tabix like sy-tabix.

LOOP AT i_orgeh_rel INTO wa_orgeh_rel FROM fp_tabix
WHERE orgson = fp_orgson.

IF fp_level &amp;lt; wa_orgeh_rel-level.
wa_orgeh_rel-level = fp_level.

MODIFY i_orgeh_rel FROM wa_orgeh_rel
INDEX sy-tabix
TRANSPORTING level.
ENDIF.

l_1levelup = fp_level + 1.
v_1levelup = l_1levelup.

PERFORM set_node_level USING fp_orgson l_1levelup l_tabix.

ENDLOOP.

ENDFORM. " SET_NODE_LEVEL&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should not give an infinite call to recursion... please check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if its changing the requirement then please do let us know about the requirement.... with example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Siddarth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Feb 2009 08:24:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-16T08:24:10Z</dc:date>
    <item>
      <title>Recursive call</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254547#M1213880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my program recursive call was used. that perform will call upto infinite time running,&lt;/P&gt;&lt;P&gt;I am using this is first time can u plz help. I given below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT i_orgeh INTO wa_orgeh.&lt;/P&gt;&lt;P&gt;    PERFORM set_node_level USING wa_orgeh-orgeh 0.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM set_node_level  USING&lt;/P&gt;&lt;P&gt;                             fp_orgson TYPE ty_orgeh_rel-orgson&lt;/P&gt;&lt;P&gt;                             fp_level  TYPE ty_orgeh_rel-level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : l_1levelup TYPE ty_orgeh_rel-level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT i_orgeh_rel INTO wa_orgeh_rel&lt;/P&gt;&lt;P&gt;                      WHERE orgson = fp_orgson.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF fp_level &amp;lt; wa_orgeh_rel-level.&lt;/P&gt;&lt;P&gt;      wa_orgeh_rel-level = fp_level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      MODIFY i_orgeh_rel FROM wa_orgeh_rel&lt;/P&gt;&lt;P&gt;                         INDEX sy-tabix&lt;/P&gt;&lt;P&gt;                         TRANSPORTING level.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    l_1levelup = fp_level + 1.&lt;/P&gt;&lt;P&gt;    v_1levelup = l_1levelup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM set_node_level USING fp_orgson l_1levelup.&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;ENDFORM.                    " SET_NODE_LEVEL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 08:04:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254547#M1213880</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T08:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Recursive call</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254548#M1213881</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;U are calling form within form defintion also,give a condition to exit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 08:06:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254548#M1213881</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T08:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Recursive call</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254549#M1213882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;   In the form use if sy-subrc ne 0 .&lt;/P&gt;&lt;P&gt;                         exit.&lt;/P&gt;&lt;P&gt;                         endif.&lt;/P&gt;&lt;P&gt;so it will exit.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Viquar Iqbal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 08:08:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254549#M1213882</guid>
      <dc:creator>viquar_iqbal</dc:creator>
      <dc:date>2009-02-16T08:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Recursive call</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254550#M1213883</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;PRE&gt;&lt;CODE&gt;LOOP AT i_orgeh INTO wa_orgeh.
PERFORM set_node_level USING wa_orgeh-orgeh 0 sy-tabix.
ENDLOOP.

FORM set_node_level USING
fp_orgson TYPE ty_orgeh_rel-orgson
fp_level TYPE ty_orgeh_rel-level
fp_tabix type sy-tabix.

DATA : l_1levelup TYPE ty_orgeh_rel-level,
l_tabix like sy-tabix.

LOOP AT i_orgeh_rel INTO wa_orgeh_rel FROM fp_tabix
WHERE orgson = fp_orgson.

IF fp_level &amp;lt; wa_orgeh_rel-level.
wa_orgeh_rel-level = fp_level.

MODIFY i_orgeh_rel FROM wa_orgeh_rel
INDEX sy-tabix
TRANSPORTING level.
ENDIF.

l_1levelup = fp_level + 1.
v_1levelup = l_1levelup.

PERFORM set_node_level USING fp_orgson l_1levelup l_tabix.

ENDLOOP.

ENDFORM. " SET_NODE_LEVEL&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should not give an infinite call to recursion... please check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if its changing the requirement then please do let us know about the requirement.... with example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Siddarth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 08:24:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254550#M1213883</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T08:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: Recursive call</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254551#M1213884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srinu ,&lt;/P&gt;&lt;P&gt;you please try this -&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* LOOP AT i_orgeh INTO wa_orgeh.                       " Comment that
PERFORM set_node_level USING wa_orgeh-orgeh 0.
*ENDLOOP.                                                         " Comment that

FORM set_node_level USING
fp_orgson TYPE ty_orgeh_rel-orgson
fp_level TYPE ty_orgeh_rel-level.

DATA : l_1levelup TYPE ty_orgeh_rel-level.

LOOP AT i_orgeh_rel INTO wa_orgeh_rel
WHERE orgson = fp_orgson.

IF fp_level &amp;lt; wa_orgeh_rel-level.
wa_orgeh_rel-level = fp_level.

MODIFY i_orgeh_rel FROM wa_orgeh_rel
INDEX sy-tabix
TRANSPORTING level.
ENDIF.

l_1levelup = fp_level + 1.
v_1levelup = l_1levelup.

If sy-index = 1.                                      " Add this line
PERFORM set_node_level USING fp_orgson l_1levelup.      
endif.                                                   " Add this line
ENDLOOP.

ENDFORM. " SET_NODE_LEVEL&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards&lt;/P&gt;&lt;P&gt;Pinaki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 08:31:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254551#M1213884</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T08:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Recursive call</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254552#M1213885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi siddarth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per you send that code also giving same problem. If yuou have any idea plz help me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 09:19:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254552#M1213885</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T09:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: Recursive call</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254553#M1213886</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 geting problem in "  IF fp_level &amp;lt; wa_orgeh_rel-level." this condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Srinu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 09:33:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254553#M1213886</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T09:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Recursive call</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254554#M1213887</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 tried finding out the reason, but unable to as i dont have the table fields and other things,&lt;/P&gt;&lt;P&gt;if possible would you please paste the whole code so that I can look into it and then give you the right solution of it...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Siddarth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 12:31:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254554#M1213887</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T12:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Recursive call</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254555#M1213888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi siddarth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can u give me u r mail id. i will sent code. that is better for us.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 13:09:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254555#M1213888</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T13:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Recursive call</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254556#M1213889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any organization has only few levels .. say upto 10 or 20 levels (top or bottom) .. please check how &lt;/P&gt;&lt;P&gt;many levels are there in your org .. &lt;/P&gt;&lt;P&gt;else there is some error in picking up of data in your internal table "i_orgeh"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check as below ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if l_1levelup &amp;gt; some_number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  exit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 13:14:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254556#M1213889</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T13:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: Recursive call</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254557#M1213890</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 think it would be better if we can do this in forum as it would be against the rule of the sdn forum...&lt;/P&gt;&lt;P&gt;you can paste the code here, or code which ever is necessary to run and get the desired result and also please tell me the exact requirement as well&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Siddarth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 13:16:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254557#M1213890</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T13:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Recursive call</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254558#M1213891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2009 13:15:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/recursive-call/m-p/5254558#M1213891</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-04T13:15:31Z</dc:date>
    </item>
  </channel>
</rss>

