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

Module Pool, screen field, cursor movement

Former Member
0 Likes
901

Hi in one of my module pool program, i have two fields in the screen, after entering data in the first screen when user presses enter the cursor autometically must come to the second field, but i am unable to do that, i have tried with SET CURSOR FIELD <field-name>, but it is not working, pls let me know if there is any way to do that.

9 REPLIES 9
Read only

Former Member
0 Likes
871

hi,

did you place the set cursor field command in the PBO event.

regards,

Navneeth.K

Message was edited by:

Navneeth Bothra

Read only

0 Likes
871

How can i set that in PBO because after giving the value user will press enter, so i think i have to capture it in PAI.

Read only

Former Member
0 Likes
871

hi,

Ensure that fieldname is in CAPS.

Set cursor field 'P_SECOND'.

Regards

sailaja.

Read only

0 Likes
871

Yes i have also checked that, but it is not working............

Read only

0 Likes
871

can u show me the code.

Also make sure that screen field name is correct in 'set cursor' statement.

Read only

0 Likes
871

&----


*& Module pool ZMOD *

*& *

&----


*& *

*& *

&----


PROGRAM zmod .

&----


*& Module USER_COMMAND_9000 INPUT

&----


  • text

----


MODULE user_command_9000 INPUT.

DATA: t1(10) TYPE c,

t2(10) TYPE c.

DATA: f(5) TYPE c VALUE 'T2'.

CASE sy-ucomm.

WHEN 'ENTER'.

LEAVE TO SCREEN 9000.

SET CURSOR FIELD f LINE 1 OFFSET 4.

t2 = 'xx'.

ENDCASE.

ENDMODULE. " USER_COMMAND_9000 INPUT

----


  • MODULE CURSOR OUTPUT

----


*

----


MODULE cursor OUTPUT.

CASE sy-ucomm.

WHEN 'ENTER'.

SET CURSOR FIELD f.

set pf-status 'SCREEN_100'.

ENDCASE.

ENDMODULE. "CURSOR OUTPUT

----


  • MODULE BACK INPUT

----


*

----


MODULE back INPUT.

LEAVE SCREEN.

ENDMODULE. "BACK INPUT

&----


*& Module STATUS_9000 OUTPUT

&----


  • text

----


MODULE status_9000 OUTPUT.

SET PF-STATUS 'Z9000'.

  • SET TITLEBAR 'xxx'.

ENDMODULE. " STATUS_9000 OUTPUT

Read only

0 Likes
871

Hi

Check the BOLD part of the code.

PROGRAM zmod .

&----


*& Module USER_COMMAND_9000 INPUT

&----


  • text

----


MODULE user_command_9000 INPUT.

DATA: t1(10) TYPE c,

t2(10) TYPE c.

DATA: f(5) TYPE c VALUE 'T2'.

CASE sy-ucomm.

<b>WHEN 'ENTER'.

GET CURSOR FIELD v_fname.</b>

**SET CURSOR FIELD f LINE 1 OFFSET 4.

*t2 = 'xx'.

ENDCASE.

ENDMODULE. " USER_COMMAND_9000 INPUT

----


  • MODULE CURSOR OUTPUT

----


MODULE cursor OUTPUT.

set pf-status 'SCREEN_100'.

CASE sy-ucomm.

WHEN 'ENTER'.

<b>IF v_fname = 'FLD1' AND fld1 IS NOT INITIAL.

SET CURSOR FIELD 'FLD2'.

ELSEIF v_fname = 'FLD1'AND fld1 IS INITIAL.

SET CURSOR FIELD 'FLD1'.

ELSEIF v_fname = 'FLD2'AND fld2 IS NOT INITIAL.

SET CURSOR FIELD 'FLD3'.

ELSEIF v_fname = 'FLD2'AND fld2 IS INITIAL.

SET CURSOR FIELD 'FLD2'.

ENDIF.</b>

ENDCASE.

ENDMODULE. "CURSOR OUTPUT

Message was edited by:

Vigneswaran S

Read only

Former Member
0 Likes
871

HI,

AFTER TAKING THE FIELDS U SHOULD GIVE THE FUNCODE FOR IT...JUST CHECK IT OUT ...

IF NOT THE CURSOR WILL NOT GO TO THE NEXT FIELD.

REGRDS,

MADHU

Read only

Former Member
0 Likes
871

hye Arup,

First findout the fcode of Enter key. if u find it then ur logic will work.

i think its ok_code but im not sure.

when 'ok_code'.

set cursor field 'fieldname'.

Reward if useful

regards,

Sunny