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 does Reference Field work?

former_member647955
Participant
0 Kudos

Hi All,

I have short of problem knowing how reference field works. I have one field in ABAP query: MBEW-STPRS. The field type is CURR and it have reference field T001-WAERS.

In query I made, the currency isn't occurs although I have set it to be display. I try to look how this reference field works in any source but can't find any answer. May be some of you can give me a little explanation.

Thank you so much

Regards

Hadi

1 ACCEPTED SOLUTION

shaik_sajid
Active Contributor
0 Kudos

hi

the reference key says how many decimal places or how to take the amount.

You can find difference for inr & JPY currency keys.

Regards

Sajid

8 REPLIES 8

shaik_sajid
Active Contributor
0 Kudos

hi

the reference key says how many decimal places or how to take the amount.

You can find difference for inr & JPY currency keys.

Regards

Sajid

Former Member
0 Kudos

Hi,

When u enter the AMOUNT, the CURRENCY must be given. For example, if u give 1000 for amount, but it should know whether it refers to Rupees or Doller or Pound. So for CURR, the CUKY(Currecy Key) must be given.

Similary, when you enter a QUANTITY, say 1000, we should specify the UNIT for this. Whether it refers to METRE, or CENTIMETRE or any other unit. So, for QUAN, we should specify the UNIT in the Currency/Quantity field.

Hope this is helpful and makes you understand..

Regards,

Vimal.

0 Kudos

Thank you all for your answer,

But I still a little bit confuse about how it get the CURRENCY for the AMOUNT and get UNIT for the QUANTITY.

Back to the case I have, I have field MBEW-STPRS (amount) that refer to field T001-WAERS. There are so much record in MBEW and so much record in T001 too. How can for one amount in MBEW-STPRS, it can refer for one currency in T001-WAERS. How can they been matched?

@ Vimal

Thanks for your answer, you said that before:

'For example, if u give 1000 for amount, but it should know whether it refers to Rupees or Doller or Pound.'

Can you little bit explain how it know if the currency should refer to Rupees or Dollar or Pound

Thank you so much for your help and answer.

Regards

Hadi

0 Kudos

Hai,

Have a look at the contents of the table TCURC. Its the table which stores all the Currency Codes(from all countries). As i have said earlier, they have their own representation. Everything is pre-programmed so that according to the value we enter say EUR or INR etc, the appropriate representation is made. Every currency field(CURR) requires currency key(CUKY) to be assigned without which the System cannot understand to which currency it should convert.

How can for one amount in MBEW-STPRS, it can refer for one currency in T001-WAERS. How can they been matched?

In the MBEW table, click on the Currency/Quantitiy fields tab. There you can see that WAERS is supplied as the Referenz field for the currency field STPRS.

Same applies to Unit too.

Best Regards,

rama

Edited by: newtoAbap on Jul 22, 2009 1:37 PM

Former Member
0 Kudos

Hai,

A small Example, say we have an amout of Rs.100. This amount when stated in INR is displayed as 100.00 okay (assume 2 decimals). The same 100 when represented in EUROS will be displayed as 100,00 (100 Euros). So each currency key has its own representation.

Hope you got the point:)

Best Regards,

rama

Former Member
0 Kudos

Hi,

Reference fields work in the following way,

When you say quantity is 100, what it refers to - 100 pc, 100 bundles or 100 kg or 100 metres??? The unit of qty defines whether it is PC, KG, M etc...

In the database, SAP stores all amount values with 2 decimal places. But when SAP reads it, it interprets it based on the currency associated with the amount field.

We require reference fields to Currency/Quantity fields as they are meaningless with out having the units.

Ex: If we say, i paid 100. How can we figure out if he had paid 100 paise or 100 rupees.

So, units are must.

In case of quantity field QUAN, reference field will be always of type UNIT,

currency field CURR, reference field will be always of type CUKY.

It is mandatory to specify reference fields when we create fields of quantity/currency type in data base tables.

Hope this will clear you.

Thanks & Regards,

Pavan.

former_member647955
Participant
0 Kudos

Thank you All,

I think there is a key which relate table MBEW and T001. That's why for each amount in MBEW-STPRS, there should relate to T001-WAERS. For this case because both table have no key that connect them, in report the currency doesn't appears.

I found another example which MARD-LABST have reference field to MARA-MEINS, In report the unit can be shown because both table MARA and MARD have same key MATNR.

That's what I can conclude until this time.

Let me know your comment if any.

Thank all for your input

Regards

Hadi

0 Kudos

Hai,

Go through this link: http://help.sap.com/saphelp_nwpi71/helpdata/en/cf/21ea5d446011d189700000e8322d00/content.htm

This should clear your doubts, if any:)

Best Regards,

rama