<?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: Currency format in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-format/m-p/3297170#M789061</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunaltey direct WRITE was not working. But I've got some cool ideas from the FM HRCM_STRING_TO_AMOUNT_CONVERT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The working solution is the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: gv_amount_char1(20),&lt;/P&gt;&lt;P&gt;      gv_amount_char2(20),&lt;/P&gt;&lt;P&gt;      gv_packed TYPE p DECIMALS 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE '123456.78' TO gv_amount_char1.&lt;/P&gt;&lt;P&gt;CLEAR: gv_amount_char2, gv_packed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE gv_amount_char1 TO gv_packed.&lt;/P&gt;&lt;P&gt;WRITE gv_packed TO gv_amount_char2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;output of gv_amount_char2 is 123.456,78&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Jan 2008 11:11:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-21T11:11:28Z</dc:date>
    <item>
      <title>Currency format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-format/m-p/3297166#M789057</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;I have a character field, which contains numbers like this: 123456.78&lt;/P&gt;&lt;P&gt;I would like to convert them into an another character field (NOT currency) iwth a format like this: 123.456,78&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course it has to handle the lower and higher numbers also:&lt;/P&gt;&lt;P&gt;123.45 -&amp;gt; 123,45&lt;/P&gt;&lt;P&gt;111222333,44 -&amp;gt; 111.222.333,44&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's the easiest solution for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Tamá&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2008 10:20:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/currency-format/m-p/3297166#M789057</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-21T10:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Currency format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-format/m-p/3297167#M789058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tamas, check this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currency Conversion:&lt;/P&gt;&lt;P&gt;______________________&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the function module&lt;/P&gt;&lt;P&gt;CONVERT_TO_LOCAL_CURRENCY &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Writing currency amount to string without thousands seperator &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is usefull e.g. i connection with batch input/call transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;GI_OUTPUT-WRBTR: Field type Currency with amount&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;L_AMOUNT_STRING: Field type c with amount&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM AMOUNT_TO_STRING USING GI_OUTPUT-WRBTR&lt;/P&gt;&lt;P&gt;CHANGING L_AMOUNT_STRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM AMOUNT_TO_STRING USING P_AMOUNT&lt;/P&gt;&lt;P&gt;CHANGING P_AMOUNT_STRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA L_SEP(1) TYPE C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM GET_THOUSAND_SEPERATOR USING L_SEP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE P_AMOUNT TO P_AMOUNT_STRING.&lt;/P&gt;&lt;P&gt;REPLACE L_SEP WITH ' ' INTO P_AMOUNT_STRING.&lt;/P&gt;&lt;P&gt;CONDENSE P_AMOUNT_STRING NO-GAPS.&lt;/P&gt;&lt;P&gt;WRITE P_AMOUNT_STRING TO P_AMOUNT_STRING RIGHT-JUSTIFIED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM GET_THOUSAND_SEPERATOR USING P_SEP.&lt;/P&gt;&lt;P&gt;DATA: L_AMOUNT LIKE BSEG-DMBTR,&lt;/P&gt;&lt;P&gt;L_AMOUNT_STRING(15) TYPE C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Find 1000 seperator. If decimal seperator = . then&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;1000 seperator = , else 1000 seperator = .&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;L_AMOUNT = '1.00'.&lt;/P&gt;&lt;P&gt;WRITE L_AMOUNT TO L_AMOUNT_STRING.&lt;/P&gt;&lt;P&gt;IF L_AMOUNT_STRING CS ','.&lt;/P&gt;&lt;P&gt;P_SEP = '.'.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;P_SEP = ','.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Convert amount to/from string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'HRCM_AMOUNT_TO_STRING_CONVERT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;betrg = 3000&lt;/P&gt;&lt;P&gt;WAERS = 'DKK'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NEW_DECIMAL_SEPARATOR =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NEW_THOUSANDS_SEPARATOR =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;STRING = slam&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'HRCM_STRING_TO_AMOUNT_CONVERT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;string = slam2&lt;/P&gt;&lt;P&gt;DECIMAL_SEPARATOR = '.'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;THOUSANDS_SEPARATOR =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WAERS = 'HUF'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;BETRG = b2&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CONVERT_ERROR = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Language depending formatting&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To format a currency amount with decimals according to the currency use&lt;/P&gt;&lt;P&gt;WRITE and the CURRENCY option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currency keys an d numbers of decimals are defined in table TCURX Decimal&lt;/P&gt;&lt;P&gt;Places in Currencies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.G.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Formatting an amount in Kuwatian Dinars:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dmbtr = 123456.&lt;/P&gt;&lt;P&gt;Write dmbtr currency 'KUD'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;123.456&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Write dmbtr currency 'USD'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1234.56&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the formatting does not depend on the number of decimals in the&lt;/P&gt;&lt;P&gt;number in the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dmbtr = '12.3456'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Write dmbtr currency 'USD'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1234.56&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To format the decimal and thousand sepearators according to the settings for&lt;/P&gt;&lt;P&gt;a specific country,&lt;/P&gt;&lt;P&gt;use the statement SET COUNTRY &amp;lt;country key&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Settings for countries are defined in table T005 Countries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The country key used in the statement is field LAND1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set country 'US'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kindly reward if found helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Hema.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2008 10:22:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/currency-format/m-p/3297167#M789058</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-21T10:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: Currency format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-format/m-p/3297168#M789059</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;Go in su01 give the user for which you want to define these settings and under user settings you can define the number formats.&lt;/P&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;Regards,&lt;/P&gt;&lt;P&gt;Siddhesh S.Tawate&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2008 10:23:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/currency-format/m-p/3297168#M789059</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-21T10:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Currency format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-format/m-p/3297169#M789060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tamas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please use the Write statement with the currency addition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write v_amt_char1 to v_amt_char2 currency 'USD'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Youor currency key will vary based upon the entry in T005X with the format that you are looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ranganath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2008 10:24:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/currency-format/m-p/3297169#M789060</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-21T10:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: Currency format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-format/m-p/3297170#M789061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunaltey direct WRITE was not working. But I've got some cool ideas from the FM HRCM_STRING_TO_AMOUNT_CONVERT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The working solution is the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: gv_amount_char1(20),&lt;/P&gt;&lt;P&gt;      gv_amount_char2(20),&lt;/P&gt;&lt;P&gt;      gv_packed TYPE p DECIMALS 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE '123456.78' TO gv_amount_char1.&lt;/P&gt;&lt;P&gt;CLEAR: gv_amount_char2, gv_packed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE gv_amount_char1 TO gv_packed.&lt;/P&gt;&lt;P&gt;WRITE gv_packed TO gv_amount_char2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;output of gv_amount_char2 is 123.456,78&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2008 11:11:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/currency-format/m-p/3297170#M789061</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-21T11:11:28Z</dc:date>
    </item>
  </channel>
</rss>

