‎2009 Aug 20 1:04 PM
how to use enter button instead of pushbutton for calling another screen?
‎2009 Aug 20 1:18 PM
Hi,
normally the ok_code for Enter is 'ENTR'. So check sy-ucomm value equal to 'ENTR' and then call the required screen.
Regards,
Ankur Parab
‎2009 Aug 20 2:35 PM
>
> Hi,
> normally the ok_code for Enter is 'ENTR'. So check sy-ucomm value equal to 'ENTR' and then call the required screen.
>
> Regards,
> Ankur Parab
Sorry but this is not true. Normally pressing ENTER doesn't place any function code in sy-ucomm . This is one of the reason why you in PAI we should store ok_code in some save_code variable and then clear it. Simply after pressing ENTER in next screen without first clearing content of ok_code we might still have previous function code there, hence program logic would be wrong.
Refer for proof [Reading Function Codes|http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dbaa1335c111d1829f0000e829fbfe/frameset.htm]
@ Priya.R
If you want to catch your ENTER, simply do the following
data: ok_code like sy-ucomm, "ok_code assigned to screen
save_code like sy-ucomm.
MODULE pai INPUT.
save_code = ok_code.
clear ok_code.
if save_code = space. "as said above ENTER will generate empty function code
CALL SCREEN ...
endif.
ENDMODULE.
Regards
Marcin
‎2009 Aug 20 1:30 PM
Hi,
Go to the GUI status -> Application Tool bar -> In the Enter button (a tick mark), assign a function code 'ENTER', check and activate the GUI status.
Now your sy-ucomm value for Enter is 'ENTER'. Start coding using this sy-ucomm value in your program.
IF ( sy-ucomm EQ 'ENTER' ).
CALL SCREEN 0120.
ENDIF.
‎2009 Aug 21 12:20 PM
Hi priya,
For handling enter button event, you create a pf-status. In your pf-status, there will be "tick" symbol ( OK ). Under that you create a function code and then if you press enter button, your sy-ucomm value will be the function code which you gave in your pf-status.
Try it. It will work.
Thanks and regards,
Venkat
‎2009 Aug 24 6:14 AM
Hello Priya,
For ENTER key sy-ucomm value is initial.
Thanks,
Augustin
‎2009 Nov 23 5:38 AM
Hi, For Enter key, Function code is space.
use code like.
if sy-ucomm eq 'SPACE'.
.
.
.
ENDIF.