Interface Converter
-
- All Known Implementing Classes:
ConverterImpl
public interface ConverterConverter BO functionality.
Retrieves currency and unit scales and also is able to convert unit keys (language independent) into unit ID's.
The language does not need to be provided, it is taken from the sessionlocale.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBO_TYPEIdentifier to access the Converter BO from the BOManager
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringconvertUnitID2UnitKey(java.lang.String unitID)Converts the unit ID (examplePCfor en_US) into the unit key (exampleST)java.lang.StringconvertUnitKey2UnitID(java.lang.String unitKey)Converts the unit key (exampleST) into the language dependent ID (examplePCfor en_US)java.lang.IntegergetCurrencyScale(java.lang.String sapCurrencyCode)Retrieves the number of decimal places for a currency (which might be an ISO currency but doesn't need to be).java.math.BigDecimalgetMinimumScaleValue(java.lang.String unitKey)intgetUnitScale(java.lang.String unitKey)Retrieves the number of decimal places for units according to ERP/CRM customizing.
-
-
-
Field Detail
-
BO_TYPE
static final java.lang.String BO_TYPE
Identifier to access the Converter BO from the BOManager- See Also:
- Constant Field Values
-
-
Method Detail
-
convertUnitKey2UnitID
java.lang.String convertUnitKey2UnitID(java.lang.String unitKey) throws BusinessObjectExceptionConverts the unit key (exampleST) into the language dependent ID (examplePCfor en_US)- Parameters:
unitKey- language independent unit key- Returns:
- language dependent unit ID
- Throws:
BusinessObjectException
-
convertUnitID2UnitKey
java.lang.String convertUnitID2UnitKey(java.lang.String unitID) throws BusinessObjectExceptionConverts the unit ID (examplePCfor en_US) into the unit key (exampleST)- Parameters:
unitID- language dependent unit ID- Returns:
- unit key
- Throws:
BusinessObjectException
-
getCurrencyScale
java.lang.Integer getCurrencyScale(java.lang.String sapCurrencyCode) throws BusinessObjectExceptionRetrieves the number of decimal places for a currency (which might be an ISO currency but doesn't need to be).
Basis is the ERP/CRM customizing in tables TCURX and TCURC.
Examples: USD typically has 2 decimal places, JPY has zero.- Parameters:
sapCurrencyCode- currency code. Must be available in customizing tabke TCURC- Returns:
- number of decimal places
- Throws:
BusinessObjectException
-
getUnitScale
int getUnitScale(java.lang.String unitKey) throws BusinessObjectExceptionRetrieves the number of decimal places for units according to ERP/CRM customizing. This is relevant for UI display in case the unit amount is not an integer.- Parameters:
unitKey- the language independet unit key. Must be available in customizing table T006- Returns:
- the number of decimal places for UI display
- Throws:
BusinessObjectException
-
getMinimumScaleValue
java.math.BigDecimal getMinimumScaleValue(java.lang.String unitKey) throws BusinessObjectException- Parameters:
unitKey- the language independet unit key. Must be available in customizing table T006- Returns:
- BigDecimal representing the smallest value given a scale
- Throws:
BusinessObjectException
-
-