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: 

Validate the char field as a currency field

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

1 REPLY 1

Former Member
0 Kudos

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.