Hello expert,
sorry by the cross-post, I posted something similar on the SRM place on SCN, but lately realized it has probably more to do with WD abap.
Shortly: I noticed that SRM manages prices in documents such as PO or contract according to the currency value.
In particular:
1 - PRICE value, at item level, is rendered via abap WD with the proper number of decimals according to the selected currency.
For instance, if dealing with CLP (chile pesos), which is defined without decimals, then prices are automatically rendered without decimals:
I.e: entering 156,00 -> on screen only 156 is shown (correctly without decimals, as CLP currency is defined with 0 decimals).
while if the currency is EUR, then 2 digits after comma are allowed and representation switches to 2 decimals (e.g. "156,00")... Note I'm just talking about how the system renders the price, without considering conversions between different currencies.
2 - If I enter a value, say 123,45, as price for an item where the currency is set by customizing as a 0 decimals, then I get the error (DB 739):
"Too many decimal places (maximum &)"
and the price inputfield in the item table is highlighted with a red box.
Now... I'd like to understand if it's possible to obtain the same behaviour for a custom "price" field, let's call it Z_PRICE, at header's level.
This field is typized as CURR and has BBPS_CTR_HEADER (or BBP_PDHGP, tried both) -> CURRENCY entry in the "Currency/Quantity fields" tab.
This field, so far, is not subjected to any validation and does not dynamically react to currency's changes.
That is to say, for instance:
- CURRENCY is set to EUR (2 decimals);
- enter a value in Z_PRICE, let's say "150,00";
- switch currency to "CLP" (chilean pesos, 0 decimals);
While all item prices (standard fields) do not show any decimals, Z_PRICE remains unaltered with two digits after comma.
Is there a way to obtain the same standard behaviour on Z_PRICE field? I thought it could be related to the "Currency/Quantity fields" in the definition of the custom field itself, but no matter what I specify, it simply doesn't seem to affect the runtime behaviour in any way.
Help/suggestions on this task?
Thanks in advance,
M.