SAP ABAP Class CL_FDT_AMOUNT_CONV (FDT Service: Conversion of amounts w. currencycode)
Hierarchy
SAP_BASIS (Software Component) SAP Basis Component
   BC-SRV-BR (Application Component) BRFplus - ABAP-Based Business Rules
     SFDT_SERVICE (Package) BRFplus: Services
Properties
Class CL_FDT_AMOUNT_CONV  
Short Description FDT Service: Conversion of amounts w. currencycode    
Super Class    
Instantiability of a Class 2  Public 
Final    
General Data
Message Class    
Program status     
Category 0   
Package SFDT_SERVICE   BRFplus: Services 
Created 20060328   SAP 
Last change 20130531   SAP 
Shared Memory-enabled    
Fixed point arithmetic    
Unicode checks active    
Forward declarations
# Type group / Object type Type Type Description
1 ABAP Type group use (TYPE-POOLS tp)  Type group use (TYPE-POOLS tp)
2 IF_FDT_TYPES Forward declaration interface (INTERFACE i DEFINITION DEF...  Forward declaration interface (INTERFACE i DEFINITION DEF...
Interfaces
Class CL_FDT_AMOUNT_CONV has no interface implemented.
Friends
Class CL_FDT_AMOUNT_CONV has no friend class.
Attributes
# Attribute Level Visibility Read only Typing Associated Type Initial Value Description Created on
1 GC_ABAP_DECIMALS_SEPARATOR Constant Private Type reference (TYPE) C '.' ABAP decimals separator 20120821
2 GC_DECIMALS_DEFAULT Constant Private Type reference (TYPE) I 2 Default number of decimals of currencies 20120822
3 GTH_CURR_DEC Static Attribute Private Type reference (TYPE) TH_CURR_DEC 20120706
4 GTH_CURR_EXIST Static Attribute Private Type reference (TYPE) TH_CURR_EXIST 20100108
Methods
# Method Level Visibility Method type Description Created on
1 COMPARE_AMOUNTS Static method Public Method BRS Compare two amounts 20060412
2 CONVERT_AMOUNT Static method Public Method BRS Convert amount into another currency code 20060328
3 CONVERT_FROM_CURR Static method Public Method BRS Deprecated 20090623
4 CONVERT_INT_TO_EXT Static method Public Method BRS Convert internal to external representation 20090617
5 CONVERT_STRING_TO_AMOUNT Static method Public Method BRS Convert string to amount 20130813
6 CONVERT_TO_CURR Static method Public Method BRS Deprecated 20090623
7 CURRENCY_EXIST Static method Public Method BRS Returns abap_true if the currency code exists 20060331
8 DECODE_CURR Static method Public Method BRS TCURX-encoded CURR amount into BRFplus amount number 20120816
9 DECODE_CURR_STRING Static method Public Method BRS TCURX-encoded CURR amount into BRFplus amount number 20120821
10 ENCODE_CURR Static method Public Method BRS BRFplus amount number into TCURX-encoded CURR amount 20120821
11 GET_CURRENCY_DECIMALS Static method Public Method BRS Get number of decimals for currency (TCURX), default 2 20090715
12 GET_CURRENCY_LIST Static method Public Method BRS Returns list with all currency codes 20061030
13 ROUND Static method Public Method Round the amount according to its currency decimals 20120413
14 SHIFT Static method Private Method Shift number by specified digits 20090624
15 SHIFT_NO_DECIMALS Static method Private Method Shift amount to whole number 20090624
16 TO_STRING Static method Public Method BRS Concat number and currency, no user specific conversion 20120814
Events
Class CL_FDT_AMOUNT_CONV has no event.
Types
# Type Visibility Typing Associated Type Description Created on Type Source
1 AMOUNT_INTERNAL Public See coding 20090520 amount_internal TYPE p LENGTH 16 DECIMALS 0
2 S_CURR_DEC Private See coding 20120706 BEGIN OF s_curr_dec, curr TYPE if_fdt_types=>element_currency, dec TYPE i, END OF s_curr_dec
3 S_CURR_EXIST Private See coding 20100108 BEGIN OF s_curr_exist, curr TYPE if_fdt_types=>element_currency, exist TYPE abap_bool, END OF s_curr_exist
4 TH_CURR_DEC Private See coding 20120706 th_curr_dec TYPE HASHED TABLE OF s_curr_dec WITH UNIQUE KEY curr
5 TH_CURR_EXIST Private See coding 20100108 th_curr_exist TYPE HASHED TABLE OF s_curr_exist WITH UNIQUE KEY curr
Method Signatures

Method COMPARE_AMOUNTS Signature

# Type Parameter Pass Value Optional Typing Method Associated Type Default value Description Created on
1 Exporting EV_RESULT Call by reference Type reference (TYPE) ABAP_BOOL 20060412
2 Importing IV_AMOUNT_FIRST Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_NUMBER Elementary Data Type Number 20060412
3 Importing IV_AMOUNT_SECOND Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_NUMBER Elementary Data Type Number 20060412
4 Importing IV_CURRENCY_FIRST Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_CURRENCY Elementary Data Type Currency Key 20060412
5 Importing IV_CURRENCY_SECOND Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_CURRENCY Elementary Data Type Currency Key 20060412
6 Importing IV_EXCHANGE_RATE_TYPE Call by reference Type reference (TYPE) STRING 20060412
7 Importing IV_RELATIONAL_OPERATOR Call by reference Type reference (TYPE) DDOPTION Relational Operator 20060412
8 Importing IV_TIMESTAMP Call by reference Type reference (TYPE) IF_FDT_TYPES=>TIMESTAMP 20060412
# Exception Resumable Description Created on
1 CX_FDT_CONVERSION FDT: Processing Error 20060907

Method CONVERT_AMOUNT Signature

# Type Parameter Pass Value Optional Typing Method Associated Type Default value Description Created on
1 Exporting EV_AMOUNT_OUT Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_NUMBER FDT: Elementary Data Type Number 20060329
2 Importing IV_AMOUNT_IN Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_NUMBER FDT: Elementary Data Type Number 20060328
3 Importing IV_CURRENCY_IN Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_CURRENCY FDT: Elementary Data Type Currency Key 20060328
4 Importing IV_CURRENCY_OUT Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_CURRENCY FDT: Elementary Data Type Currency Key 20060328
5 Importing IV_EXCHANGE_RATE_TYPE Call by reference Type reference (TYPE) STRING 20060331
6 Importing IV_TIMESTAMP Call by reference Type reference (TYPE) IF_FDT_TYPES=>TIMESTAMP 20060412
# Exception Resumable Description Created on
1 CX_FDT_CONVERSION FDT: Processing Error 20060907

Method CONVERT_FROM_CURR Signature

# Type Parameter Pass Value Optional Typing Method Associated Type Default value Description Created on
1 Importing IV_AMOUNT_CURR Call by reference Type reference (TYPE) FDT_AMOUNT_CURR Amount shifted and therefore with 2 decimals of currency 20090623
2 Importing IV_CURRENCY Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_AMOUNT-CURRENCY BRFplus Currency 20090623
3 Returning RV_AMOUNT Value transfer Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_AMOUNT-NUMBER BRFplus Decimal Number 20090623
# Exception Resumable Description Created on
1 CX_FDT_CONVERSION 20120905

Method CONVERT_INT_TO_EXT Signature

# Type Parameter Pass Value Optional Typing Method Associated Type Default value Description Created on
1 Exporting ES_AMOUNT_EXT Call by reference Type reference (TYPE) FDT_S_VALUE Value 20100128
2 Importing IS_AMOUNT_INT Call by reference Type reference (TYPE) FDT_S_VALUE Value 20100128
# Exception Resumable Description Created on
1 CX_FDT_PROCESSING FDT: Processing Error 20100929

Method CONVERT_STRING_TO_AMOUNT Signature

# Type Parameter Pass Value Optional Typing Method Associated Type Default value Description Created on
1 Importing IV_TEXT Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_TEXT Elementary Data Type Text 20130813
2 Returning RS_AMOUNT Value transfer Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_AMOUNT Elementary Data Type Amount 20130813
# Exception Resumable Description Created on
1 CX_FDT_CONVERSION FDT: Conversion Failure 20130813

Method CONVERT_TO_CURR Signature

# Type Parameter Pass Value Optional Typing Method Associated Type Default value Description Created on
1 Exporting EV_AMOUNT_CURR Call by reference Type reference (TYPE) FDT_AMOUNT_CURR Amount shifted by and therefore with 2 decimal places 20090623
2 Exporting EV_AMOUNT_INT Call by reference Type reference (TYPE) AMOUNT_INTERNAL Amount shifted by and therefore without decimal places 20090623
3 Importing IS_AMOUNT Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_AMOUNT 20090623
# Exception Resumable Description Created on
1 CX_FDT_CONVERSION 20120905

Method CURRENCY_EXIST Signature

# Type Parameter Pass Value Optional Typing Method Associated Type Default value Description Created on
1 Importing IV_CURRENCY Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_CURRENCY FDT: Elementary Data Type Currency Key 20060331
2 Returning RV_EXIST Value transfer Type reference (TYPE) ABAP_BOOL 20060407

Method CURRENCY_EXIST on class CL_FDT_AMOUNT_CONV has no exception.

Method DECODE_CURR Signature

# Type Parameter Pass Value Optional Typing Method Associated Type Default value Description Created on
1 Exporting ES_DECODED_AMOUNT Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_AMOUNT Decoded Amount number with currency as Amount 20120821
2 Exporting EV_DECODED_NUMBER Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_NUMBER Decoded Amount number as number 20120816
3 Exporting EV_DECODED_STRING Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_TEXT Decoded Amount number as string 20120816
4 Importing IV_CURR Call by reference Type reference (TYPE) P CURR Amount number encoded with TCURX logic 20120821
5 Importing IV_CURRENCY Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_CURRENCY Currency Key 20120816
# Exception Resumable Description Created on
1 CX_FDT_CONVERSION FDT: Conversion Failure 20120816

Method DECODE_CURR_STRING Signature

# Type Parameter Pass Value Optional Typing Method Associated Type Default value Description Created on
1 Exporting ES_DECODED_AMOUNT Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_AMOUNT Decoded Amount number with currency as Amount 20120821
2 Exporting EV_DECODED_NUMBER Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_NUMBER Decoded Amount number as number 20120821
3 Exporting EV_DECODED_STRING Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_TEXT Decoded Amount number as string 20120821
4 Importing IV_CURRENCY Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_CURRENCY Currency Key 20120821
5 Importing IV_CURR_STRING Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_TEXT CURR Amount number encoded with TCURX logic 20120821
# Exception Resumable Description Created on
1 CX_FDT_CONVERSION FDT: Conversion Failure 20120821

Method ENCODE_CURR Signature

# Type Parameter Pass Value Optional Typing Method Associated Type Default value Description Created on
1 Changing CH_AMOUNT_TCURX Call by reference Type reference (TYPE) P 20120821
2 Importing IS_AMOUNT Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_AMOUNT Elementary Data Type Amount 20120821
# Exception Resumable Description Created on
1 CX_FDT_CONVERSION FDT: Conversion Failure 20130926

Method GET_CURRENCY_DECIMALS Signature

# Type Parameter Pass Value Optional Typing Method Associated Type Default value Description Created on
1 Importing IV_CURRENCY Call by reference Type reference (TYPE) SYCURR Currency Key 20090715
2 Returning RV_DECIMALS Value transfer Type reference (TYPE) CURRDEC Number of decimal places 20090715

Method GET_CURRENCY_DECIMALS on class CL_FDT_AMOUNT_CONV has no exception.

Method GET_CURRENCY_LIST Signature

# Type Parameter Pass Value Optional Typing Method Associated Type Default value Description Created on
1 Importing IV_LANGU Call by reference Type reference (TYPE) SYLANGU SY-LANGU Language Key for the Current Text Environment 20061030
2 Returning RT_LIST Value transfer Type reference (TYPE) FDTT_VALUE_TEXT FDT: Value with text 20061030

Method GET_CURRENCY_LIST on class CL_FDT_AMOUNT_CONV has no exception.

Method ROUND Signature

# Type Parameter Pass Value Optional Typing Method Associated Type Default value Description Created on
1 Importing IV_AMOUNT Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_AMOUNT-NUMBER Number 20120413
2 Importing IV_CURRENCY Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_AMOUNT-CURRENCY Currency 20120413
3 Returning RV_AMOUNT Value transfer Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_AMOUNT-NUMBER Number 20120413

Method ROUND on class CL_FDT_AMOUNT_CONV has no exception.

Method SHIFT Signature

# Type Parameter Pass Value Optional Typing Method Associated Type Default value Description Created on
1 Importing IV_AMOUNT Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_AMOUNT-NUMBER 20090624
2 Importing IV_DECIMALS Call by reference Type reference (TYPE) I 20090624
3 Returning RV_SHIFTED_AMOUNT Value transfer Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_AMOUNT-NUMBER 20090624

Method SHIFT on class CL_FDT_AMOUNT_CONV has no exception.

Method SHIFT_NO_DECIMALS Signature

# Type Parameter Pass Value Optional Typing Method Associated Type Default value Description Created on
1 Exporting EV_AMOUNT_INT Call by reference Type reference (TYPE) AMOUNT_INTERNAL Amount with no decimals 20090715
2 Exporting EV_DECIMALS_CURRENCY Call by reference Type reference (TYPE) CURRDEC Decimals shifted by currency 20090715
3 Exporting EV_DECIMALS_PRECISION Call by reference Type reference (TYPE) I Decimals shifted for precision 20090715
4 Exporting EV_DECIMALS_TOTAL Call by reference Type reference (TYPE) I Total number of shifted decimals 20090715
5 Importing IS_AMOUNT Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_AMOUNT Elementary Data Type Amount 20090715
6 Importing IV_MIN_DECIMALS Call by reference Type reference (TYPE) CURRDEC 0 Min. shift for higher precision 20090715

Method SHIFT_NO_DECIMALS on class CL_FDT_AMOUNT_CONV has no exception.

Method TO_STRING Signature

# Type Parameter Pass Value Optional Typing Method Associated Type Default value Description Created on
1 Importing IS_AMOUNT Call by reference Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_AMOUNT Elementary Data Type Amount 20120814
2 Returning RV_STRING Value transfer Type reference (TYPE) IF_FDT_TYPES=>ELEMENT_TEXT Elementary Data Type Text 20120814

Method TO_STRING on class CL_FDT_AMOUNT_CONV has no exception.
History
Last changed by/on SAP  20130531 
SAP Release Created in 710