Application Development 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: 

How to catch enter event on input field in an abap report?

Former Member
0 Kudos
8,330

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.

1 ACCEPTED SOLUTION

iftah_peretz
Active Contributor
0 Kudos
1,766

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.

8 REPLIES 8

amy_king
Active Contributor
0 Kudos
1,766

Hi Dai,

You can use event AT SELECTION-SCREEN.

Cheers,

Amy

iftah_peretz
Active Contributor
0 Kudos
1,767

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.

Former Member
0 Kudos
1,766

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.

Arun_Prabhu_K
Active Contributor
0 Kudos
1,766

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'.

0 Kudos
1,766

I will try your solution and reply to you the result, thanks.

0 Kudos
1,766

Hi 

 

former_member214878
Active Participant
0 Kudos
1,766

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.

Former Member
0 Kudos
1,766

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