<?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: type conversion in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-conversion/m-p/905194#M55963</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Numerology in SAP?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this perhaps for sales forecasting... &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 May 2005 16:33:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-05-13T16:33:43Z</dc:date>
    <item>
      <title>type conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-conversion/m-p/905191#M55960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Need some urgent  help in this regard.&lt;/P&gt;&lt;P&gt;I have this character data(size 44) to convert that into integer value. I used the move statement and moved the value to a string and then to the integer. it is giving SHORT DUMP SAYING IT IS AN OVERFLOW CONDITION. The data in the variable is huge and I need to convert it into integer as it is.&lt;/P&gt;&lt;P&gt;Also I am wondering that after converting into integer I need to mutiply the numbers in the positions 1,3.. with 2,and even positioned numbers with 1.  How can i track them separately if I am using the integer type?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because I need to perform arithematic calculations I wanted to convert into integer.&lt;/P&gt;&lt;P&gt;If there is a better way do suggest me?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Thanks for your help in advance. it would really help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 May 2005 15:27:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-conversion/m-p/905191#M55960</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-13T15:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: type conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-conversion/m-p/905192#M55961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Santhosh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a small piece of code to achieve what you wanted to achieve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: v_char44(44) TYPE c,
      v_value      TYPE i,
      v_digit      TYPE i,
      v_oddoreven  TYPE i,
      v_pos        TYPE i.


START-OF-SELECTION.
  v_char44 = '12345678901234567890123456789012345678901234'.
*-- get rid of leading spaces.
  SHIFT v_char44 LEFT DELETING LEADING space.

  DO 44 TIMES.
    v_pos = sy-index - 1.
    IF v_char44+0(1) IS INITIAL.
*-- no more filled in positions, exit
      EXIT.
    ENDIF.
    v_digit = v_char44+v_pos(1).
    v_oddoreven = sy-index MOD 2.
    IF v_oddoreven = 0.
*-- even number
      v_value = v_value + v_digit.
    ELSE.
*-- odd number
      v_value = v_value + ( v_digit * 2 ).
    ENDIF.
  ENDDO.

  WRITE: v_value.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 May 2005 16:06:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-conversion/m-p/905192#M55961</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-13T16:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: type conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-conversion/m-p/905193#M55962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey srinivas thanks a lot. it really helped. Here is the  situation. It is a bit complicated code if you could help here that would solve my problem.&lt;/P&gt;&lt;P&gt;For example take the number(the real number is 43 characters) like this:&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;4 1 2 9 7 9 6&lt;/P&gt;&lt;P&gt;2 1 2 1 2 1 2 ( mutiply the odd digit numbers with 2 and  &lt;/P&gt;&lt;P&gt;                even with 1)&lt;/P&gt;&lt;P&gt;8 1 4 9 14 9 12&lt;/P&gt;&lt;P&gt;Now where the result is double digit, I have add the double digit numbers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am confused at how to track the double digits out here and add them all.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8 1 4 9 5 9 3 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now add these numbers = 39/10 = 3 remainder 9&lt;/P&gt;&lt;P&gt;last step 10 -9 = 1 This is the number I want it to be converted back into character format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on it.. Your input would help me out here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 May 2005 16:28:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-conversion/m-p/905193#M55962</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-13T16:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: type conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-conversion/m-p/905194#M55963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Numerology in SAP?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this perhaps for sales forecasting... &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 May 2005 16:33:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-conversion/m-p/905194#M55963</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-13T16:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: type conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-conversion/m-p/905195#M55964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it is for the scanline code and I need to generate this number after all these operations it is a 43 character variable using which I need to perform these steps and generate the number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 May 2005 16:51:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-conversion/m-p/905195#M55964</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-13T16:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: type conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-conversion/m-p/905196#M55965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the modified code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: v_char44(44) TYPE c,
      v_value(2)   TYPE n,
      v_digit      TYPE n,
      v_oddoreven  TYPE i,
      v_pos        TYPE i,
      v_result     TYPE i,
      v_value_i    TYPE i.


START-OF-SELECTION.
  v_char44 = '4129796'.
*-- get rid of leading spaces.
  SHIFT v_char44 LEFT DELETING LEADING space.

  DO 44 TIMES.
    v_pos = sy-index - 1.
    IF v_char44+0(1) IS INITIAL.
*-- no more filled in positions, exit
      EXIT.
    ENDIF.
    v_digit = v_char44+v_pos(1).
    v_oddoreven = sy-index MOD 2.
    v_value = v_digit.
    IF v_oddoreven = 0.
*-- even number,
      v_value_i = v_value.
    ELSE.
*-- odd number
      v_value = v_digit * 2.
      IF v_value &amp;gt; 9.
*-- number has two digits
        v_value_i = v_value+0(1) + v_value+1(1).
      ELSE.
        v_value_i = v_value.
      ENDIF.
    ENDIF.
    v_result = v_value_i + v_result.
  ENDDO.

  CLEAR: v_value_i, v_digit, v_value.

  v_value_i = v_result MOD 10.

  CLEAR v_result.
  v_result =  10 - v_value_i.
  WRITE:/ v_result.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 May 2005 18:23:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-conversion/m-p/905196#M55965</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-13T18:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: type conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-conversion/m-p/905197#M55966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Srinivas. It solved my problem. I really appreciate your  help in this regard. have nice weekend.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 May 2005 19:12:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-conversion/m-p/905197#M55966</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-13T19:12:23Z</dc:date>
    </item>
  </channel>
</rss>

