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

Allow -ve values

Former Member
0 Likes
508

HI ,

I have 2 strings

DATA :lv_numeric TYPE string VALUE '123456789.'.

DATA :lv_capamount TYPE string value '-34.45'.

IF NOT lv_capamount CO lv_numeric.

  1. validation is here."invalid amount

endif.

I need to allow -ve values here.

4 REPLIES 4
Read only

Former Member
0 Likes
480

Add '-' to your lv_numeric string.

Read only

Former Member
0 Likes
480

Hi,

In the lv_numeric string add the '-' sign also..

lv_numeric = '1234567890.-'.

Thanks,

Naren

Read only

Former Member
0 Likes
480

Hi Srinivas,

To allow negative values only then <b>include character - into your LV_NUMERIC string.</b>

DATA :lv_numeric TYPE string VALUE <b>'123456789.-'</b>.

DATA :lv_capamount TYPE string value '-34.45'.

IF NOT lv_capamount CO lv_numeric.

  1. validation is here."invalid amount

endif.

Thanks,

Vinay

Read only

0 Likes
480

Hi,

Assign the string lv_numeric as,

lv_numeric = '1234567890.-'.

Regards,

Azaz.