2012 Sep 17 5:59 PM
I have an abap report as below:
I hope that when input So notification and pess Enter -> the data loaded into table control
-> How to catch enter event in input field on So notification input field?
Please help me,
Dai nguyen quang.
2012 Sep 17 10:40 PM
Hi Quang,
The answer Amy gave applies to the case where the key ENTER is pressed at selection screen, i.e. screen 1000, and if this is not the case(all other screens) you will need to use some logic, under the screen flow, after the process after input. command, normally if its screen lets say screen 100 it will look something like:
process after input.
module exit at exit-command.
module user_command_100.
module exit input.
****WHAT TODO WHEN LEAVING THE SCREEN FROM TOOLBAR
****FOR EXAMPLE:
case ok_code.
when others.
leave to screen 0.
endcase.
endmodule.
module user_command_100 input.
If SY-UCOMM is initial.
******ACTION TO BE DONE WHEN ENTER IS PRESSED
endif.
endmodule.
I think that Amy and I pretty much covered the subject,
Best,
Iftah.
2012 Sep 17 7:55 PM
2012 Sep 17 10:40 PM
Hi Quang,
The answer Amy gave applies to the case where the key ENTER is pressed at selection screen, i.e. screen 1000, and if this is not the case(all other screens) you will need to use some logic, under the screen flow, after the process after input. command, normally if its screen lets say screen 100 it will look something like:
process after input.
module exit at exit-command.
module user_command_100.
module exit input.
****WHAT TODO WHEN LEAVING THE SCREEN FROM TOOLBAR
****FOR EXAMPLE:
case ok_code.
when others.
leave to screen 0.
endcase.
endmodule.
module user_command_100 input.
If SY-UCOMM is initial.
******ACTION TO BE DONE WHEN ENTER IS PRESSED
endif.
endmodule.
I think that Amy and I pretty much covered the subject,
Best,
Iftah.
2012 Sep 17 10:43 PM
I am guessing this program does not even have a selection screen. You have to catch this in the PAI event of your screen.
I am also guessing that you do not know what PAI is as well. I would suggest you read up a bit on screen processing.
2012 Sep 18 5:14 AM
In the GUI Status of the screen,give user command (say ENTER) against tick mark under the Function keys.
Then in PAI, module user_command, write the business logic for case 'ENTER'.
2012 Sep 18 5:52 AM
I will try your solution and reply to you the result, thanks.
2013 Sep 11 10:18 AM
2012 Sep 18 5:36 AM
It has to be catch in PAI of the screen processing event. As Larry suggested please read a bit on screen processing events. Plus no need to have any Function code for ENTER at least.
2012 Sep 18 5:51 AM
Thanks for all replies, my problem was solved. When user click enter ok_code = ' '.
IF_SO_NOTI_0400_TEMP is the temp variable to save the old So notification.
IF_SO_NOTI_0400 is the variable to save current So notification.
MODULE USER_COMMAND_0400 INPUT.
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK.
WHEN 'BACK'.
CALL SCREEN 0100.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'CANCEL'.
CALL SCREEN 0100.
WHEN 'EXEC'.
PERFORM GET_DATA_0400.
WHEN 'SAVE'.
PERFORM UPDATE.
WHEN ' '. "WHEN USER CLICK ENTER
ELSEIF IF_SO_NOTI_0400_TEMP <> IF_SO_NOTI_0400. "User changed So notification
PERFORM GET_DATA_0400. "Reload data
IF_SO_NOTI_0400_TEMP = IF_SO_NOTI_0400.
ELSE.
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND_0400 INPUT