<?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: Dynpro field values conversion in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynpro-field-values-conversion/m-p/5394307#M1239725</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;Then check this FM  HRCM_STRING_TO_AMOUNT_CONVERT this will solve the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: l_char TYPE char10 VALUE '10,000.54'.
DATA l_betrg TYPE betrg.

CALL FUNCTION 'HRCM_STRING_TO_AMOUNT_CONVERT'
  EXPORTING
    string              = l_char
    decimal_separator   = '.'
    thousands_separator = ','
    waers               = 'INR'
  IMPORTING
    betrg               = l_betrg
  EXCEPTIONS
    convert_error       = 1.

WRITE l_betrg.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Apr 2009 17:19:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-08T17:19:00Z</dc:date>
    <item>
      <title>Dynpro field values conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynpro-field-values-conversion/m-p/5394303#M1239721</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'm using FM DYNP_READ_VALUES to get actual values from the screen. The problem is, the fieldvalue component of the output structure is of type CHAR, but the dynpro field is of type DEC, and I'm getting exception CX_SY_CONVERSION_NO_NUMBER when I'm trying to move the dynpro value ie. '46,20' to global variable of type DEC. Any way how to solve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2009 10:41:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynpro-field-values-conversion/m-p/5394303#M1239721</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-07T10:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Dynpro field values conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynpro-field-values-conversion/m-p/5394304#M1239722</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;You can do this way..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA l_val type i.
DATA l_fieldvalue(10) type c value '45,20'.  " values as returned from th FM

Replace ',' in l_fieldvalue with space.
Condense l_fieldvalue.

l_val = l_fieldvalue.
l_paramenter = l_val / 100.  " l_parameter is the screen field and now you have 45.20 as value
" you can change 100 as per the number of decimals&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2009 10:50:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynpro-field-values-conversion/m-p/5394304#M1239722</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-07T10:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Dynpro field values conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynpro-field-values-conversion/m-p/5394305#M1239723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;thanks for fast reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes I know I could "hack" it this way, but I was thinking of a more generic way, which would be suitable for other data types as well, ie. QUAN etc, independently of my language environment (Czech in my case, that's why numeric format is like '45,20').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2009 11:01:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynpro-field-values-conversion/m-p/5394305#M1239723</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-07T11:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dynpro field values conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynpro-field-values-conversion/m-p/5394306#M1239724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can use the following code:&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;DATA: L_FIELDFALUE(5) TYPE C VALUE '46,20',&lt;/P&gt;&lt;P&gt;     OUTPUT(5) TYPE P  DECIMALS 2,&lt;/P&gt;&lt;P&gt;     L_DCPFM TYPE USR01-DCPFM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*select the number notation format&lt;/P&gt;&lt;P&gt;SELECT SINGLE DCPFM INTO L_DCPFM FROM USR01 WHERE&lt;/P&gt;&lt;P&gt;    BNAME = SY-UNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'AMOUNT_STRING_CONVERT'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      AMOUNT_STRING = L_FIELDFALUE&lt;/P&gt;&lt;P&gt;      DCPFM                 = L_DCPFM&lt;/P&gt;&lt;P&gt;      WAERS                = 'INR'  " pass your countrys' currency&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      AMOUNT               = OUTPUT.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;You can also use following function modules for different type of conversion:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AMOUNT_STRING_CONVERT&lt;/P&gt;&lt;P&gt;DATE_STRING_CONVERT&lt;/P&gt;&lt;P&gt;PERIOD_STRING_CONVERT&lt;/P&gt;&lt;P&gt;PRICE_STRING_CONVERT&lt;/P&gt;&lt;P&gt;UNITS_STRING_CONVERT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2009 17:10:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynpro-field-values-conversion/m-p/5394306#M1239724</guid>
      <dc:creator>venkatesan_nagiah</dc:creator>
      <dc:date>2009-04-08T17:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Dynpro field values conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynpro-field-values-conversion/m-p/5394307#M1239725</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;Then check this FM  HRCM_STRING_TO_AMOUNT_CONVERT this will solve the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: l_char TYPE char10 VALUE '10,000.54'.
DATA l_betrg TYPE betrg.

CALL FUNCTION 'HRCM_STRING_TO_AMOUNT_CONVERT'
  EXPORTING
    string              = l_char
    decimal_separator   = '.'
    thousands_separator = ','
    waers               = 'INR'
  IMPORTING
    betrg               = l_betrg
  EXCEPTIONS
    convert_error       = 1.

WRITE l_betrg.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2009 17:19:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynpro-field-values-conversion/m-p/5394307#M1239725</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-08T17:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dynpro field values conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynpro-field-values-conversion/m-p/5394308#M1239726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try the PACK statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[http://help.sap.com/saphelp_47x200/helpdata/EN/87/56d00722c011d2954a0000e8353423/content.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2009 17:21:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynpro-field-values-conversion/m-p/5394308#M1239726</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-08T17:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: Dynpro field values conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynpro-field-values-conversion/m-p/5394309#M1239727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Venkatesan Nagiah,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FM you suggested are exactly what I need, thanks a lot. They work perfectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks all others as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2009 17:38:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynpro-field-values-conversion/m-p/5394309#M1239727</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-08T17:38:06Z</dc:date>
    </item>
  </channel>
</rss>

