SAP CURRENCY_DOCUMENT_CONVERT Function Module for
CURRENCY_DOCUMENT_CONVERT is a standard currency document convert 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 currency document convert FM, simply by entering the name CURRENCY_DOCUMENT_CONVERT into the relevant SAP transaction such as SE37 or SE38.
Function Group: CURR_CONVERSIONS
Program Name: SAPLCURR_CONVERSIONS
Main Program:
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CURRENCY_DOCUMENT_CONVERT 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 'CURRENCY_DOCUMENT_CONVERT'".
EXPORTING
* RATE_TYPE = 'M' "Exchange Rate Type
FROM_CURRENCY = "From Currency
TO_CURRENCY = "To-Currency
* LOCAL_CURRENCY = "Local Currency
DATE = "Conversion Date
* RATE = "Exchange Rate
* CONVERSION_MODE = "Translation Mode
CHANGING
* LINE = "
TABLES
* FIELDLIST = "Table Fields
* T_LINES = "
EXCEPTIONS
FIELD_UNKNOWN = 1 FIELD_NOT_AMOUNT = 2 ERROR_IN_CONVERSION = 3 ILLEGAL_PARAMETERS = 4
IMPORTING Parameters details for CURRENCY_DOCUMENT_CONVERT
RATE_TYPE - Exchange Rate Type
Data type: TCURR-KURSTDefault: 'M'
Optional: Yes
Call by Reference: Yes
FROM_CURRENCY - From Currency
Data type: TCURR-FCURROptional: No
Call by Reference: Yes
TO_CURRENCY - To-Currency
Data type: TCURR-TCURROptional: No
Call by Reference: Yes
LOCAL_CURRENCY - Local Currency
Data type: TCURR-TCURROptional: Yes
Call by Reference: Yes
DATE - Conversion Date
Data type: SYST-DATUMOptional: No
Call by Reference: Yes
RATE - Exchange Rate
Data type: TCURR-UKURSOptional: Yes
Call by Reference: Yes
CONVERSION_MODE - Translation Mode
Data type: CONV_MODEOptional: Yes
Call by Reference: Yes
CHANGING Parameters details for CURRENCY_DOCUMENT_CONVERT
LINE -
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for CURRENCY_DOCUMENT_CONVERT
FIELDLIST - Table Fields
Data type: DDFLDNAMOptional: Yes
Call by Reference: Yes
T_LINES -
Data type:Optional: Yes
Call by Reference: Yes
EXCEPTIONS details
FIELD_UNKNOWN - Field Does Not Exist
Data type:Optional: No
Call by Reference: Yes
FIELD_NOT_AMOUNT -
Data type:Optional: No
Call by Reference: Yes
ERROR_IN_CONVERSION - Error in currency translation
Data type:Optional: No
Call by Reference: Yes
ILLEGAL_PARAMETERS -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for CURRENCY_DOCUMENT_CONVERT 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_line | TYPE STRING, " | |||
| lt_fieldlist | TYPE STANDARD TABLE OF DDFLDNAM, " | |||
| lv_rate_type | TYPE TCURR-KURST, " 'M' | |||
| lv_field_unknown | TYPE TCURR, " | |||
| lt_t_lines | TYPE STANDARD TABLE OF TCURR, " | |||
| lv_from_currency | TYPE TCURR-FCURR, " | |||
| lv_field_not_amount | TYPE TCURR, " | |||
| lv_to_currency | TYPE TCURR-TCURR, " | |||
| lv_error_in_conversion | TYPE TCURR, " | |||
| lv_local_currency | TYPE TCURR-TCURR, " | |||
| lv_illegal_parameters | TYPE TCURR, " | |||
| lv_date | TYPE SYST-DATUM, " | |||
| lv_rate | TYPE TCURR-UKURS, " | |||
| lv_conversion_mode | TYPE CONV_MODE. " |
|   CALL FUNCTION 'CURRENCY_DOCUMENT_CONVERT' " |
| EXPORTING | ||
| RATE_TYPE | = lv_rate_type | |
| FROM_CURRENCY | = lv_from_currency | |
| TO_CURRENCY | = lv_to_currency | |
| LOCAL_CURRENCY | = lv_local_currency | |
| DATE | = lv_date | |
| RATE | = lv_rate | |
| CONVERSION_MODE | = lv_conversion_mode | |
| CHANGING | ||
| LINE | = lv_line | |
| TABLES | ||
| FIELDLIST | = lt_fieldlist | |
| T_LINES | = lt_t_lines | |
| EXCEPTIONS | ||
| FIELD_UNKNOWN = 1 | ||
| FIELD_NOT_AMOUNT = 2 | ||
| ERROR_IN_CONVERSION = 3 | ||
| ILLEGAL_PARAMETERS = 4 | ||
| . " CURRENCY_DOCUMENT_CONVERT | ||
ABAP code using 7.40 inline data declarations to call FM CURRENCY_DOCUMENT_CONVERT
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 KURST FROM TCURR INTO @DATA(ld_rate_type). | ||||
| DATA(ld_rate_type) | = 'M'. | |||
| "SELECT single FCURR FROM TCURR INTO @DATA(ld_from_currency). | ||||
| "SELECT single TCURR FROM TCURR INTO @DATA(ld_to_currency). | ||||
| "SELECT single TCURR FROM TCURR INTO @DATA(ld_local_currency). | ||||
| "SELECT single DATUM FROM SYST INTO @DATA(ld_date). | ||||
| "SELECT single UKURS FROM TCURR INTO @DATA(ld_rate). | ||||
Search for further information about these or an SAP related objects