SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software SAP ABAP Programming and HANA Database Tutorials
Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Windows, Windows Phone, SAP and ABAP, like SAP UI5, Screen Personas, etc.




CRM Companies List
Web Based CRM Software




Catch Enter Key Press Event in Process After Input PAI Module

On ABAP program Dynpro screen to catch Enter event on the module user_command from ok_code or sy-ucomm, PF-STATUS user interface function keys should be modified as shown in this SAP tutorial.


How to Catch Enter Key Press in Process After Input PAI Module

I have a Dynpro screen number 100 with input elements and a button to filter sales orders according to provided filter criteria. What I want to do is to catch Enter key press and execute the program as if List button is pressed.

catch Enter event on ABAP Dynpro screen

In module status_0100 ABAP code actually in the PROCESS BEFORE OUTPUT (PBO) module, in general programmers create a user interface for buttons, menu and standard icons using SET PF_STATUS command.

MODULE status_0100 OUTPUT.
 SET PF-STATUS 'MAINSTATUS'.
 ...
ENDMODULE.

When you double click on MAINSTATUS and expand the Function Keys, an ABAP programmer can customize the icons and function keys as follows.

function keys, icons and Enter key press

As seen in below screenshot, I used the LIST ok_code value which is assigned to the List button for F8 key and for Enter key press (not explicitly seen as ENTER but green icon Enter key)

Of course these sy-ucomm or ok_code return values are processed in PROCESS AFTER INPUT (PAI) ABAP code module as follows:

MODULE user_command_0100 INPUT.

 save_ok = ok_code.
 CLEAR ok_code.

 CASE save_ok.
  WHEN 'EXIT' OR 'BACK' OR 'CNCL'.
   LEAVE PROGRAM.
  WHEN 'LIST'.
   PERFORM getData.
  WHEN OTHERS.
 ENDCASE.

ENDMODULE.

If you want to differantiate Enter key, F8 key and List button you can assign different values for these in the pf-status user interface settings configuration.






SAP Tutorials

SAP Tutorial

SAP Forums

SAP Tools

SAP Transaction Codes Table








Copyright © 2004 - 2017 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems