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: 

validating user fields

Former Member
0 Kudos
134

Hi all, brand new ABAPer here. When using tcode CO03 and going to Production Order Display -> User Fields tab there is a field that we input Length. For example a user will input 194.10 for the length of material. In this case the user entered 194..10 and when we ran a batch job the job caused a short dump. Can someone give me a starting point in validating that field to prevent invalid decimal numbers? There are 3 fields on that tab that are decimal numbers so it would be great to validate them all.

Thanks,

Mike

1 ACCEPTED SOLUTION

Former Member
0 Kudos
77

Hi..

declare the length field as type P.

<b>data: length type p decimals 2.</b>

Validation will be taken care by the data type u r specifying...

5 REPLIES 5

Former Member
0 Kudos
78

Hi..

declare the length field as type P.

<b>data: length type p decimals 2.</b>

Validation will be taken care by the data type u r specifying...

Former Member
0 Kudos
77

after digging further, is there a way to add the above code to the PAI module for screen 201 and apply it to the appropriate text boxes? I believe the text fields are AFVGD-USR02, 04, 05. Sorry for the newbie questions, I'm just getting started with ABAP.

Thanks

0 Kudos
77

HI Micheal,

You cannot change the program for which you are doing the BDC.

Instead you can validate the data that is uploaded from the file(Before you do the bdc).

Regards,

Ravi

0 Kudos
77

Hi Michael

You can create Field Exits for that screen for the selected fields which will validate the data...

Program for creating field exits:

RSMODPRF

Revert back in case you need help with Field Exits.

I hope creating field exits will meet your requirement of validating data.

Reward if helpful.

Aabhas.

Former Member
0 Kudos
77

u need to declare the text boxes types as P... goto text box attributes and u can specify the length and characteristics to the field.