SAP CONVERT_COUNTRY_CURRENCY Function Module for









CONVERT_COUNTRY_CURRENCY is a standard convert country currency 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 convert country currency FM, simply by entering the name CONVERT_COUNTRY_CURRENCY into the relevant SAP transaction such as SE37 or SE38.

Function Group: FI_TRV_WAERS_CONVERT
Program Name: SAPLFI_TRV_WAERS_CONVERT
Main Program:
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function CONVERT_COUNTRY_CURRENCY 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 'CONVERT_COUNTRY_CURRENCY'"
EXPORTING
BELEGNUMMER = "
STATUS = "
SPESENKUERZEL = "
BELEGDATUM = "
BELEGBETRAG = "
WAERS_RECIEPT = "
* WAERS_TRAVEL = 'EUR' "
WAERS_COUNTRY = "
RATE = "
* TYPE_OF_RATE = 'M' "

IMPORTING
KURS_OUT = "

EXCEPTIONS
FIXED = 1 NO_KURS_FOUND = 2 OVERFLOW = 3 NOT_FIXED = 4
.



IMPORTING Parameters details for CONVERT_COUNTRY_CURRENCY

BELEGNUMMER -

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

STATUS -

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

SPESENKUERZEL -

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

BELEGDATUM -

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

BELEGBETRAG -

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

WAERS_RECIEPT -

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

WAERS_TRAVEL -

Data type: PTK03-WAERS
Default: 'EUR'
Optional: Yes
Call by Reference: No ( called with pass by value option)

WAERS_COUNTRY -

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

RATE -

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

TYPE_OF_RATE -

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

EXPORTING Parameters details for CONVERT_COUNTRY_CURRENCY

KURS_OUT -

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

EXCEPTIONS details

FIXED -

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

NO_KURS_FOUND -

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

OVERFLOW -

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

NOT_FIXED -

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

Copy and paste ABAP code example for CONVERT_COUNTRY_CURRENCY 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_fixed  TYPE STRING, "   
lv_kurs_out  TYPE PTK03-KURSB, "   
lv_belegnummer  TYPE PTK03-BELNR, "   
lv_status  TYPE SY-PFKEY, "   
lv_no_kurs_found  TYPE SY, "   
lv_spesenkuerzel  TYPE PTK03-SPKZL, "   
lv_overflow  TYPE PTK03, "   
lv_belegdatum  TYPE PTK03-BLDAT, "   
lv_not_fixed  TYPE PTK03, "   
lv_belegbetrag  TYPE PTK03-BETRG, "   
lv_waers_reciept  TYPE PTK03-WAERS, "   
lv_waers_travel  TYPE PTK03-WAERS, "   'EUR'
lv_waers_country  TYPE PTK03-WAERS, "   
lv_rate  TYPE PTK03-KURSB, "   
lv_type_of_rate  TYPE T706D-KURST. "   'M'

  CALL FUNCTION 'CONVERT_COUNTRY_CURRENCY'  "
    EXPORTING
         BELEGNUMMER = lv_belegnummer
         STATUS = lv_status
         SPESENKUERZEL = lv_spesenkuerzel
         BELEGDATUM = lv_belegdatum
         BELEGBETRAG = lv_belegbetrag
         WAERS_RECIEPT = lv_waers_reciept
         WAERS_TRAVEL = lv_waers_travel
         WAERS_COUNTRY = lv_waers_country
         RATE = lv_rate
         TYPE_OF_RATE = lv_type_of_rate
    IMPORTING
         KURS_OUT = lv_kurs_out
    EXCEPTIONS
        FIXED = 1
        NO_KURS_FOUND = 2
        OVERFLOW = 3
        NOT_FIXED = 4
. " CONVERT_COUNTRY_CURRENCY




ABAP code using 7.40 inline data declarations to call FM CONVERT_COUNTRY_CURRENCY

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 KURSB FROM PTK03 INTO @DATA(ld_kurs_out).
 
"SELECT single BELNR FROM PTK03 INTO @DATA(ld_belegnummer).
 
"SELECT single PFKEY FROM SY INTO @DATA(ld_status).
 
 
"SELECT single SPKZL FROM PTK03 INTO @DATA(ld_spesenkuerzel).
 
 
"SELECT single BLDAT FROM PTK03 INTO @DATA(ld_belegdatum).
 
 
"SELECT single BETRG FROM PTK03 INTO @DATA(ld_belegbetrag).
 
"SELECT single WAERS FROM PTK03 INTO @DATA(ld_waers_reciept).
 
"SELECT single WAERS FROM PTK03 INTO @DATA(ld_waers_travel).
DATA(ld_waers_travel) = 'EUR'.
 
"SELECT single WAERS FROM PTK03 INTO @DATA(ld_waers_country).
 
"SELECT single KURSB FROM PTK03 INTO @DATA(ld_rate).
 
"SELECT single KURST FROM T706D INTO @DATA(ld_type_of_rate).
DATA(ld_type_of_rate) = 'M'.
 


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!