06-29-2007 10:48 AM
hi, experts
i m using the currency and quantity data types in field but during activation it show errors of reference table and reference fields.
regards
prakash
06-29-2007 10:51 AM
Hi,
hi,
The reference field is used for the output, the output/input format of a currency field depends on the value of its reference field.
For example if you create a screen using the field KONV-KBETR :
the reference field is RV61A-AWEI1:
if you set RV61A-AWEI1 = 3
the value in KONV-KBETR is beeing shown with 3 decimals
So you could see 3,000 but this value is automatically stored as 30.00
if you set RV61A-AWEI1 = 2
the value in KONV-KBETR is beeing shown with 2 decimals
All this convertions are automatically made in according to the value setted in reference field.
You can see this using the statament WRITE with options CURRENCY, try this:
PARAMETERS P_KBETR LIKE KONV-KBETR.
WRITE: P_KBETR CURRENCY '3'.
WRITE: / P_KBETR CURRENCY '2'.
WRITE: / P_KBETR CURRENCY '1'.
please go thru this URL:
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/abap+dictionary&;
Regards
06-29-2007 10:54 AM
just go to the where used list of data type and check in another table what is the refrence field and refrence field just find out these and use the same in ur table field
06-29-2007 10:58 AM
Hi
Its' a Mandatory that you have to give reference fields for Both CURR and QUAN type fields in the Table when you assign this datatype for table fields.
It is always good to declare a Currency refrence field(waers) and Qty refrence field(MEINS) in your table when ever you declare CURR and QUAN (currency and Qty) fields
because without the reference units the values in the fields CURR and QUAN are meaning less
example:
if say 1000 in CURR it doesn't means anything
only it means something when you say 1000 INR or 1000USD
similarly 10 KG or 100 Lb etc
I hope you understood
If you declare these units fields use them agains those fields or you can use some std Table fields like VBAP-WAERK for currency and EKPO-MEINS for Quantity reference field
<b>
Reward points for useful Answers</b>
Regards
Anji
06-29-2007 11:11 AM
hi,
For currency and quantity fields better diclare type as reference table field.then u wont get the problem.
like
data: netwr type vbrk-netwr.
Thanks,
Madhukar.
06-29-2007 1:00 PM
Hi Prakash,
While declaring Currency & QTY better You can declare as CHAR data type & try it out. Problem will be solved.
Regards,
Kavitha.
<u>Reward points if useful.</u>
06-30-2007 6:53 AM
Hi,
for CURRENCY field
1.DATA type in Domain must be CURR.
2. It must be linked with field type CUKY.
for QUANTITY field.
1. DATA type must be QUAN.
2. it must be linked with field type UNIT.
Reward if Helpful.
Regards
Raghavendra.D.S
07-03-2007 10:57 AM
Hello Prakash ,
Currency and Quantity are measurable units .Currency can be either USD,INR,EURO etc.....and same is the case with Quantity it can be nos,kg,litre etc.So when you declare a field of type CURR or QUAN and activate a table.The system looks for a reference table for this field since this field is measurable and can have different meanings or value, this field need to refer to a table that has different measurable units.Therefore a reference table is very much required for these type of fields.You can either use standard Currency or Quantity tables or any customisable table of your choice depending on your scenario.
Regards,
Reema
07-03-2007 11:05 AM
You must specify a reference table for fields containing quantities (<b>data type QUAN</b>) or currency amounts (<b>data type CURR</b>).
This reference table must contain a field with the format for the currency key (data type <b>CUKY</b>) or unit of measure (data type <b>UNIT</b>). This field is called the reference field of the output field. The reference field can also reside in the table itself.
A field is only assigned to the reference field at program runtime. For example, if a field is filled with currency amounts, the corresponding currency is determined from the assigned reference field, that is the value entered in this field at the moment defines the currency.
example :
Table <b>SBOOK</b> in the flight model contains all the flight bookings made by customers. Field FORCURAM contains the price of the booking in the customers currency. Field <b>FORCURKEYof table SBOOK </b> contains the corresponding currency key for this price. <b>SBOOK</b> is therefore the reference table for field <b>FORCURAM</b> and<b> FORCURKEY</b> is the reference field for field <b>FORCURAM</b>.
reward points if it is usefull .....
Girish
07-03-2007 3:40 PM
Hi,
There's a tab just above the table where u enter fields named as "Reference table",pls enter there the reference table for currency and quantity i.e; cuky and unit.now activate the table.
pls reward points if answer was useful.
Regards,
Ameet