In layout - I need to pass an amount field (type curr) by perform command to do some calculations. The problem is that the field, as input parameter to the ABAP form, is of type c. how should I convert it to decimal for the calculations?
You can directly convert. The following code is perfectly valid, as long c_num is a valid representation of a decimal number. and the destination field is defined large enough to contain the source value, otherwise you will get a runtime error.
Data: c_num(16) value '123.45', f_num type f, p_num type p decimals 2. p_num = c_num. f_num = c_num.
Determining that c_num is a valid representation of a decimal number is not always trivial. For your case, using Perform from a layout set, you probably won't have to worry about this - i.e. the field will always be valid, or initial.
This was first published in June 2001