<?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: Algorithm For Cost Element Group Hierarchy in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/algorithm-for-cost-element-group-hierarchy/m-p/12161331#M1978046</link>
    <description>&lt;P&gt;I tried the following but is not working:&lt;/P&gt;&lt;P&gt;LOOP AT lt_hierarchynodes ASSIGNING FIELD-SYMBOL(&amp;lt;fs_nodevalues&amp;gt;).&lt;BR /&gt; CLEAR lwa_desc.&lt;BR /&gt; AT NEW hierlevel.&lt;BR /&gt; &lt;BR /&gt; ENDAT.&lt;BR /&gt; lwa_desc-sign = 'I'.&lt;BR /&gt; lwa_desc-option = 'EQ'.&lt;BR /&gt; CONCATENATE l_desc space &amp;lt;fs_nodevalues&amp;gt;-descript INTO l_desc.&lt;BR /&gt; lwa_desc-low = l_desc.&lt;BR /&gt; IF &amp;lt;fs_nodevalues&amp;gt;-valcount = 1.&lt;BR /&gt; APPEND lwa_desc TO lr_desc.&lt;BR /&gt; CLEAR l_desc.&lt;BR /&gt; ENDIF.&lt;BR /&gt; ENDLOOP.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jun 2020 17:51:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2020-06-17T17:51:43Z</dc:date>
    <item>
      <title>Algorithm For Cost Element Group Hierarchy</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/algorithm-for-cost-element-group-hierarchy/m-p/12161330#M1978045</link>
      <description>&lt;P&gt;Hello. I hope you can help me.&lt;/P&gt;
  &lt;P&gt;I used the BAPI_COSTELEMENTGRP_GETDETAIL function in order to get the cost elements, but i need also the hierarchy that is given in the returning table of the function and for example it is shown:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1817972-tdchf.png" /&gt;&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;This table using and algorithm can give me the follow hierarchy:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1817973-9cbvw.png" /&gt;&lt;/P&gt;
  &lt;P&gt;I would like that the algorithm give me a table with for example:&lt;/P&gt;
  &lt;P&gt;MOD&lt;/P&gt;
  &lt;P&gt;Personal Expenses / Remunerations / Salaries&lt;/P&gt;
  &lt;P&gt;Personal Expenses / Remunerations / Commissions,&lt;/P&gt;
  &lt;P&gt;etc.&lt;/P&gt;
  &lt;P&gt;I tried the following:&lt;/P&gt;
  &lt;P&gt;&lt;IMG alt="" /&gt;&lt;/P&gt;
  &lt;P&gt;But is not working. I hope you can help me.&lt;/P&gt;
  &lt;P&gt;Greetings&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 17:49:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/algorithm-for-cost-element-group-hierarchy/m-p/12161330#M1978045</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-06-17T17:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Algorithm For Cost Element Group Hierarchy</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/algorithm-for-cost-element-group-hierarchy/m-p/12161331#M1978046</link>
      <description>&lt;P&gt;I tried the following but is not working:&lt;/P&gt;&lt;P&gt;LOOP AT lt_hierarchynodes ASSIGNING FIELD-SYMBOL(&amp;lt;fs_nodevalues&amp;gt;).&lt;BR /&gt; CLEAR lwa_desc.&lt;BR /&gt; AT NEW hierlevel.&lt;BR /&gt; &lt;BR /&gt; ENDAT.&lt;BR /&gt; lwa_desc-sign = 'I'.&lt;BR /&gt; lwa_desc-option = 'EQ'.&lt;BR /&gt; CONCATENATE l_desc space &amp;lt;fs_nodevalues&amp;gt;-descript INTO l_desc.&lt;BR /&gt; lwa_desc-low = l_desc.&lt;BR /&gt; IF &amp;lt;fs_nodevalues&amp;gt;-valcount = 1.&lt;BR /&gt; APPEND lwa_desc TO lr_desc.&lt;BR /&gt; CLEAR l_desc.&lt;BR /&gt; ENDIF.&lt;BR /&gt; ENDLOOP.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 17:51:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/algorithm-for-cost-element-group-hierarchy/m-p/12161331#M1978046</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-06-17T17:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: Algorithm For Cost Element Group Hierarchy</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/algorithm-for-cost-element-group-hierarchy/m-p/12161332#M1978047</link>
      <description>&lt;P&gt;Hello  &lt;SPAN class="mention-scrubbed"&gt;hvillanueva&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Try this (might contain some typos).&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA:
  lv_description TYPE string,
  lt_descriptions TYPE TABLE OF string.

lwa_desc-sign = 'I'.
lwa_desc-option = 'EQ'.

LOOP AT lt_hierarchynodes REFERENCE INTO DATA(ld_node).
  DATA(lv_hierarchy_level_index) = ld_node-&amp;gt;hierlevel + 1.
  DELETE lt_descriptions FROM lv_hierarchy_level_index.
  lv_description = ld_node-&amp;gt;descript.
  APPEND lv_description TO lt_descriptions.

  IF ld_node-&amp;gt;valcount &amp;gt; 0.
    CLEAR lwa_desc-low.
    LOOP AT lt_descriptions INTO lv_description.
      CONCATENATE lwa_desc-low lv_description INTO lwa_desc-low SEPARATED BY space.
    ENDLOOP.
    CONDENSE lwa_desc-low.
    APPEND lwa_desc TO lr_desc.
  ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;Kind regards,&lt;BR /&gt;Mateusz</description>
      <pubDate>Wed, 17 Jun 2020 18:04:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/algorithm-for-cost-element-group-hierarchy/m-p/12161332#M1978047</guid>
      <dc:creator>MateuszAdamus</dc:creator>
      <dc:date>2020-06-17T18:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Algorithm For Cost Element Group Hierarchy</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/algorithm-for-cost-element-group-hierarchy/m-p/12161333#M1978048</link>
      <description>&lt;P&gt;Thanks you!! it works perfectly.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 14:45:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/algorithm-for-cost-element-group-hierarchy/m-p/12161333#M1978048</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-06-18T14:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Algorithm For Cost Element Group Hierarchy</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/algorithm-for-cost-element-group-hierarchy/m-p/12161334#M1978049</link>
      <description>&lt;P&gt;Thanks you!! it works perfectly.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 14:45:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/algorithm-for-cost-element-group-hierarchy/m-p/12161334#M1978049</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-06-18T14:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Algorithm For Cost Element Group Hierarchy</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/algorithm-for-cost-element-group-hierarchy/m-p/12161335#M1978050</link>
      <description>&lt;P&gt;That's good to hear.&lt;/P&gt;&lt;BR /&gt;Kind regards,&lt;BR /&gt;Mateusz</description>
      <pubDate>Thu, 18 Jun 2020 14:55:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/algorithm-for-cost-element-group-hierarchy/m-p/12161335#M1978050</guid>
      <dc:creator>MateuszAdamus</dc:creator>
      <dc:date>2020-06-18T14:55:33Z</dc:date>
    </item>
  </channel>
</rss>

