sapdev logo background
sapdev logo sapdev logo
Comments

Convert currency value from internal(SAP) to external(display)




Values stored in fields of type CURR can have different values than those displayed on screen. To ensure the correct value is displayed on screen or used in calculations the value in the field must be accosiated to its currency unit. This can be done using a number of standard ABAP statements like WRITE/ *Write TO and also with the FM CURRENCY_AMOUNT_SAP_TO_DISPLAY. Once you have done this you may want to convert the value to another currency.


* Convert Internal SAP value to Currency value 
  data:      p_intval like wmto_s-amount.   "Internal Amount
  data:      gd_disval  like wmto_s-amount. "Display Amount

  call function 'CURRENCY_AMOUNT_SAP_TO_DISPLAY'
       exporting
            currency        = po_tab-waers
            amount_internal = p_intval
       importing
            amount_display  = gd_disval
       exceptions
            internal_error  = 1
            others          = 2.



comments powered by Disqus