<?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: Roll out the hierarchy , recursive loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/roll-out-the-hierarchy-recursive-loop/m-p/6453173#M1414183</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hope you mean about the BOM Matrix Components explosion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use a subroutine and call it recursively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;available function modules are&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CSAP_MAT_BOM_READ ( from higher level to lower level)&lt;/P&gt;&lt;P&gt;CSEP_MAT_BOM_SELECT_WHERE_USED( From lower to higher)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can check this link for recursive logic link:[Inverse BOM explosion|https://wiki.sdn.sap.com/wiki/display/Snippets/Inverse&lt;EM&gt;or&lt;/EM&gt;Reverse&lt;EM&gt;Bom&lt;/EM&gt;with&lt;EM&gt;Qty&lt;/EM&gt;Required]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Jan 2010 08:45:56 GMT</pubDate>
    <dc:creator>kesavadas_thekkillath</dc:creator>
    <dc:date>2010-01-20T08:45:56Z</dc:date>
    <item>
      <title>Roll out the hierarchy , recursive loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/roll-out-the-hierarchy-recursive-loop/m-p/6453172#M1414182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A production order includes contains components that produced with other production orders that use components produced by another prod order....... so on &lt;/P&gt;&lt;P&gt;This chain may include up to 10 levels.&lt;/P&gt;&lt;P&gt;The task is to populate the record of the lowest level with final prod order number and be able to expand te hierarchy &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I probably need to use recursive loop to get  into the lowest level &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does ABAP have something specific for recursive processing?  Can I call the same FM , method , FORM from itself?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2010 08:32:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/roll-out-the-hierarchy-recursive-loop/m-p/6453172#M1414182</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-20T08:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Roll out the hierarchy , recursive loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/roll-out-the-hierarchy-recursive-loop/m-p/6453173#M1414183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hope you mean about the BOM Matrix Components explosion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use a subroutine and call it recursively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;available function modules are&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CSAP_MAT_BOM_READ ( from higher level to lower level)&lt;/P&gt;&lt;P&gt;CSEP_MAT_BOM_SELECT_WHERE_USED( From lower to higher)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can check this link for recursive logic link:[Inverse BOM explosion|https://wiki.sdn.sap.com/wiki/display/Snippets/Inverse&lt;EM&gt;or&lt;/EM&gt;Reverse&lt;EM&gt;Bom&lt;/EM&gt;with&lt;EM&gt;Qty&lt;/EM&gt;Required]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2010 08:45:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/roll-out-the-hierarchy-recursive-loop/m-p/6453173#M1414183</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-01-20T08:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Roll out the hierarchy , recursive loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/roll-out-the-hierarchy-recursive-loop/m-p/6453174#M1414184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;not only BOM matrix&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2010 09:39:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/roll-out-the-hierarchy-recursive-loop/m-p/6453174#M1414184</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-20T09:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Roll out the hierarchy , recursive loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/roll-out-the-hierarchy-recursive-loop/m-p/6453175#M1414185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've not used a function module but I've done the same sort of thing to 'flatten out' the HR org structure just using ordinary loops.  The tables mentioned here are all pre-filled custom tables but it should be possible to adapt the method to work with other tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*   Add the org unit details to the working table which will be used
*   to query the next level down.
    CLEAR ls_orgs_working.
    ls_orgs_working-child = gs_orgs-child.
    ls_orgs_working-parent = gs_orgs-parent.
    APPEND ls_orgs_working TO lt_orgs_working.

*   Now, starting from this org, treewalk down the hierarchy and get
*   the people details and totals for each sub org.  The HIER_ORG_UNIT
*   value for this records must be GS_ORGS-CHILD ie to relate them to
*   our starting org unit.
    DO.
*     If we've reached the bottom of the hierarchy, leave the DO loop.
      IF lt_orgs_working IS INITIAL.
         EXIT.
      ENDIF.
*     Otherwise, get all the org units for which the current org unit is
*     a parent.
      SELECT *
      INTO TABLE lt_orgs_temp
      FROM zabs_orgs
      FOR ALL ENTRIES IN lt_orgs_working
      WHERE parent = lt_orgs_working-child.

      IF sy-subrc = 0.
         CLEAR lt_orgs_working.
         LOOP AT lt_orgs_temp INTO ls_orgs_temp.

*          Add the totals for the sub org to the GS_ORGS-CHILD totals.
           gs_orgs-meeting_sorgs = gs_orgs-meeting_sorgs +
                                   ls_orgs_temp-meeting.
           gs_orgs-headcount_sorgs = gs_orgs-headcount_sorgs +
                                     ls_orgs_temp-headcount.
           gs_orgs-znew_sorgs = gs_orgs-znew_sorgs +
                                ls_orgs_temp-znew.

*          Add the sub org unit details to the working table so that
*          they can be used to query the next level down.
           CLEAR ls_orgs_working.
           ls_orgs_working-child = ls_orgs_temp-child.
           ls_orgs_working-parent = ls_orgs_temp-parent.
           APPEND ls_orgs_working TO lt_orgs_working.

         ENDLOOP.

      ELSE.
         CLEAR lt_orgs_working.
      ENDIF.
    ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2010 10:09:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/roll-out-the-hierarchy-recursive-loop/m-p/6453175#M1414185</guid>
      <dc:creator>christine_evans</dc:creator>
      <dc:date>2010-01-20T10:09:00Z</dc:date>
    </item>
  </channel>
</rss>

