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.
Dig Deeper on SAP ABAP
Related Q&A from Matthew Billingham
An SAP user is trying to run a report in an SAP ALV Grid online and wants to know how to get the data in the report to appear along with the header. Continue Reading
An SAP user needs to transfer customer purchase order spreadsheet data to SAP VA01 to create a new sales order. Continue Reading
An SAP user needs information on how to change the password on several SAP user accounts from a central location. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.