2010 Mar 12 8:17 AM
Hi all,
How to trigger the PAI event after pressing the enter key on the keyboard. i have a input field and a button on the screen. after entering the value into the field and pressing buttot will take to next screen. But if I press enter key the value is getting cleared. How to trigger the PAI event after pressing the enter key?
Thanks in advance,
Dev.
2010 Mar 12 8:26 AM
Hi,
The keyboard event 'Enter' does not have a default sy-ucomm or a Function code associated with it.
So, whenever you press Enter, it triggers the PAI (sy-ucomm would be blank) and somewhere in your code the value is being refreshed. You can debug thoroughly to find where the problem is.
You can assign a Function code for Enter. Go to the GUI Status of the Screen -> Function Keys -> You will find a icon Enter (the one with the tick mark in a green circular background) -> Assign Function code like 'ENTER'.
Now in your PAI, restrict your code saying
if sy-ucomm = 'ENTER'.
"Logic
endif.
2010 Mar 12 8:20 AM
AFAIK PAI is triggered after you press the ENTER key. may be in the code you are clearing the values in the PAI.
BR,
SUhas
2010 Mar 12 8:26 AM
Hi,
The keyboard event 'Enter' does not have a default sy-ucomm or a Function code associated with it.
So, whenever you press Enter, it triggers the PAI (sy-ucomm would be blank) and somewhere in your code the value is being refreshed. You can debug thoroughly to find where the problem is.
You can assign a Function code for Enter. Go to the GUI Status of the Screen -> Function Keys -> You will find a icon Enter (the one with the tick mark in a green circular background) -> Assign Function code like 'ENTER'.
Now in your PAI, restrict your code saying
if sy-ucomm = 'ENTER'.
"Logic
endif.
2010 Mar 12 8:59 AM
2010 Mar 12 9:33 AM
FYI...
DATA ok_code LIKE sy-ucomm.
DATA save_ok LIKE ok_code.
........
........
MODULE user_command_1000 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'ENTER'.
........
........
ENDCASE.
ENDMODULE.
Now if you enter something in your I/O field and press enter then data wont get cleared.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |