SAP /BA1/F4_API_FX_INSERT Function Module for Insert Exchange Rates
/BA1/F4_API_FX_INSERT is a standard /ba1/f4 api fx insert SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Insert Exchange Rates processing and below is the pattern details for this FM, 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 /ba1/f4 api fx insert FM, simply by entering the name /BA1/F4_API_FX_INSERT into the relevant SAP transaction such as SE37 or SE38.
Function Group: /BA1/F4_API_FXRATES
Program Name: /BA1/SAPLF4_API_FXRATES
Main Program: /BA1/SAPLF4_API_FXRATES
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function /BA1/F4_API_FX_INSERT 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 '/BA1/F4_API_FX_INSERT'"Insert Exchange Rates.
EXPORTING
I_MDCODE = "Market Data Area
I_FX_RATE = "Exchange Rate
* I_TEST_RUN = CON_OFF "Import Data as a Test Run
* I_CORR_SERV_ACT = CON_CORR_SERV_OFF "Correction Activity for Automatic Corrections
* I_CUST_SETTING = "Structure for Overriding Customizing Settings in Mass Correction
I_RATETYPE = "Exchange Rate Category
I_FROM_FACTOR = "Ratio for the 'From' Currency Units
I_FROM_CCY = "Currency Key
I_TO_FACTOR = "Ratio for the 'To' Currency Units
I_TO_CCY = "Currency Key
I_CONV_TYPE = "Conversion Category
I_NOTATION = "Foreign Exchange Rate Quotation
I_VALID_DATE = "Date
EXCEPTIONS
FUNCTION_FAILED = 1 NO_AUTHORIZATION = 2 ENQUEUE_FAILED = 3 OBJECT_ALREADY_EXISTS = 4 PARAMETER_ERROR = 5
IMPORTING Parameters details for /BA1/F4_API_FX_INSERT
I_MDCODE - Market Data Area
Data type: /BA1/F4_DTE_MDCODEOptional: No
Call by Reference: Yes
I_FX_RATE - Exchange Rate
Data type: /BA1/F4_DTE_FX_RATE_DECOptional: No
Call by Reference: Yes
I_TEST_RUN - Import Data as a Test Run
Data type: /BA1/F4_DTE_TEST_RUNDefault: CON_OFF
Optional: Yes
Call by Reference: Yes
I_CORR_SERV_ACT - Correction Activity for Automatic Corrections
Data type: /BA1/F4_DTE_CORR_SERV_ACTDefault: CON_CORR_SERV_OFF
Optional: Yes
Call by Reference: Yes
I_CUST_SETTING - Structure for Overriding Customizing Settings in Mass Correction
Data type: /BA1/F4_STR_CUST_SETTINGOptional: Yes
Call by Reference: Yes
I_RATETYPE - Exchange Rate Category
Data type: /BA1/F4_DTE_FX_RATE_TYPEOptional: No
Call by Reference: Yes
I_FROM_FACTOR - Ratio for the 'From' Currency Units
Data type: /BA1/F4_DTE_FX_FFACTOptional: No
Call by Reference: Yes
I_FROM_CCY - Currency Key
Data type: WAERSOptional: No
Call by Reference: Yes
I_TO_FACTOR - Ratio for the 'To' Currency Units
Data type: /BA1/F4_DTE_FX_TFACTOptional: No
Call by Reference: Yes
I_TO_CCY - Currency Key
Data type: WAERSOptional: No
Call by Reference: Yes
I_CONV_TYPE - Conversion Category
Data type: /BA1/F4_DTE_FX_CONV_TYPE2Optional: No
Call by Reference: Yes
I_NOTATION - Foreign Exchange Rate Quotation
Data type: /BA1/F4_DTE_FX_NOTATIONOptional: No
Call by Reference: Yes
I_VALID_DATE - Date
Data type: DATUMOptional: No
Call by Reference: Yes
EXCEPTIONS details
FUNCTION_FAILED - Internal Error
Data type:Optional: No
Call by Reference: Yes
NO_AUTHORIZATION - Missing authorization
Data type:Optional: No
Call by Reference: Yes
ENQUEUE_FAILED - Lock not possible
Data type:Optional: No
Call by Reference: Yes
OBJECT_ALREADY_EXISTS - Object already exists
Data type:Optional: No
Call by Reference: Yes
PARAMETER_ERROR - Parameter has been transferred incorrectly
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for /BA1/F4_API_FX_INSERT 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_mdcode | TYPE /BA1/F4_DTE_MDCODE, " | |||
| lv_function_failed | TYPE /BA1/F4_DTE_MDCODE, " | |||
| lv_i_fx_rate | TYPE /BA1/F4_DTE_FX_RATE_DEC, " | |||
| lv_i_test_run | TYPE /BA1/F4_DTE_TEST_RUN, " CON_OFF | |||
| lv_i_corr_serv_act | TYPE /BA1/F4_DTE_CORR_SERV_ACT, " CON_CORR_SERV_OFF | |||
| lv_i_cust_setting | TYPE /BA1/F4_STR_CUST_SETTING, " | |||
| lv_i_ratetype | TYPE /BA1/F4_DTE_FX_RATE_TYPE, " | |||
| lv_no_authorization | TYPE /BA1/F4_DTE_FX_RATE_TYPE, " | |||
| lv_i_from_factor | TYPE /BA1/F4_DTE_FX_FFACT, " | |||
| lv_enqueue_failed | TYPE /BA1/F4_DTE_FX_FFACT, " | |||
| lv_i_from_ccy | TYPE WAERS, " | |||
| lv_object_already_exists | TYPE WAERS, " | |||
| lv_i_to_factor | TYPE /BA1/F4_DTE_FX_TFACT, " | |||
| lv_parameter_error | TYPE /BA1/F4_DTE_FX_TFACT, " | |||
| lv_i_to_ccy | TYPE WAERS, " | |||
| lv_i_conv_type | TYPE /BA1/F4_DTE_FX_CONV_TYPE2, " | |||
| lv_i_notation | TYPE /BA1/F4_DTE_FX_NOTATION, " | |||
| lv_i_valid_date | TYPE DATUM. " |
|   CALL FUNCTION '/BA1/F4_API_FX_INSERT' "Insert Exchange Rates |
| EXPORTING | ||
| I_MDCODE | = lv_i_mdcode | |
| I_FX_RATE | = lv_i_fx_rate | |
| I_TEST_RUN | = lv_i_test_run | |
| I_CORR_SERV_ACT | = lv_i_corr_serv_act | |
| I_CUST_SETTING | = lv_i_cust_setting | |
| I_RATETYPE | = lv_i_ratetype | |
| I_FROM_FACTOR | = lv_i_from_factor | |
| I_FROM_CCY | = lv_i_from_ccy | |
| I_TO_FACTOR | = lv_i_to_factor | |
| I_TO_CCY | = lv_i_to_ccy | |
| I_CONV_TYPE | = lv_i_conv_type | |
| I_NOTATION | = lv_i_notation | |
| I_VALID_DATE | = lv_i_valid_date | |
| EXCEPTIONS | ||
| FUNCTION_FAILED = 1 | ||
| NO_AUTHORIZATION = 2 | ||
| ENQUEUE_FAILED = 3 | ||
| OBJECT_ALREADY_EXISTS = 4 | ||
| PARAMETER_ERROR = 5 | ||
| . " /BA1/F4_API_FX_INSERT | ||
ABAP code using 7.40 inline data declarations to call FM /BA1/F4_API_FX_INSERT
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.| DATA(ld_i_test_run) | = CON_OFF. | |||
| DATA(ld_i_corr_serv_act) | = CON_CORR_SERV_OFF. | |||
Search for further information about these or an SAP related objects