Application Development and Automation 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: 
Read only

Check valid amount !

Former Member
0 Likes
447

Hi,

is there any FM that we can check an amount is valid , supposing that the amount is loaded from a text file

For example : 1233.00 --> OK

1a222.00 ->NO

1 2 3 -NO

thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
394

Instead of FM u can build ur own logic like:

For example ur file data is first stored in a char field and then try to move that data in a type p field within try..catch..entry block.

data:l_file_data(20) type c.

data: l_amount type p decimals 2.

l_file_data = '12@3'.

try.

l_amount = l_file_data.

catch cx_root.

  • Do ur error handling here

endtry.

1 REPLY 1
Read only

Former Member
0 Likes
395

Instead of FM u can build ur own logic like:

For example ur file data is first stored in a char field and then try to move that data in a type p field within try..catch..entry block.

data:l_file_data(20) type c.

data: l_amount type p decimals 2.

l_file_data = '12@3'.

try.

l_amount = l_file_data.

catch cx_root.

  • Do ur error handling here

endtry.