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

field validation and set cursor in modulepool program

spandana_babu
Participant
0 Kudos
748

hi,

I would like to know the validations of fileds in module pool program.

i have two problems in field validations

1. i have written validation CODE for the filed Age

FILED AGE VALUES ( BETWEEN '20' AND '120') in table control between chain and chain.

it show error while entering age like 20 ,21......, validation is not working.

2. i want keep cursor where fields are showing the error, when i pressed enter or something.

i have validation code for all fileds.

thanks & regard

spnadana

2 REPLIES 2
Read only

Sandra_Rossi
Active Contributor
0 Kudos
413

FIELD ... VALUES is deprecated. Use modules instead.

Look at the examples in SE38, menu Environment | Examples | ABAP examples, then select User interfaces | Screens in the tree

Read only

Former Member
0 Kudos
413

hi

Try this code.



INSIDE OF PAI MODULE WRITE THIS CODE.

DATA : CURSORFIELD(25),	 "DECLEAR IN TOP INCLUDE

PERFORM GET_CURSOR.


FORM GET_CURSOR .

IF AGE GE '20' AND AGE LE '120'.

  CLEAR : CURSORFIELD.
  GET CURSOR FIELD CURSORFIELD.

MESSAGE  'text xyz' TYPE 'S' DISPLAY LIKE 'E'.

ENDIF.

ENDFORM.                    " GET_CURSOR

****************************************************************


INSIDE OF PBO WRITE THIS CODE.

  PERFORM SET_CURSOR.

FORM SET_CURSOR .

    SET CURSOR FIELD CURSORFIELD.

ENDFORM.                    " SET_CURSOR


cursor position set into ur Age Text box.

it will work.

Regards,

Abhilash