<?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 can anyone give simple Example for recursive function in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-anyone-give-simple-example-for-recursive-function/m-p/2861351#M671015</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can anyone give simple Example program by recursive concept?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Oct 2007 13:26:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-03T13:26:16Z</dc:date>
    <item>
      <title>can anyone give simple Example for recursive function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-anyone-give-simple-example-for-recursive-function/m-p/2861351#M671015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can anyone give simple Example program by recursive concept?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 13:26:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-anyone-give-simple-example-for-recursive-function/m-p/2861351#M671015</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T13:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: can anyone give simple Example for recursive function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-anyone-give-simple-example-for-recursive-function/m-p/2861352#M671016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please use this recursive FM which i have created for the same requirement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION ZBOM_GET_HIERARCHY.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Global interface:&lt;/P&gt;&lt;P&gt;*"       TABLES&lt;/P&gt;&lt;P&gt;*"              BOM_RETURN STRUCTURE  ZMBOMDATA&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CLEAR HIER_TAB.&lt;/P&gt;&lt;P&gt;REFRESH HIER_TAB.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*Put contents of table sent to function(bom_return) into hier_tab&lt;/P&gt;&lt;P&gt;HIER_TAB[] = BOM_RETURN[].&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*Clear out table to be returned from function, it will be built in&lt;/P&gt;&lt;P&gt;*hierarchy order&lt;/P&gt;&lt;P&gt;CLEAR BOM_RETURN.&lt;/P&gt;&lt;P&gt;REFRESH BOM_RETURN.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;LEVEL = 1.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*Start at the top_level assembly&lt;/P&gt;&lt;P&gt;LOOP AT HIER_TAB&lt;/P&gt;&lt;P&gt;    WHERE TOP_LEVEL = 'X'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*Move fields to table to be returned&lt;/P&gt;&lt;P&gt;    MOVE-CORRESPONDING HIER_TAB TO BOM_RETURN.&lt;/P&gt;&lt;P&gt;    BOM_RETURN-BOM_LEVEL = LEVEL.&lt;/P&gt;&lt;P&gt;    APPEND BOM_RETURN.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*Do not check any other type of item that is not stock&lt;/P&gt;&lt;P&gt;   IF HIER_TAB-POSTP NE 'L'.&lt;/P&gt;&lt;P&gt;       CONTINUE.&lt;/P&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*Check to see if the component is also a parent part&lt;/P&gt;&lt;P&gt;    PERFORM GET_NEXT USING LEVEL&lt;/P&gt;&lt;P&gt;                           HIER_TAB-IDNRK.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  GET_NEXT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Checks to see if the component part is a parent part, if it is move   *&lt;/P&gt;&lt;P&gt;*the fields to the table to be returned from the function&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM GET_NEXT USING VALUE(LOCAL_LEVEL) LIKE LEVEL        "BOM level&lt;/P&gt;&lt;P&gt;                    VALUE(LOCAL_IDNRK) LIKE HIER_TAB-IDNRK.  "Component&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*Check to see if the component is a parent&lt;/P&gt;&lt;P&gt;    READ TABLE HIER_TAB&lt;/P&gt;&lt;P&gt;          WITH KEY MATNR = LOCAL_IDNRK.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*If it is, increment the bom level and move the fields to the table to&lt;/P&gt;&lt;P&gt;*be returned from the function&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;        LOCAL_LEVEL = LOCAL_LEVEL + 1.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;        LOOP AT HIER_TAB&lt;/P&gt;&lt;P&gt;              WHERE MATNR = LOCAL_IDNRK.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;        MOVE-CORRESPONDING HIER_TAB TO BOM_RETURN.&lt;/P&gt;&lt;P&gt;        BOM_RETURN-BOM_LEVEL = LOCAL_LEVEL.&lt;/P&gt;&lt;P&gt;        APPEND BOM_RETURN.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*Do not check any other type of item than stock&lt;/P&gt;&lt;P&gt;        IF HIER_TAB-POSTP NE 'L'.&lt;/P&gt;&lt;P&gt;           CONTINUE.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*Check to see if the component part is a also a parent part&lt;/P&gt;&lt;P&gt;        PERFORM GET_NEXT USING LOCAL_LEVEL&lt;/P&gt;&lt;P&gt;                               BOM_RETURN-IDNRK.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;        ENDLOOP.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ENDFORM.                    " GET_NEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code is working in production without any error. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please give me reward point if it is useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Murali Poli&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 13:40:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-anyone-give-simple-example-for-recursive-function/m-p/2861352#M671016</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T13:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: can anyone give simple Example for recursive function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-anyone-give-simple-example-for-recursive-function/m-p/2861353#M671017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Camila,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was searching for programs with Recursive string and came up with hits:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SALV_DEMO_HIERSEQ_RECURSION&lt;/P&gt;&lt;P&gt;SALV_DEMO_TABLE_RECURSION  &lt;/P&gt;&lt;P&gt;SALV_TEST_HIERSEQ_RECURSION&lt;/P&gt;&lt;P&gt;SALV_TEST_TABLE_RECURSION  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check if any of them are useful to you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vivek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 13:43:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-anyone-give-simple-example-for-recursive-function/m-p/2861353#M671017</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T13:43:25Z</dc:date>
    </item>
  </channel>
</rss>

