‎2007 May 02 9:26 AM
in reports there r different fields related to different currrencies like dollars,rupees etc. but how can we get total output in only one currency name like rupeees or dollars?
‎2007 May 02 9:45 AM
hi r k,
u can do this by using control brake events is the loop and endloop.
regards..
seshu.
‎2007 May 02 9:29 AM
Hi,
We need to use the currency conversion for this one ...
look at the below program how the conversion will be made
DATA: gd_fcurr TYPE tcurr-fcurr,
gd_tcurr TYPE tcurr-tcurr,
gd_date TYPE sy-datum,
gd_value TYPE i.
gd_fcurr = 'EUR'.
gd_tcurr = 'GBP'.
gd_date = sy-datum.
gd_value = 10.
PERFORM currency_conversion USING gd_fcurr
gd_tcurr
gd_date
CHANGING gd_value.
* Convert value to Currency value
*&---------------------------------------------------------------------*
*& Form currency_conversion
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_GD_FCURR text
* -->P_GD_TCURR text
* -->P_GD_DATE text
* <--P_GD_VALUE text
*----------------------------------------------------------------------*
FORM currency_conversion USING p_fcurr
p_tcurr
p_date
CHANGING p_value.
DATA: t_er TYPE tcurr-ukurs,
t_ff TYPE tcurr-ffact,
t_lf TYPE tcurr-tfact,
t_vfd TYPE datum,
ld_erate(12) TYPE c.
CALL FUNCTION 'READ_EXCHANGE_RATE'
EXPORTING
* CLIENT = SY-MANDT
date = p_date
foreign_currency = p_fcurr
local_currency = p_tcurr
TYPE_OF_RATE = 'M'
* EXACT_DATE = ' '
IMPORTING
exchange_rate = t_er
foreign_factor = t_ff
local_factor = t_lf
valid_from_date = t_vfd
* DERIVED_RATE_TYPE =
* FIXED_RATE =
* OLDEST_RATE_FROM =
EXCEPTIONS
no_rate_found = 1
no_factors_found = 2
no_spread_found = 3
derived_2_times = 4
overflow = 5
zero_rate = 6
OTHERS = 7
.
IF sy-subrc EQ 0.
ld_erate = t_er / ( t_ff / t_lf ).
p_value = p_value * ld_erate.
ENDIF.
ENDFORM. " currency_conversioncan you close the threads whcih you got answers
Regards
Sudheer
‎2007 May 02 9:34 AM
Hi RK,
If it is a report without using alvs,
You can calculate the total anounts by converting al the amounts into a single currency in a field and then summing it up.
If you r itab is like this
field1 amount currency
abc 100 USD
def 50 INR
gre 200 INR
and if you want to sum up according to a single currency say INR,
then calculate the anount in INR in an extra field.
loop at itab.
if itab-currency = 'USD'.
itab-amtinr = itab-ampunt * 45. "45 Rs = 1 USD
else.
itab-amtinr = itab-amount.
else.
modify itab index sy-tabix.
endif.
endloop.
to calculate the totals line:
loop at itab.
at last.
sum.
clear itab-amount.
clear itab-currency.
append itab.
endat.
endloop.Regards,
Ravi
‎2007 May 02 9:42 AM
Hi,
There is a field with a description called "Value in Local Currency" so wat ever be the currency format of a particular document this field would give the document value in local currency this field is normally find in finance tables "BSIS,BSAS,BSID,BSAD,BSIK,BSAK,BSEG etc. the field name is "DBMTR"
regards
suresh
‎2007 May 02 9:45 AM
hi r k,
u can do this by using control brake events is the loop and endloop.
regards..
seshu.
‎2007 May 02 10:08 AM
Hi,
Hope that all your queries have been solved. It seems that there are many of your threads that have been asnwered and you have not awarded points to all who deserve that ... please award the needful points and do close the thread.
Regards.
Jayant .