‎2009 Jul 03 11:04 AM
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...
‎2009 Jul 03 12:08 PM
Hi,
set cursor field 'COURSE' . " Check the field name and make sure you entered in CAPITAL letters.
Hope this may solve.
Regards,
Smart Varghese
‎2009 Jul 03 11:09 AM
Have you written the SUBMIT in uppercase or not.
It may be the case as written in quotes.
Regds,
Anil
‎2009 Jul 03 11:17 AM
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...
‎2009 Jul 03 12:02 PM
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.
‎2009 Jul 03 12:08 PM
Hi,
set cursor field 'COURSE' . " Check the field name and make sure you entered in CAPITAL letters.
Hope this may solve.
Regards,
Smart Varghese