08-03-2008 6:47 AM
hi all,
i have a requirement to validate a char field as an currency field...
i.e if user enters any char other than numeric, dot...i need to display an error message..THIS IM FINE>>>
Also user can enter a value as -123.23.34
How to handle such cases...
The only permissible value is a numeric value with two decimal places and a -sign.
Thanks in regards
Shiva
08-03-2008 7:04 AM
Try this logic:
data: l_amount type p decimals 2.
l_char = '-12323.34'. << This is ur char variable to store numeric vlue.
try.
l_amount = l_char.
catch cx_root.
Do ur error handling here
endtry.
08-03-2008 7:04 AM
Try this logic:
data: l_amount type p decimals 2.
l_char = '-12323.34'. << This is ur char variable to store numeric vlue.
try.
l_amount = l_char.
catch cx_root.
Do ur error handling here
endtry.