Hi All,
I have gone through the various postings and also the document in "Know HOW NETWORK" in SAP service place about how to use the function module RSW_CURRENCY_TRANSLATION. I am still unable to accompalish wht I need using this information.
The requirement is:
Given Local Currency Amt, Local Currency Key, Group Currency Key calculate Group Currency Amt in the Update rules.
This is the code I have in my update rules
******************************************
DATA: s_amount type f,
t_amount type f.
data f_tcur(3) type c value 'USD'.
move COMM_STRUCTURE-CS_TRN_LC to s_amount.
CALL FUNCTION 'RSW_CURRENCY_TRANSLATION'
EXPORTING
I_CTTNM = 'ZBPCCT1'
I_AMOUNT = s_amount
I_SCUR = COMM_STRUCTURE-curkey_lc
I_TCUR = COMM_STRUCTURE-curkey_gc
I_TIME_IOBJVL = '0fiscper'
I_SCUR_IOBJVL =
I_TCUR_IOBJVL =
I_PERIV = 'K4'
I_RATE = 2
IMPORTING
E_AMOUNT = t_amount
E_RATE =
E_SCUR =
E_TCUR = UNIT
EXCEPTIONS
SCUR_NOT_FOUND = 1
TCUR_NOT_FOUND = 2
DATE_NOT_FOUND = 3
CTT_NOT_FOUND = 4
SCUR_CONFLICT = 5
TCUR_CONFLICT = 6
DATE_CONFLICT = 7
INVALID_SCUR = 8
INVALID_TCUR = 9
RATE_NOT_FOUND = 10
X_MESSAGE = 11
INHERITED_ERROR = 12
OTHERS = 13
.
move t_amount to RESULT.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
result value of the routine
RESULT = .
RETURNCODE = 0.
if abort is not equal zero, the update process will be canceled
ABORT = 0.
*****************************************
When I load data into the ODS, I get an ABAP dump saying "RATE_NOT_FOUND". I do not want to give the rate explicitly, since the local currency types are many and I want the currency conversion key to take care of this.
Any help is appreciated a lot!
THank you