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: 

Display Float parameter for the Length field

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

Can I use the QUAN data type??

Former Member
0 Kudos

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

0 Kudos

Thanks Solved..