Interface Converter

  • All Known Implementing Classes:
    ConverterImpl

    public interface Converter
    Converter 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 session locale.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String BO_TYPE
      Identifier to access the Converter BO from the BOManager
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String convertUnitID2UnitKey​(java.lang.String unitID)
      Converts the unit ID (example PC for en_US) into the unit key (example ST )
      java.lang.String convertUnitKey2UnitID​(java.lang.String unitKey)
      Converts the unit key (example ST ) into the language dependent ID (example PC for en_US)
      java.lang.Integer getCurrencyScale​(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.BigDecimal getMinimumScaleValue​(java.lang.String unitKey)  
      int getUnitScale​(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 BusinessObjectException
        Converts the unit key (example ST ) into the language dependent ID (example PC for 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 BusinessObjectException
        Converts the unit ID (example PC for en_US) into the unit key (example ST )
        Parameters:
        unitID - language dependent unit ID
        Returns:
        unit key
        Throws:
        BusinessObjectException
      • getCurrencyScale

        java.lang.Integer getCurrencyScale​(java.lang.String sapCurrencyCode)
                                    throws BusinessObjectException
        Retrieves 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 BusinessObjectException
        Retrieves 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