cancel
Showing results for 
Search instead for 
Did you mean: 

Currency Conversion

former_member185071
Contributor
0 Kudos
78

Hi Xpertz

Can any one help me out in this senarion.

I have key fig with the name "ZKF1" which comes with document currency.

Now what i want is i need one more Key figure " ZKF2" which consists of ZKF1

value with compny currency. By the way i dont have a standard currency even in

my target currency as well as source currency.

I would like to implement this in my Update rules.

I searched in our forum. They are little confused.

As am panic with ABAP code.

Could any one explain me. The way.

I am creating a one more key figure and i am placing the code in my start routine...

Any suggestions will appreciate..

Thanks in advance..

Regards

R M K

**NO need to say good answers will get pointz**

.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can use the function 'CONVERT_TO_LOCAL_CURRENCY' or 'CONVERT_TO_FOREIGN_CURRENCY'

<b>WARNING, this part of code was for our development, you need to change it.

But the idea is here.</b>

  • Inot start routine

CONSTANTS: k_group_currency TYPE waers VALUE 'EUR'.

DATA: tmp_amount TYPE /bi0/oinetprice.

CONSTANTS:

k_currency_grp TYPE /bi0/oicurrency VALUE 'EUR',

k_curtype_loc TYPE /bi0/oicurtype VALUE '10',

k_curtype_grp TYPE /bi0/oicurtype VALUE '30'.

...

FORM conv_local_curr_to_group_curr

TABLES monitor STRUCTURE rsmonitor "user defined monitoring

USING i_trans_date

i_local_amount

i_local_currency

i_group_currency

CHANGING c_group_amount

c_abort LIKE sy-subrc.

DATA: l_date TYPE datum.

  • Translation date

  • Currency translation : from foreign to local curr

  • -> local curr considered as the "foreign" curr

  • -> group curr considered as the "local" curr )

CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'

EXPORTING

  • CLIENT = SY-MANDT

date = i_trans_date

foreign_amount = i_local_amount

foreign_currency = i_local_currency

local_currency = i_group_currency

  • RATE = 0

  • TYPE_OF_RATE = 'M'

  • READ_TCURR = 'X'

IMPORTING

  • EXCHANGE_RATE =

  • FOREIGN_FACTOR =

local_amount = c_group_amount

  • LOCAL_FACTOR =

  • EXCHANGE_RATEX =

  • FIXED_RATE =

  • DERIVED_RATE_TYPE =

EXCEPTIONS

no_rate_found = 1

overflow = 2

no_factors_found = 3

no_spread_found = 4

derived_2_times = 5

OTHERS = 6.

IF sy-subrc <> 0.

  • if abort is not equal zero, the update process will be canceled

c_abort = sy-subrc.

CLEAR monitor.

monitor-msgid = sy-msgid.

monitor-msgty = sy-msgty.

monitor-msgno = sy-msgno.

monitor-msgv1 = sy-msgv1.

monitor-msgv2 = sy-msgv2.

monitor-msgv3 = sy-msgv3.

monitor-msgv4 = sy-msgv4.

APPEND monitor.

ENDIF.

ENDFORM. "conv_local_curr_to_group_curr

  • Into the routine

PERFORM conv_local_curr_to_group_curr

TABLES MONITOR

USING COMM_STRUCTURE-doc_date

COMM_STRUCTURE-netprice

COMM_STRUCTURE-loc_currcy

k_currency_grp

CHANGING tmp_amount

ABORT.

RESULT = tmp_amount.

UNIT = k_group_currency.

Hope this help you.

( this is my firt reply so...)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

You can create a calculated kf in the BEx directly and in the that propery menu you can control currency conversion......

Regards

N Ganesh

former_member185071
Contributor
0 Kudos

Hi Ganesh

Thanks for your Info.

How ever i need to write in Update rules level..

If you any sample code plz suggest me..

Regards

R M K

**No need to say good answers will get pointz**