<?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 Calculate in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate/m-p/3443093#M826864</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;In the below code u can see the calculations from jan to feb.My doubt is in the select options if give 1 to 6&lt;/P&gt;&lt;P&gt;I need to pick values from jan to june value.If am using directly &lt;/P&gt;&lt;P&gt;the IF condition or the CASE condition only one value is coming.But i want calculaion of the ranges from 1 to 6 i.e:from jan to feb.Please go thru the code u will hav a much more better understanding&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VIjay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:v_p1 TYPE  i.&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: p1 FOR v_p1 OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM determine_power_cost  USING    it_faglflext    TYPE faglflext&lt;/P&gt;&lt;P&gt;                                    v_gjahr         type gjahr&lt;/P&gt;&lt;P&gt;                           CHANGING lv_success_flag TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : lv_plant_maint_flag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR lv_plant_maint_flag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ( it_faglflext-rcntr EQ  '0000360101' OR it_faglflext-rcntr LE  '0000360111') OR&lt;/P&gt;&lt;P&gt;     ( it_faglflext-rcntr EQ  '0000360301' OR it_faglflext-rcntr LE  '0000360304').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF  ( it_faglflext-racct EQ   '0000332000' )   OR ( it_faglflext-racct EQ   '0000332200' )&lt;/P&gt;&lt;P&gt;  OR  ( it_faglflext-racct EQ   '0000332100' )   OR ( it_faglflext-racct EQ   '0000332300' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF it_faglflext-ryear = v_gjahr."v_next_year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_jan&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_jan + it_faglflext-hsl10.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_feb&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_feb + it_faglflext-hsl11.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_mar&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_mar + it_faglflext-hsl12&lt;/P&gt;&lt;P&gt;                                          + it_faglflext-hsl13 + it_faglflext-hsl14&lt;/P&gt;&lt;P&gt;                                          + it_faglflext-hsl15 + it_faglflext-hsl16.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF it_faglflext-ryear EQ v_gjahr.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_apr&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_apr + it_faglflext-hsl01.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_may&lt;/P&gt;&lt;P&gt;                          = t_power_cost_p1-power_cost_p1_may + it_faglflext-hsl02.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_jun&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_jun + it_faglflext-hsl03.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_jul&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_jul + it_faglflext-hsl04.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_aug&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_aug  + it_faglflext-hsl05.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_sep&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_sep + it_faglflext-hsl06.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_oct&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_oct    + it_faglflext-hsl07.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_nov&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_nov + it_faglflext-hsl08.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_dec&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_dec + it_faglflext-hsl09.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 09 Feb 2008 08:16:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-09T08:16:53Z</dc:date>
    <item>
      <title>Calculate</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate/m-p/3443093#M826864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;In the below code u can see the calculations from jan to feb.My doubt is in the select options if give 1 to 6&lt;/P&gt;&lt;P&gt;I need to pick values from jan to june value.If am using directly &lt;/P&gt;&lt;P&gt;the IF condition or the CASE condition only one value is coming.But i want calculaion of the ranges from 1 to 6 i.e:from jan to feb.Please go thru the code u will hav a much more better understanding&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VIjay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:v_p1 TYPE  i.&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: p1 FOR v_p1 OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM determine_power_cost  USING    it_faglflext    TYPE faglflext&lt;/P&gt;&lt;P&gt;                                    v_gjahr         type gjahr&lt;/P&gt;&lt;P&gt;                           CHANGING lv_success_flag TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : lv_plant_maint_flag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR lv_plant_maint_flag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ( it_faglflext-rcntr EQ  '0000360101' OR it_faglflext-rcntr LE  '0000360111') OR&lt;/P&gt;&lt;P&gt;     ( it_faglflext-rcntr EQ  '0000360301' OR it_faglflext-rcntr LE  '0000360304').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF  ( it_faglflext-racct EQ   '0000332000' )   OR ( it_faglflext-racct EQ   '0000332200' )&lt;/P&gt;&lt;P&gt;  OR  ( it_faglflext-racct EQ   '0000332100' )   OR ( it_faglflext-racct EQ   '0000332300' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF it_faglflext-ryear = v_gjahr."v_next_year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_jan&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_jan + it_faglflext-hsl10.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_feb&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_feb + it_faglflext-hsl11.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_mar&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_mar + it_faglflext-hsl12&lt;/P&gt;&lt;P&gt;                                          + it_faglflext-hsl13 + it_faglflext-hsl14&lt;/P&gt;&lt;P&gt;                                          + it_faglflext-hsl15 + it_faglflext-hsl16.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF it_faglflext-ryear EQ v_gjahr.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_apr&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_apr + it_faglflext-hsl01.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_may&lt;/P&gt;&lt;P&gt;                          = t_power_cost_p1-power_cost_p1_may + it_faglflext-hsl02.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_jun&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_jun + it_faglflext-hsl03.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_jul&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_jul + it_faglflext-hsl04.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_aug&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_aug  + it_faglflext-hsl05.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_sep&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_sep + it_faglflext-hsl06.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_oct&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_oct    + it_faglflext-hsl07.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_nov&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_nov + it_faglflext-hsl08.&lt;/P&gt;&lt;P&gt;      t_power_cost_p1-power_cost_p1_dec&lt;/P&gt;&lt;P&gt;                           = t_power_cost_p1-power_cost_p1_dec + it_faglflext-hsl09.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Feb 2008 08:16:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate/m-p/3443093#M826864</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-09T08:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate/m-p/3443094#M826865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vivay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all, I don´t understand why you use 4 IF-statements when you can do it with 2. You should concatenate the first 2 and I don´t see any difference between the latter 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding your question: it_faglflext is an internal table and each record only contains one value, so you should loop at the internal table and do the logic you implemented for every record of that internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Feb 2008 14:29:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate/m-p/3443094#M826865</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-27T14:29:00Z</dc:date>
    </item>
  </channel>
</rss>

