<?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: Logic in code while using if condition. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-in-code-while-using-if-condition/m-p/5281103#M1218872</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks all&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Mar 2009 04:42:59 GMT</pubDate>
    <dc:creator>SujeetMishra</dc:creator>
    <dc:date>2009-03-17T04:42:59Z</dc:date>
    <item>
      <title>Logic in code while using if condition.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-in-code-while-using-if-condition/m-p/5281098#M1218867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have below field :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      v_lar01    =  t_plpo-lar01.    "Activity Type MSTD or FSTD&lt;/P&gt;&lt;P&gt;      v_vge01    =  t_plpo-vge01.  " Unit of measure for the standard value MIN (minutes) or S (second)&lt;/P&gt;&lt;P&gt;      v_vgw01    =  t_plpo-vgw01. " Standard value (Numeric value for minutes or second)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      v_lar02    =  t_plpo-lar02.&lt;/P&gt;&lt;P&gt;      v_vge02    =  t_plpo-vge02.&lt;/P&gt;&lt;P&gt;      v_vgw02    =  t_plpo-vgw02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      v_lar03    =  t_plpo-lar03.&lt;/P&gt;&lt;P&gt;      v_vge03    =  t_plpo-vge03.&lt;/P&gt;&lt;P&gt;      v_vgw03    =  t_plpo-vgw03.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      v_lar04    =  t_plpo-lar04.&lt;/P&gt;&lt;P&gt;      v_vge04    =  t_plpo-vge04.&lt;/P&gt;&lt;P&gt;      v_vgw04    =  t_plpo-vgw04.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      v_lar05    =  t_plpo-lar05.&lt;/P&gt;&lt;P&gt;      v_vge05    =  t_plpo-vge05.&lt;/P&gt;&lt;P&gt;      v_vgw05    =  t_plpo-vgw05.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      v_lar06    =  t_plpo-lar06.&lt;/P&gt;&lt;P&gt;      v_vge06    =  t_plpo-vge06.&lt;/P&gt;&lt;P&gt;      v_vgw06    =  t_plpo-vgw06.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i want to check :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If any of v_lar01,02,03,03,04,05,06 is MSTD and v_vge01,02,03,04,05,06 is MIN then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;final v_vgw should be combination of all hours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;same like for other..&lt;/P&gt;&lt;P&gt;so how can i write code to validate this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF v_lar01 = 'MSTD' and v_vge01 = 'MIN'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then v_vgw01  = 35  " in minute&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF v_lar01 = 'MSTD' and  v_vge01 = 'S'.&lt;/P&gt;&lt;P&gt;  v_vgw01  = 1000   "second&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so finally i have to add both above duration in single variable in have to calculate finally in hours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and so on for all fileds,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;its so confusing. can be use CASE??? please guide me appropriate coding for this.&lt;/P&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;Sujeet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Mar 2009 10:35:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-in-code-while-using-if-condition/m-p/5281098#M1218867</guid>
      <dc:creator>SujeetMishra</dc:creator>
      <dc:date>2009-03-16T10:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Logic in code while using if condition.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-in-code-while-using-if-condition/m-p/5281099#M1218868</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;P&gt;use if statement inside loop....endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t_plpo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if  t_plpo-lar01 = 'MSTD' and t_plpo-vge01 = 'MIN'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;add t_plpo-vgw to v_vgw.&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;regsrds,&lt;/P&gt;&lt;P&gt;sankar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Mar 2009 10:43:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-in-code-while-using-if-condition/m-p/5281099#M1218868</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-16T10:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Logic in code while using if condition.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-in-code-while-using-if-condition/m-p/5281100#M1218869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Declare an internal table with two fields lar and another field for seconds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF v_lar01 = 'MSTD' and v_vge01 = 'MIN'.&lt;/P&gt;&lt;P&gt;it_time-lar         = lar1&lt;/P&gt;&lt;P&gt;it_time-seconds = t_plpo-vgw01 * 60  " minutes to seconds&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;it_time-lar         = lar1&lt;/P&gt;&lt;P&gt;it_time-seconds = t_plpo-vgw01 " second&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;append it_time.&lt;/P&gt;&lt;P&gt;IF v_lar02 = 'MSTD' and v_vge02= 'MIN'.&lt;/P&gt;&lt;P&gt;it_time-lar         = lar2&lt;/P&gt;&lt;P&gt;it_time-seconds = t_plpo-vgw02 * 60  " minutes to seconds&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;it_time-lar         = lar2&lt;/P&gt;&lt;P&gt;it_time-seconds = t_plpo-vgw02 " seconds&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;append it_time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and so on...at the end sum it_time-seconds and do the calculate to get hrs n minutes from seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mathews&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Mar 2009 10:47:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-in-code-while-using-if-condition/m-p/5281100#M1218869</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-16T10:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Logic in code while using if condition.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-in-code-while-using-if-condition/m-p/5281101#M1218870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,,&lt;/P&gt;&lt;P&gt;It can be done very easily in case and end case compared to If statement....&lt;/P&gt;&lt;P&gt;Case 'v_lar'&lt;/P&gt;&lt;P&gt;when '01' ....&lt;/P&gt;&lt;P&gt;case 'vge'&lt;/P&gt;&lt;P&gt;when '01'....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Mar 2009 11:15:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-in-code-while-using-if-condition/m-p/5281101#M1218870</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-16T11:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Logic in code while using if condition.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-in-code-while-using-if-condition/m-p/5281102#M1218871</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;You can do like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Loop at itab into wa.
   if wa-lar01 = 'MSTD'.
       if wa-vge01 = 'MIN'.
           g_vgw02 = g_vgw02 + ( wa-vgw02 * 60 ).  " convert it into seconds
       elseif wa-vge01 = 'S'.
            g_vgw02 = g_vgw02 + wa-vgw02. 
       endif.
  endif.
endloop.

* g_vgw02 will be in seconds which u can covert in Hours
g_vgw02_hrs = g_vgw02 / 3600.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Neha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Mar 2009 11:22:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-in-code-while-using-if-condition/m-p/5281102#M1218871</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-16T11:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: Logic in code while using if condition.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-in-code-while-using-if-condition/m-p/5281103#M1218872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks all&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 04:42:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-in-code-while-using-if-condition/m-p/5281103#M1218872</guid>
      <dc:creator>SujeetMishra</dc:creator>
      <dc:date>2009-03-17T04:42:59Z</dc:date>
    </item>
  </channel>
</rss>

