<?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 convert text to amount in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-to-amount/m-p/877342#M50916</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;given this simple problem:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: text(10), amount type p decimals 2.
text = '20,000.00'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;how do i pass the value of 20,000.00 to the amount variable without incurring ABAP runtime errors, besides manually removing the "," delimiters for each thousand?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(actually the amount field is type currency, but i know currency and packed are the same in nature)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ryan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Feb 2005 07:14:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-02-22T07:14:15Z</dc:date>
    <item>
      <title>convert text to amount</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-to-amount/m-p/877342#M50916</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;given this simple problem:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: text(10), amount type p decimals 2.
text = '20,000.00'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;how do i pass the value of 20,000.00 to the amount variable without incurring ABAP runtime errors, besides manually removing the "," delimiters for each thousand?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(actually the amount field is type currency, but i know currency and packed are the same in nature)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ryan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2005 07:14:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-to-amount/m-p/877342#M50916</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-02-22T07:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: convert text to amount</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-to-amount/m-p/877343#M50917</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;- If you don't want a short time error, use the command catch. &lt;/P&gt;&lt;P&gt;Ex :&lt;/P&gt;&lt;P&gt;catch system-exceptions conversion_errors = 1.&lt;/P&gt;&lt;P&gt;move ... to text.&lt;/P&gt;&lt;P&gt;endcatch.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 1.&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;- I write always my own form to convert text amount to value amount with replace '.' by ',' ...  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Frédéric&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2005 07:33:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-to-amount/m-p/877343#M50917</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2005-02-22T07:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: convert text to amount</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-to-amount/m-p/877344#M50918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here's an example to catch/change the value:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT z6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA digit(11) VALUE ' 0123456789'.&lt;/P&gt;&lt;P&gt;PARAMETERS: text(16) DEFAULT '20,000.00'.&lt;/P&gt;&lt;P&gt;DATA c_text(16).&lt;/P&gt;&lt;P&gt;DATA  amount TYPE p DECIMALS 2.&lt;/P&gt;&lt;P&gt;DATA n TYPE n.&lt;/P&gt;&lt;P&gt;DATA i TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c_text = text.&lt;/P&gt;&lt;P&gt;CATCH SYSTEM-EXCEPTIONS conversion_errors = 1.&lt;/P&gt;&lt;P&gt;  MOVE c_text TO amount.&lt;/P&gt;&lt;P&gt;ENDCATCH.&lt;/P&gt;&lt;P&gt;IF sy-subrc EQ 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'PREPARE_STRING'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            i_valid_chars  = digit&lt;/P&gt;&lt;P&gt;            i_xvalid_check = 'X'&lt;/P&gt;&lt;P&gt;            i_xchar_repl   = 'X'&lt;/P&gt;&lt;P&gt;            i_xtoupper     = 'X'&lt;/P&gt;&lt;P&gt;       CHANGING&lt;/P&gt;&lt;P&gt;            c_string       = c_text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CONDENSE c_text NO-GAPS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DESCRIBE FIELD amount DECIMALS n.&lt;/P&gt;&lt;P&gt;  i = 10 ** n.&lt;/P&gt;&lt;P&gt;  amount = c_text / i.&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;WRITE:/ text, 50 amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2005 08:57:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-to-amount/m-p/877344#M50918</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2005-02-22T08:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: convert text to amount</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-to-amount/m-p/877345#M50919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;frederic, andreas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;amazing help you've given me - thanks for all the input. i've showered you with stars already... &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ryan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2005 10:32:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-to-amount/m-p/877345#M50919</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-02-22T10:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: convert text to amount</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-to-amount/m-p/877346#M50920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;you can use as well funtion module &amp;lt;b&amp;gt;HRCM_STRING_TO_AMOUNT_CONVERT&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2005 22:24:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-to-amount/m-p/877346#M50920</guid>
      <dc:creator>former_member182371</dc:creator>
      <dc:date>2005-02-22T22:24:37Z</dc:date>
    </item>
  </channel>
</rss>

