Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

how can I find the currency field of table KOMU

peter_peng
Product and Topic Expert
Product and Topic Expert
0 Kudos
386

I need to select data from table KOMU, including field wrbtr. in 'Currency/Quantity Fields' tab, it's defined to use bkpf-waers.

but how can i find the corresponding record in bkpf? could anyone tell me the relation between these two table?

or is there another way to get the currency field?

thank you!

10 REPLIES 10

Former Member
0 Kudos
337

Hi Peter,

There is no need to go to BKPF table. You canjust select this field.

Regards,

Atish

peter_peng
Product and Topic Expert
Product and Topic Expert
0 Kudos
337

Hi Atish,

thanks for your reply.

I need to output wrbtr in screen, so I think I must use 'write ..... currency....', if I didn't specify the currency, I think maybe the output is not correct.

0 Kudos
337

Hi Peter,

No, you will not be getting any error. You can just simply get the value of WRBTR and display it in the output.

You need not do anything else.

Regards

Gopi

peter_peng
Product and Topic Expert
Product and Topic Expert
0 Kudos
337

Hi Gopi,

you mean I just 'write wrbtr', no currency key specified, right?

if so, could you tell me why?

peter_peng
Product and Topic Expert
Product and Topic Expert
0 Kudos
337

for example, if the currency is JPY, i think the result should be wrbtr * 100

0 Kudos
337

Peter, does this mean that you need to convert the JPY Amount to your local currency Amount.

Then in that case you have to use the FM : CONVERT

CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
     EXPORTING
          date             = syst-datum
          foreign_amount   = for_amount
          foreign_currency = 'JPY' " Japanese Yen
          local_currency   = 'SGD' " Sing Dollar
     IMPORTING
          local_amount     = loc_ammount
     EXCEPTIONS
          no_rate_found    = 1
          overflow         = 2
          no_factors_found = 3
          no_spread_found  = 4
          derived_2_times  = 5.

Regards

Gopi

peter_peng
Product and Topic Expert
Product and Topic Expert
0 Kudos
337

Gopi, but I didn't know what's currency. i.e. the currency may be any currency, so I cann't do as your way.

I'd like to find the related currency key so that I can display amout correctly.

former_member223537
Active Contributor
0 Kudos
337

Hi,

In that case, please retrieve the currency & store it in variable. Pass the variables to the Function Module.


CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
     EXPORTING
          date             = syst-datum
          foreign_amount   = for_amount
          foreign_currency = L_cur1
          local_currency   =  l_cur2
     IMPORTING
          local_amount     = loc_ammount
     EXCEPTIONS
          no_rate_found    = 1
          overflow         = 2
          no_factors_found = 3
          no_spread_found  = 4
          derived_2_times  = 5.
[Code]




Best regards,
Prashant

[code]

0 Kudos
337

Yes, but me question is how to get the related currency key...

0 Kudos
337

Hi,

I believe you don't need currency addition in this case.

Check below links for details

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba1ef35c111d1829f0000e829fbfe/content.htm

Regards,

Atish