<?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: converting string to numeric in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-string-to-numeric/m-p/6393146#M1405072</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: lv_percent   TYPE i.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should work fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Dec 2009 05:48:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-12-01T05:48:11Z</dc:date>
    <item>
      <title>converting string to numeric</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-string-to-numeric/m-p/6393142#M1405068</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;&lt;/P&gt;&lt;P&gt;I want to convert string to numeric for some calculation and want to pass the calculated amount back to string. I am using the below given code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
METHOD get_percent_inc_amt.
data: lv_percent TYpe numc3,
      lv_base_sal TYPE i,
      lv_cal_amt TYPE i.

*WRITE iv_base_salary to lv_base_sal.
*WRITE iv_percent to lv_percent.

CALL FUNCTION 'CONVERT_STRING_TO_INTEGER'
  EXPORTING
    p_string            = iv_base_salary
 IMPORTING
   P_INT               = lv_base_sal
* EXCEPTIONS
*   OVERFLOW            = 1
*   INVALID_CHARS       = 2
*   OTHERS              = 3
          .
IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


CALL FUNCTION 'CONVERT_STRING_TO_INTEGER'
  EXPORTING
    p_string            = iv_percent
 IMPORTING
   P_INT               = lv_percent
* EXCEPTIONS
*   OVERFLOW            = 1
*   INVALID_CHARS       = 2
*   OTHERS              = 3
          .
IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

  lv_cal_amt = ( lv_base_sal * lv_percent ) / 100.
   ev_calculated_amt = lv_cal_amt.

ENDMETHOD.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting dump in my application. Can anyone suggest me on how should I do the conversion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shilpa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2009 04:44:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-string-to-numeric/m-p/6393142#M1405068</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-01T04:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: converting string to numeric</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-string-to-numeric/m-p/6393143#M1405069</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;Change the type of lv_percent from numc3 to interger (i).&lt;/P&gt;&lt;P&gt;Dump occuring due to type mismatch conflict.&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>Tue, 01 Dec 2009 04:53:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-string-to-numeric/m-p/6393143#M1405069</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-01T04:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: converting string to numeric</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-string-to-numeric/m-p/6393144#M1405070</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;What is the dump?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, the FM accepts data type of Integer for theexporting parameter.&lt;/P&gt;&lt;P&gt;You have specified &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: lv_percent TYpe numc3.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the data type to integer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2009 04:54:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-string-to-numeric/m-p/6393144#M1405070</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-01T04:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: converting string to numeric</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-string-to-numeric/m-p/6393145#M1405071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shilpa&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you must have got dump beacuse of type mismatch &lt;/P&gt;&lt;P&gt;Change the type  and it will run fine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Nilesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2009 05:15:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-string-to-numeric/m-p/6393145#M1405071</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-01T05:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: converting string to numeric</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-string-to-numeric/m-p/6393146#M1405072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: lv_percent   TYPE i.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should work fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2009 05:48:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-string-to-numeric/m-p/6393146#M1405072</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-01T05:48:11Z</dc:date>
    </item>
  </channel>
</rss>

