‎2010 Jan 25 9:41 AM
Hi Experts,
We need to display a Field of type float (for length field ) in order to retrict the user upto specified number of decimal places.
I have seen in Forums like : DATA : ZABC type P decimals 2.
But i am creating the screen using Dialog programming, hence how do i code for this field??
I'm unable to place a field on the screen which would restrict for a specific number of decimal places.
Requirement : This field is used to enter the length of an equipment.
Thanks in advance,
Vidya
‎2010 Jan 25 9:56 AM
Hello,
As per my understanding your requirement is that you want to create a field on screen (using module pool) so as a user is allowed to enter a number with fixed decimal places liske 12.35, so the user may not be able to enter 12.356, i.e., 3 decimals places.
If so create an input box in module pool and in its properties select DEC from the dropdown for Format.
Now in your main program declare a varaible with the same name as the input box of type p decimals 2.
When you execute your program and if the user tries to enter a value with decilmal places more than 2, SAP will generate an error message stating the proper format that can be entered.
Regards,
Sachin
‎2010 Jan 25 9:49 AM
‎2010 Jan 25 9:56 AM
Hello,
As per my understanding your requirement is that you want to create a field on screen (using module pool) so as a user is allowed to enter a number with fixed decimal places liske 12.35, so the user may not be able to enter 12.356, i.e., 3 decimals places.
If so create an input box in module pool and in its properties select DEC from the dropdown for Format.
Now in your main program declare a varaible with the same name as the input box of type p decimals 2.
When you execute your program and if the user tries to enter a value with decilmal places more than 2, SAP will generate an error message stating the proper format that can be entered.
Regards,
Sachin
‎2010 Jan 25 10:03 AM