cancel
Showing results for 
Search instead for 
Did you mean: 

Negative amounts

IanStubbings
Active Participant
0 Kudos

Hi

Is there a standard way of checking for negative amounts that are entered into an input field? I'm thinking of something similar to the mandatory field check.

Cheers

Ian

Accepted Solutions (1)

Accepted Solutions (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

read the attribute and compare using an IF condition.

You can have formats showing the sign using the following code

data: lr_info type ref to if_wd_context_node_info.

data: ls_prop type WDY_ATTRIBUTE_FORMAT_PROP.

lr_info = wd_context->get_node_info( ).

ls_prop = lr_info->GET_ATTRIBUTE_FORMAT_PROPS( name = 'VAL' ).

ls_prop-SIGN_POS = '-'.

lr_info->sET_ATTRIBUTE_FORMAT_PROPS( name = 'VAL'

FORMAT_PROPERTIES = ls_prop ).

Abhi

IanStubbings
Active Participant
0 Kudos

Hi

I saw this option but understood it to mean the position of the sign not whether a negative was allowed or not.

I would still have to check manually whether a negative was allowed.

Cheers

Ian

abhimanyu_lagishetti7
Active Contributor
0 Kudos

If the Data Element is having Sign unticked then the system automatically throughs an error message when a negative value is entered in the input field.

Abhi

IanStubbings
Active Participant
0 Kudos

Hi

You are quite correct. I was expecting the error on pressing enter or navigating away from the field but I only get on pressing a button - presumably initiating the roundtrip.

Thanks for your help.

Cheers

Ian

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> Hi

>

> You are quite correct. I was expecting the error on pressing enter or navigating away from the field but I only get on pressing a button - presumably initiating the roundtrip.

>

> Thanks for your help.

>

> Cheers

> Ian

Almost all validations in Web Dynpro are Server Side. That is reasoning why this is not checked until a button is pressed. In future releases we will include more client side/server side interaction and such checks might be possible seamingly on the client side. But that is still a way down the road. We have created the foundation for such functionality with the new AJAX enabled version of the Unified Renderer in the upcomming Enhancment Package 1 for NetWeaver 7.x.

IanStubbings
Active Participant
0 Kudos

Hi Thomas

Thanks for you input - only just seen your post. I am hoping my current client will implement EnP 1 asap as I'm very keen on the Web Dynpro Islands...

Cheers

Ian

Answers (0)