CURRENCY_AMOUNT_SAP_TO_DISPLAY FM to Convert currency value from SAP to display

The following code shows how CURRENCY_AMOUNT_SAP_TO_DISPLAY can be used. You pass it a Currecny code(WAERS) and an SAP stored currency value. It will convert the value into its correct currecny value. Without using this function module you are not guaranteed to be using the correct value as it is often missing a number of zeroes.

I.e. 28000 JPY is stored within SAP as 280.


* DATA declaration
*-----------------
* WMTO_S-AMOUNT =  Type DEC :: length 15 :: Deciamls 4 
parameter: p_discur like TCURC-WAERS,     "Display currency
           p_intval like WMTO_S-AMOUNT.   "Internal Amount
data:      gd_disval  like WMTO_S-AMOUNT. "Display Amount

***************************************************************
*Start-of-selection.
START-OF-SELECTION.
CALL FUNCTION 'CURRENCY_AMOUNT_SAP_TO_DISPLAY'
     EXPORTING
          currency        = p_discur
          amount_internal = p_intval
    IMPORTING
         AMOUNT_DISPLAY   = gd_disval
    EXCEPTIONS
         INTERNAL_ERROR   = 1
         OTHERS           = 2.
IF sy-subrc EQ 0.
*  You are now able to manipulate the returned value.
*                         I.e. Convert it to GBP
*  Without using this function module you would only be manipulating the
*  SAP stored value, which is often missing a number of zeroes.
*       I.e. 28000 JPY is stored within SAP as 280.
ENDIF.

***************************************************************
*End-of-selection.
END-OF-SELECTION.
write:/(30)  'Value stored in SAP:', p_intval,
      /(30)  'Displayed currency:',  p_discur,
      /(30)  'Ammount is displayed Currency:', gd_disval.


Check out sap documentation and pattern details for function module currency_amount_sap_to_display on website se80.co.uk

Related Articles

ABAP4_CALL_TRANSACTION sap function module
BAPI_ALM_ORDER_MAINTAIN sap BAPI / Function Module to create a work order
Function module BAPI_EMPLCOMM_CREATE to maintain the SAP HR communication infotype 0105
CLPB_EXPORT sap function module
CLPB_IMPORT sap function module
CONVERT_DATE_TO_EXTERNAL sap function module
CREATE_TEXT sap function module
CURRENCY_AMOUNT_DISPLAY_TO_SAP sap function module to Convert currency value from display to SAP
DATE_COMPUTE_DAY sap function module
DATE_TO_DAY sap function module
DOCU_READ sap function module
ENQUEUE_READ sap function module
F4IF_INT_TABLE_VALUE_REQUEST sap function module
FILE_GET_NAME sap function module
SAP Application specific function modules
SAP Custom function modules
SAP field conversion function modules
SAP HR specific function modules
SAP development function modules
Retrieve employees address details (own data)
Function Module DYNP_VALUES_UPDATE to Change screen field contents
sxpg_command_execute FM to Execute external commands (FTP Scripts)
DETERMINE_PERIOD FM to Retrieve fiscal year and period
Function module HR_INFOTYPE_OPERATION to maintain SAP HR infotypes
RH_PM_GET_STRUCTURE FM to retrieve HR Organisation Structure
Validate WBS (code used in ME21)
HR_READ_INFOTYPE SAP FM to Read infotype data
READ_TEXT FM to Read SAP texts
ADDR_PERS_COMP_COMM_MAINTAIN to Update sap users email address plus other details (own data)
HR_PERSONAL_WORK_SCHEDULE to Retrieve employees work schedule
NUMBER_GET_NEXT to get next number in number range sap function module
Generate random number using QF05_RANDOM_INTEGER SAP function module within your ABAP code
RSEC_GENERATE_PASSWORD SAP FM to generate user password
The SAP internet user functionality and Password BAPIs
SAPGUI_SET_FUNCTIONCODE sap function module to execute function code
SX_INTERNET_ADDRESS_TO_NORMAL SAP function module to check email format is correct