0% found this document useful (0 votes)
1K views2 pages

Convert Currency Value From Sap To Display

This document summarizes a code sample that uses the CURRENCY_AMOUNT_SAP_TO_DISPLAY function module to properly convert a currency value stored in SAP to its correct displayed value. The function module takes a currency code and internal SAP amount as input and returns the correctly formatted displayed amount. Without using this function, currency values stored in SAP are often missing significant digits like zeroes. The code sample demonstrates calling the function module and outputting the stored, currency code, and displayed values for validation.

Uploaded by

Vas Deva
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views2 pages

Convert Currency Value From Sap To Display

This document summarizes a code sample that uses the CURRENCY_AMOUNT_SAP_TO_DISPLAY function module to properly convert a currency value stored in SAP to its correct displayed value. The function module takes a currency code and internal SAP amount as input and returns the correctly formatted displayed amount. Without using this function, currency values stored in SAP are often missing significant digits like zeroes. The code sample demonstrates calling the function module and outputting the stored, currency code, and displayed values for validation.

Uploaded by

Vas Deva
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Convert currency value from SAP to display

Written by Anon. Monday, 22 December 2008 08:00 -

The following code shows how CURRENCY_AMOUNT_SAP_TO_DISPLAY can be used. You pass it a Currency code(WAERS) and an SAP stored currency value. It will convert the value into its correct currency 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,

1/2

Convert currency value from SAP to display


Written by Anon. Monday, 22 December 2008 08:00 -

/(30) 'Ammount is displayed Currency:', gd_disval.

2/2

You might also like