SAP COPA_CURRENCY_CONVERSION Function Module for









COPA_CURRENCY_CONVERSION is a standard copa currency conversion SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for copa currency conversion FM, simply by entering the name COPA_CURRENCY_CONVERSION into the relevant SAP transaction such as SE37 or SE38.

Function Group: KECU
Program Name: SAPLKECU
Main Program:
Appliation area: K
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function COPA_CURRENCY_CONVERSION pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'COPA_CURRENCY_CONVERSION'"
EXPORTING
I_ERKRS = "
I_DATE = "
* I_FOREIGN_AMOUNT = "
I_FOREIGN_CURRENCY = "
* I_LOCAL_AMOUNT = "
I_LOCAL_CURRENCY = "
* I_RATE = 0 "
* I_TYPE_OF_RATE = 'M' "
* I_CONVERT_TO = 'L' "

IMPORTING
E_EXCHANGE_RATE = "
E_FOREIGN_AMOUNT = "
E_FOREIGN_FACTOR = "
E_LOCAL_AMOUNT = "
E_LOCAL_FACTOR = "
E_EXCHANGE_RATEX = "

EXCEPTIONS
CONVERSION_ERROR = 1
.




Customer Function user exits

Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.
EXIT_SAPLKECU_001 User Exit for Determining the Exchange Rate Type

IMPORTING Parameters details for COPA_CURRENCY_CONVERSION

I_ERKRS -

Data type: TKEBB-ERKRS
Optional: No
Call by Reference: No ( called with pass by value option)

I_DATE -

Data type: SY-DATUM
Optional: No
Call by Reference: No ( called with pass by value option)

I_FOREIGN_AMOUNT -

Data type:
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_FOREIGN_CURRENCY -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

I_LOCAL_AMOUNT -

Data type:
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_LOCAL_CURRENCY -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

I_RATE -

Data type:
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_TYPE_OF_RATE -

Data type:
Default: 'M'
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_CONVERT_TO -

Data type:
Default: 'L'
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for COPA_CURRENCY_CONVERSION

E_EXCHANGE_RATE -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

E_FOREIGN_AMOUNT -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

E_FOREIGN_FACTOR -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

E_LOCAL_AMOUNT -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

E_LOCAL_FACTOR -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

E_EXCHANGE_RATEX -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

CONVERSION_ERROR -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for COPA_CURRENCY_CONVERSION Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lv_i_erkrs  TYPE TKEBB-ERKRS, "   
lv_e_exchange_rate  TYPE TKEBB, "   
lv_conversion_error  TYPE TKEBB, "   
lv_i_date  TYPE SY-DATUM, "   
lv_e_foreign_amount  TYPE SY, "   
lv_e_foreign_factor  TYPE SY, "   
lv_i_foreign_amount  TYPE SY, "   
lv_e_local_amount  TYPE SY, "   
lv_i_foreign_currency  TYPE SY, "   
lv_e_local_factor  TYPE SY, "   
lv_i_local_amount  TYPE SY, "   
lv_e_exchange_ratex  TYPE SY, "   
lv_i_local_currency  TYPE SY, "   
lv_i_rate  TYPE SY, "   0
lv_i_type_of_rate  TYPE SY, "   'M'
lv_i_convert_to  TYPE SY. "   'L'

  CALL FUNCTION 'COPA_CURRENCY_CONVERSION'  "
    EXPORTING
         I_ERKRS = lv_i_erkrs
         I_DATE = lv_i_date
         I_FOREIGN_AMOUNT = lv_i_foreign_amount
         I_FOREIGN_CURRENCY = lv_i_foreign_currency
         I_LOCAL_AMOUNT = lv_i_local_amount
         I_LOCAL_CURRENCY = lv_i_local_currency
         I_RATE = lv_i_rate
         I_TYPE_OF_RATE = lv_i_type_of_rate
         I_CONVERT_TO = lv_i_convert_to
    IMPORTING
         E_EXCHANGE_RATE = lv_e_exchange_rate
         E_FOREIGN_AMOUNT = lv_e_foreign_amount
         E_FOREIGN_FACTOR = lv_e_foreign_factor
         E_LOCAL_AMOUNT = lv_e_local_amount
         E_LOCAL_FACTOR = lv_e_local_factor
         E_EXCHANGE_RATEX = lv_e_exchange_ratex
    EXCEPTIONS
        CONVERSION_ERROR = 1
. " COPA_CURRENCY_CONVERSION




ABAP code using 7.40 inline data declarations to call FM COPA_CURRENCY_CONVERSION

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

"SELECT single ERKRS FROM TKEBB INTO @DATA(ld_i_erkrs).
 
 
 
"SELECT single DATUM FROM SY INTO @DATA(ld_i_date).
 
 
 
 
 
 
 
 
 
 
 
DATA(ld_i_type_of_rate) = 'M'.
 
DATA(ld_i_convert_to) = 'L'.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!