Skip to main content

Celonis Product Documentation

CURRENCY_SAP
Description

This operator converts the currency value as stored by SAP to the actual value based on the internal TCURX table.

SAP stores every NETWR value as a result of the following formula: stored_value = actual_value / TDEC

Here, TDEC is computed as follows: TDEC = POW(10, 2 - TCURX.CURRDEC)

This operator therefore uses the inverse of the first formula to obtain the actual value from the stored value. The TCURX table should be present in the datamodel.

If the TCURX table does not contain the requested currency, TDEC=1 is assumed, which means that it is not required to do any conversion of the input amount. Therefore, the unchanged input amount is returned is that case.

Syntax
  CURRENCY_SAP ( amount_column, document_currency_type_column [, source_system_column ] )
 
  • amount_column: The column containing the amounts as stored in the SAP format. Must be of type FLOAT.

  • document_currency_type_column: The column containing the document currency types. A corresponding entry should be present in the TCURX table for each document currency type. Must be of type STRING.

  • source_system_column: Optional column specifying the source system that is to be used in the conversion. Must be of type STRING. The name of this column and the source system column in TCURX must be the same.

Examples

[1]

An example of converting the SAP representation of NETWR values to their actual value.

Query

Column1

         CURRENCY_SAP ( "INPUT"."NETWR" , "INPUT"."WAERK" )
        

Input

Output

INPUT

WAERK : string

NETWR : float

'USD'

100.0

'NPR'

100.0

'JPY'

100.0

TCURX

CURRKEY : string

CURRDEC : int

'USD'

1

'NPR'

2

'JPY'

0

Result

Column1 : float

1000.0

100.0

10000.0

[2]

An example showing the use of CURRENCY_SAP in combination with CURRENCY_CONVERT_SAP for the SAP P2P process. The output columns show the SAP representation of the NETWR value, the actual value, and the value after conversion to EUR respectively.

Query

Column1

         "EKPO"."NETWR"
        

Column2

         CURRENCY_SAP ( "EKPO"."NETWR" , "EKKO"."WAERS" )
        

Column3

         CURRENCY_CONVERT_SAP ( 'EUR' , 'M' , "EKKO"."MANDT" , "EKKO"."WAERS" , "EKKO"."AEDAT" , "EKPO"."NETWR" )
        

Input

Output

EKKO

MANDT : string

EBELN : string

WAERS : string

AEDAT : date

'800'

'001'

'USD'

Fri Feb 02 2001 00:00:00.000

'800'

'002'

'USD'

Mon Feb 22 2010 00:00:00.000

'800'

'003'

'NPR'

Mon Feb 22 2010 00:00:00.000

'800'

'004'

'EUR'

Mon Feb 22 2010 00:00:00.000

EKPO

MANDT : string

EBELN : string

EBELP : int

NETWR : float

'800'

'001'

1

100.0

'800'

'001'

2

200.0

'800'

'001'

3

300.0

'800'

'002'

1

400.0

'800'

'003'

1

500.0

'800'

'004'

1

600.0

TCURF

MANDT : string

KURST : string

FCURR : string

TCURR : string

TFACT : float

FFACT : float

GDATU : string

'800'

'M'

'USD'

'EUR'

1.0

1.0

'79899898'

'800'

null

'USD'

'EUR'

1.0

1.0

'79899878'

'800'

'M'

'NPR'

'EUR'

1.0

1.0

'79899878'

TCURR

MANDT : string

KURST : string

FCURR : string

TCURR : string

GDATU : string

UKURS : float

TFACT : float

FFACT : float

'800'

'M'

'USD'

'EUR'

'79899898'

1.0

1.0

1.0

'800'

'M'

'USD'

'EUR'

'79899878'

2.0

1.0

1.0

'800'

'M'

'NPR'

'EUR'

'79899878'

-10.0

1.0

1.0

TCURX

CURRKEY : string

CURRDEC : int

'USD'

3

'NPR'

2

'EUR'

1

Foreign Keys

EKPO.MANDT

EKKO.MANDT

EKPO.EBELN

EKKO.EBELN

Result

Column1 : float

Column2 : float

Column3 : float

100.0

10.0

null

200.0

20.0

null

300.0

30.0

null

400.0

40.0

80.0

500.0

500.0

50.0

600.0

6000.0

6000.0

See also: