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

Problem with SET CURSOR command

Former Member
0 Likes
708

Hello Experts,

I am trying to clear all the text fields & set the cursor to first filed in a selection .. Al these will be excuted when a pushbutton is clicked...But i am able to clear the field but CURSOR is not going back to the first field...it remains in the last field which is being edited before clear operation...

the code i have written :

PARAMETERS : gd_comm like SY-UCOMM DEFAULT 'submit' NO-DISPLAY.

AT SELECTION-SCREEN.

if Sscrfields-ucomm eq 'submit'.

gd_comm = 'submit'.

endif.

AT SELECTION-SCREEN OUTPUT.

if gd_comm EQ 'submit'.

clear : course , Strt_dat , End_dat , EMP_ID, Emp_name, Location, usage.

set CURSOR FIELD 'course'.

endif.

Please help...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
671

Hi,

set cursor field 'COURSE' . " Check the field name and make sure you entered in CAPITAL letters.

Hope this may solve.

Regards,

Smart Varghese

4 REPLIES 4
Read only

Former Member
0 Likes
671

Have you written the SUBMIT in uppercase or not.

It may be the case as written in quotes.

Regds,

Anil

Read only

0 Likes
671

No, still cursor is not going back to the first text field......

it remains last text field edited.....

clear : course , Strt_dat , End_dat , EMP_ID, Emp_name, Location, usage. --- this line is working..

set CURSOR FIELD 'course'. -


> it's not working.....

Please help...

Read only

Former Member
0 Likes
671

Try something like following

DATA : BTN_PRES TYPE C.
SELECTION-SCREEN PUSHBUTTON /01(20) LCLEAR   USER-COMMAND CLS. "BUTTON
PARAMETERS : COURSE,
             STRT_DAT ,
             END_DAT ,
             EMP_ID,
             EMP_NAME,
             LOCATION,
             USAGE.

INITIALIZATION.
  LCLEAR = 'CLEAR'.

AT SELECTION-SCREEN.
  IF SY-UCOMM EQ 'CLS'.   "BUTTON PRESSED
****CLEAR PARAMETERS
    CLEAR : COURSE , STRT_DAT , END_DAT , EMP_ID, EMP_NAME, LOCATION, USAGE.
    BTN_PRES = 'X'.  "SET BUTTON PRESSED
  ENDIF.

AT SELECTION-SCREEN OUTPUT.
  IF  BTN_PRES = 'X'.  "IF BUTTON PRESSED
    SET CURSOR FIELD 'COURSE'. "SET CURSOR
    BTN_PRES = ''.    "CLEAR BUTTON PRESSED
  ENDIF.

Read only

Former Member
0 Likes
672

Hi,

set cursor field 'COURSE' . " Check the field name and make sure you entered in CAPITAL letters.

Hope this may solve.

Regards,

Smart Varghese