I have noticed that when I use 2 fields for currencies that are defined with types NETWR (domain WERT8) and WAERS (domain WAERS) and properly linked on screen (referenced with DD) that conversion is not working properly. For example:
REPORT zr_huf_test. TABLES bkpf. PARAMETERS: p_waers LIKE bkpf-waers, p_wrbtr LIKE bseg-wrbtr. PARAMETERS: p_waers1 TYPE waers, p_wrbtr1 TYPE netwr. INITIALIZATION. bkpf-waers = p_waers = p_waers1 = 'HUF'. AT SELECTION-SCREEN OUTPUT. bkpf-waers = p_waers. START-OF-SELECTION. WRITE: p_wrbtr, / p_wrbtr CURRENCY p_waers. SKIP 2. WRITE: p_wrbtr1, / p_wrbtr1 CURRENCY p_waers1.
As you may know, some currencies in SAP do not have decimal places (HUF, JPY...). This is happening for this currencies. Why, is the problem in WERT8 with sign or what? Also what is strange and I can not explain myself, my program in selects value from DB, i.e. 1,00 HUF. As HUF doesn't have decimal places, on screen it is displayed as 100 HUF, which is just fine.
But if I press ENTER, program goes to PAI module and variable that I use on screen contains 100,00HUF, which is completly WRONG and guess what, after each ENTER value is multiplied by 100?! What is the reason of that behavior?