<?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: Sal calculation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910571#M1482829</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for your replies...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If their no amount specified...then how the calculation should go on ..considering their should be only 9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example..if the amount field is 56565 i.e 5 we need to add 4 zeroes in froint of 56565 i,e 000056565&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it  is 56565.00 we need to bring it as 005656500&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vishal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Apr 2010 12:40:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-04-26T12:40:53Z</dc:date>
    <item>
      <title>Sal calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910563#M1482821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;                   how to code below requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;last 2 digits are considered as decimals&lt;/P&gt;&lt;P&gt;    If the salary for the employee is SR 11148.00 then the decoded value for PART-D is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(First the 11148.00 has to be converted as 9 digit number as 001114800)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(0&lt;STRONG&gt;9)+ (0&lt;/STRONG&gt;8)+ + (1&lt;STRONG&gt;7)+ (1&lt;/STRONG&gt;6)+ (1&lt;STRONG&gt;5)+ (4&lt;/STRONG&gt;4)+ (8&lt;STRONG&gt;3)+ (0&lt;/STRONG&gt;2)+ (0*1)  = 58&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanls in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vishal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 06:57:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910563#M1482821</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-26T06:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: Sal calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910564#M1482822</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;Welcome to SDN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try something like below&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data sal type p decimals 2 value '11148.00'.
data tmp(9) type n.
data code type i.
data n type i value 0.
data val type i value 9.
tmp = sal * 100.
write tmp.
do val times.
  code = code + ( val * tmp+n(1) ).
  n = n + 1.
  val = val - 1.
  if val = 0.
    exit.
  endif.
enddo.
write code.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 07:15:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910564#M1482822</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-26T07:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sal calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910565#M1482823</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;Try this code,&lt;/P&gt;&lt;P&gt;(If the length restricted to 9 )&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data : w_sal type p decimals 2 value '11148.00',
       w_temp type string,
       w_amt type p,
       w_count type i value 9,
       w_req_sal(10) type n.
       w_temp = w_sal.
       replace '.' in w_temp with space.
       condense w_temp.
       w_req_sal = w_temp.

       do 9 times.
       w_amt = w_amt + ( w_req_sal+sy-index(1) ) * w_count.
       subtract 1 from w_count.
       enddo.
write w_amt.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raghava Channooru&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 07:34:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910565#M1482823</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-26T07:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Sal calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910566#M1482824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data:lv_char type char09.
data:lv_offset type sy-fdpos.
write value into lv_char.
replace '.' in lv_car with ' '.
condense lv_char no-gaps.
len = strlen( lv_char ).
do.
if sy-index = strlen( lv_char ).
exit.
endif.
lv_offset = lv_offset + 1.
lv_sum = lv_sum + ( lv_char+lv_offset(1) * lv_len ).
lv_len = lv_len - 1.
enddo.
write lv_sum.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 07:58:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910566#M1482824</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-04-26T07:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sal calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910567#M1482825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks all for your replies....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cant we do it using constant value..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example ..say we are taking value from selection scree..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vishal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 08:31:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910567#M1482825</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-26T08:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sal calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910568#M1482826</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;Do you mean that the value is being input from a selection screen ?&lt;/P&gt;&lt;P&gt;If so, simply replace the data statement defining sal type p decimals2 by&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
parameter sal type p decimals 2 default '11184.00'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you change the value on execution on the selection screen, then that would be used in the calculations&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 08:37:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910568#M1482826</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-26T08:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Sal calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910569#M1482827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi vishal ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The below piece of code should solve your problem..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : fsalary type float.&lt;/P&gt;&lt;P&gt;data : isalary type i.&lt;/P&gt;&lt;P&gt;data : iresult type i.&lt;/P&gt;&lt;P&gt;data : fsal type f.&lt;/P&gt;&lt;P&gt;data : isal type i.&lt;/P&gt;&lt;P&gt;data : count type i.&lt;/P&gt;&lt;P&gt;data : len type i.&lt;/P&gt;&lt;P&gt;data : addlen type i.&lt;/P&gt;&lt;P&gt;data : sal type string.&lt;/P&gt;&lt;P&gt;data : fssal type string.&lt;/P&gt;&lt;P&gt;data : zero type c value '0'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count = 1.&lt;/P&gt;&lt;P&gt;fsalary = '11148.00' .&lt;/P&gt;&lt;P&gt;isalary = fsalary .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sal = isalary.&lt;/P&gt;&lt;P&gt;len = strlen( sal ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;addlen = 9 - len + 1.&lt;/P&gt;&lt;P&gt;while addlen GT 0.&lt;/P&gt;&lt;P&gt;  concatenate zero fssal into fssal .&lt;/P&gt;&lt;P&gt;  addlen = addlen - 1.&lt;/P&gt;&lt;P&gt;  endwhile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; concatenate fssal sal into fssal .&lt;/P&gt;&lt;P&gt; condense fssal no-gaps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  write fssal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while isalary GT 0.&lt;/P&gt;&lt;P&gt;  if count LT 10.&lt;/P&gt;&lt;P&gt;  isal = isalary mod 10.&lt;/P&gt;&lt;P&gt;  iresult = iresult + ( isal * count ).&lt;/P&gt;&lt;P&gt;  fsal = isalary / 10.&lt;/P&gt;&lt;P&gt;  isal = floor( fsal ).&lt;/P&gt;&lt;P&gt;  isalary = isal.&lt;/P&gt;&lt;P&gt;  count = count + 1.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endwhile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write iresult.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*******************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fssal and iresult gives you the required values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fssal --- the final string of 9 characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;iresult -- the decoded value..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please revert back in case of any issues....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 09:02:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910569#M1482827</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-26T09:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sal calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910570#M1482828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi vishal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above piece of code i have mentioned you can take the value of fsalary from selection screen as :--&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameter fsalary type p decimals 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;and please do not forget to comment the lines&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : fsalary type float.&lt;/P&gt;&lt;P&gt;fsalary = '11148.00' .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 10:07:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910570#M1482828</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-26T10:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Sal calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910571#M1482829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for your replies...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If their no amount specified...then how the calculation should go on ..considering their should be only 9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example..if the amount field is 56565 i.e 5 we need to add 4 zeroes in froint of 56565 i,e 000056565&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it  is 56565.00 we need to bring it as 005656500&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vishal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 12:40:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910571#M1482829</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-26T12:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Sal calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910572#M1482830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vishal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you mean to say that you need different decode values for 56565 and 56565.00 ?????????????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if its yes.. then it can bring ambuigity in your decoded values as it will be the same for 56565.00 and 5656500...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see to this matter and reply.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Apr 2010 06:54:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sal-calculation/m-p/6910572#M1482830</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-27T06:54:14Z</dc:date>
    </item>
  </channel>
</rss>

