on 2018 Feb 28 8:31 AM
Hi Team,
We need to make entry of exchange rates into TCURR table using a program.
I have created one, where I want to insert a single record in TCURR using BAPI : BAPI_EXCHANGERATE_CREATE. But Somehow, the update into TCURR table is not happening. Below is the code that I wrote:
DATA: lt_exrate TYPE TABLE OF BAPI1093_0,
RETURN LIKE BAPIRET2,
COMMIT_RETURN LIKE BAPIRET2,
ls_exrate like bapi1093_0.
ls_exrate-rate_type = '1001'.
ls_exrate-from_curr = 'AED'.
ls_exrate-to_currncy = 'SAR'.
ls_exrate-valid_from = '20160101'.
ls_exrate-exch_rate = '1.1'.
ls_exrate-from_factor = 1.
ls_exrate-to_factor = 1.
ls_exrate-exch_rate_v = '0.9090'.
APPEND ls_exrate to lt_exrate.
CLEAR ls_exrate.
LOOP AT lt_exrate INTO ls_exrate.
call function 'BAPI_EXCHANGERATE_CREATE'
exporting
exch_rate = ls_exrate
UPD_ALLOW = 'X'
CHG_FIXED = 'X'
* DEV_ALLOW = '000'
IMPORTING
RETURN = RETURN
* RATE_TYPE =
* FROM_CURR =
* TO_CURRNCY = .
.
IF RETURN-TYPE <> 'E' OR RETURN-TYPE <> 'A'.
call function 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = COMMIT_RETURN .
ENDIF.
ENDLOOP.
Where am I going wrong here. Please suggest.
Regards,
SHUBHAM
Request clarification before answering.
Found a simple reason. Because ratios between the currencies were not maintained in TCURF table, BAPI was not updating in TCURR table.
And now no more use of custom program as transaction code TBDM helps to upload the Exchange rates.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 8 | |
| 7 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.