<?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 Formula Calculation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/formula-calculation/m-p/6797450#M1466858</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear ABAP experts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to calculate below requirement...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENGLISH NAME&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6&lt;/P&gt;&lt;P&gt;A B C D E F G H I J K L M N O P Q R S T U V W X Y Z&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg. If Employee Name is RALPH MARSHALL KING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then R M K will be decoded and calculated as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(8&lt;STRONG&gt;12) +(3&lt;/STRONG&gt;11) +(1*10) = 139&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ARABIC NAME&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Arabic name , we have different method for arriving at the decoded values. In this case also we will be dealing with the 1st , 16th and 31st characters of the name. The decoded values for each of the three characters are derived as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 1 . Get the ASCII (three digit number ) value for the individual character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 2 . Get the MOD(ASCII , 10) i.e. the remainder of of the ASCII value after dividing by 10 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 3 . Use the value of step 2 for calculating PART-C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg. If Employee Name is يم عبدالله عبدالرحمن الخضير&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then the name will be decoded and calculated as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 1 - The Ascii value for each of the three characters are obtained as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ascii u2013(1st) = 238&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ascii - (16th ) = 243&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ascii - (31st) = 032&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 2 - The MOD(Ascii value,10) for each of the three characters are obtained as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOD(238,10 ) = 8&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOD(243,10 ) = 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOD (032,10 ) = 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 3 - The PART-C is calculated as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(8&lt;STRONG&gt;12) +(3&lt;/STRONG&gt;11) +(2*10) = 149&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Apr 2010 11:44:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-04-19T11:44:10Z</dc:date>
    <item>
      <title>Formula Calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/formula-calculation/m-p/6797450#M1466858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear ABAP experts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to calculate below requirement...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENGLISH NAME&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6&lt;/P&gt;&lt;P&gt;A B C D E F G H I J K L M N O P Q R S T U V W X Y Z&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg. If Employee Name is RALPH MARSHALL KING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then R M K will be decoded and calculated as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(8&lt;STRONG&gt;12) +(3&lt;/STRONG&gt;11) +(1*10) = 139&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ARABIC NAME&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Arabic name , we have different method for arriving at the decoded values. In this case also we will be dealing with the 1st , 16th and 31st characters of the name. The decoded values for each of the three characters are derived as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 1 . Get the ASCII (three digit number ) value for the individual character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 2 . Get the MOD(ASCII , 10) i.e. the remainder of of the ASCII value after dividing by 10 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 3 . Use the value of step 2 for calculating PART-C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg. If Employee Name is يم عبدالله عبدالرحمن الخضير&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then the name will be decoded and calculated as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 1 - The Ascii value for each of the three characters are obtained as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ascii u2013(1st) = 238&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ascii - (16th ) = 243&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ascii - (31st) = 032&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 2 - The MOD(Ascii value,10) for each of the three characters are obtained as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOD(238,10 ) = 8&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOD(243,10 ) = 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOD (032,10 ) = 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 3 - The PART-C is calculated as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(8&lt;STRONG&gt;12) +(3&lt;/STRONG&gt;11) +(2*10) = 149&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Apr 2010 11:44:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/formula-calculation/m-p/6797450#M1466858</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-19T11:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/formula-calculation/m-p/6797451#M1466859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But looks like you have closed the same thread as "solved". &lt;SPAN __jive_macro_name="message" id="8997445"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Apr 2010 11:47:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/formula-calculation/m-p/6797451#M1466859</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-04-19T11:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/formula-calculation/m-p/6797452#M1466860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes,suhas i have closed it as "Solved" for the first requirment,but not for the second&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thier werent any replies to my next one .so i have opened this. It would be great if you help me in solving this new one .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;harish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Apr 2010 11:55:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/formula-calculation/m-p/6797452#M1466860</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-19T11:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/formula-calculation/m-p/6797453#M1466861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Harish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code you can use for the English name:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PARAMETERS: p_name TYPE string OBLIGATORY.

DATA: itab TYPE STANDARD TABLE OF string,
      wa TYPE string,
      v_init TYPE char1,
      v_off TYPE i,
      v_fact TYPE i,
      v_code_const TYPE i VALUE 12, "Coding constant
      v_code TYPE i. "Code for the name

SPLIT p_name AT ` ` INTO TABLE itab."Split the name at spaces

IF itab IS NOT INITIAL.
  LOOP AT itab INTO wa.
    v_init = wa+0(1).
*   Get the offset of the first found occurence
    FIND v_init IN sy-abcde IGNORING CASE MATCH OFFSET v_off.
    v_off = v_off + 1. "Add 1 to get the position index
    v_fact = v_off MOD 10. "Get the multiplication factor
    v_code = v_code + v_fact * v_code_const.

    v_code_const = v_code_const - 1.
    CLEAR: v_off, v_fact.
  ENDLOOP.
ENDIF.

WRITE:
/ 'English Name:', 15 p_name,
/ 'Decode Value:', 15 v_code.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the Arabic name, i have a doubt. How do you get the ASCII value for the arabic characters as mentioned in your post ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i use the method CL_ABAP_CONV_OUT_CE=&amp;gt;UCCPI i get different values for the arabic characters &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Apr 2010 14:08:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/formula-calculation/m-p/6797453#M1466861</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-04-19T14:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/formula-calculation/m-p/6797454#M1466862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Apr 2010 09:27:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/formula-calculation/m-p/6797454#M1466862</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-20T09:27:17Z</dc:date>
    </item>
  </channel>
</rss>

