on 03-11-2010 6:56 PM
Hi,
I am trying to calculate the total invoice amount for different currencies in a SAPScript. I am running into a couple of problems.
1: I cannot seem to find the exchange rate ( KURRF ) in KOMK/VBDKA or VBDKR, do you know where else the exhange rate would be populated?
2: I cannot seem to use the commands: /: DEFINE &my_variable&
/: &my_variable& = &KOMK-FKWRT& * &KOMK-KURRF& (pretend KURRF is populated)
is it even possible to do that sort of calculations in SAPScripts? if not, what is an easy way to accompolish this?
I only need to calculate this once.
thank you.
Hi Yurika,
if u want to calculate exchange rate which is maintained in tcode-OB08,
all the data will be stored in Table-TCURR.
since ur saying that u do not want to change the driver program,
then go for Subroutine
perform all ur calculations in the subroutine and then pass them to form.
In script, you have this logic:
PERFORM <formname> program <progname>
using
changing
endperform
for example
/: PERFORM F_CALCULA IN PROGRAM ZCALCULATE
/: USING &KOMK-FKWRT&
/: USING &TCURR-KURSF&
/: CHANGING &CURR&
/: ENDPERFORM
Hope its helpul to you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
u can use FM to get the value in print program..and pass them to the sap script...
The conversion rate is stored in TCURR table...
CALL FUNCTION 'CONVERT_TO_FOREIGN_CURRENCY'
EXPORTING
date = <fs_komv>-kdatu "<<date of convertion
foreign_currency = komk-waerk
local_amount = wa_komp_o-netwr "<<value to convert
local_currency = <fs_komv>-waers
IMPORTING
foreign_amount = <fs_komv>-kwert "<<Converted value
EXCEPTIONS
no_rate_found = 1
overflow = 2
no_factors_found = 3
no_spread_found = 4
derived_2_times = 5
OTHERS = 6.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.