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

setting cursor in particular field

former_member671224
Participant
0 Likes
628

Hi,

Lets take two fields as <b>field A and Field B</b>.

Based on the input given to field A, field B will be mandatory. So if Field B is not entered then it should show error message. Its working fine. but after displaying error message, the cursor should be in field B. but the cursor is in field A.

So how should i code it to set the cursor in Field B?

the order of the fields in screen is First field A then Field B.

can someone help me in this...

Regards,

Amal

Hi,

Lets take two fields as <b>field A and Field B</b>.

Based on the input given to field A, field B will be mandatory. So if Field B is not entered then it should show error message. Its working fine. but after displaying error message, the cursor should be in field B. but the cursor is in field A.

So how should i code it to set the cursor in Field B?

the order of the fields in screen is First field A then Field B.

can someone help me in this...

Regards,

Amal

4 REPLIES 4
Read only

Former Member
0 Likes
600

Hi Amal,

Code as below..

PARAMETERS : par1 TYPE bukrs,

par2 TYPE waers.

Now do the coding in at selection screen on field event.

AT SELECTION-SCREEN ON par2.

IF par1 EQ 'your desired value for which par2 is mandatory'

AND par2 IS INITIAL.

MESSAGE Exxx WITH 'par2 is mandatory for given value of par1'.

ENDIF.

This code will run such that when the error message is displayed, only par2 will be enebled for input, so the cursor will be in par2 only.. All other fields will be greyed..

Thanks and Best Regards,

Vikas Bittera.

<b><REMOVED BY MODERATOR></b>

Message was edited by:

Alvaro Tejada Galindo

Read only

0 Likes
600

Im doing it in module pool. so iam combining the two fields using chain ... endchain. if i didnt use chain endchain then the first field only input enabled.

Regards,

Amal

Read only

0 Likes
600

Hi Amal,

In the PAI module of CHAIN... ENDCHAIN.. test you condition and set a flag..

In PBO.. check this flag, and code like this..

IF flag EQ 'X'.

LOOP AT SCREEN.

IF screen-name EQ 'your first field name'.

screen-input = 1.

MODIFY screen.

ENDLOOP.

Try to use this and let me know.. also do not forget to clear the flag after this loop, but in the same IF condition..

Thanks and Best Regards,

Vikas Bittera.

<b><REMOVED BY MODERATOR></b>

Message was edited by:

Alvaro Tejada Galindo

Read only

0 Likes
600

Don't chain them. Just check field B.

Rob