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 validations and screen properties.

Former Member
0 Likes
690

Hi,

I am doing validation for Company Code Select-Options. When the user enters the wrong ccode ,it triggers the error message and the cursor is focusing to the first element in the selection screen. How do I focus the cursor to the ccode when there is error. Please suggest.

Thanks,

Rajani.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
668

Hi,

Use "set cursor" statement.

SET CURSOR FIELD field

Hi,

I am doing validation for Company Code Select-Options. When the user enters the wrong ccode ,it triggers the error message and the cursor is focusing to the first element in the selection screen. How do I focus the cursor to the ccode when there is error. Please suggest.

Thanks,

Rajani.

4 REPLIES 4
Read only

Former Member
0 Likes
669

Hi,

Use "set cursor" statement.

SET CURSOR FIELD field

Read only

0 Likes
668

Hi Shruthi,

Thanks for the relevant reply. But its not working. I included this statement after the Form Validations. Please let me know where to use this statement.

Thanks,

Rajani.

Read only

Former Member
0 Likes
668

Hi,

Just go through this code.....

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS:

s_zbukr FOR regup-zbukr,

s_lifnr FOR regup-lifnr,

SELECTION-SCREEN END OF BLOCK b1.

PERFORM check_bukrs.

FORM check_bukrs.

SELECT COUNT(*) FROM t001 WHERE bukrs IN s_bukrs.

IF sy-subrc NE 0.

MESSAGE e208 WITH 'Comapany code not found'(002).

ENDIF.

ENDFORM.

Thanks,

Read only

Former Member
0 Likes
668

Hi,

Instead of validating all the fields in At Selection-Screen use

At Selection-Screen on FIELD. This will focus the cusor on the validating field.