From 5c1298697d555eacd3c797f04fb4ca7438990253 Mon Sep 17 00:00:00 2001 From: Marc Bernard <59966492+mbtools@users.noreply.github.com> Date: Thu, 5 Nov 2020 03:46:21 -0500 Subject: [PATCH] Trigger main command when pressing enter in form (#4102) * Triggers main command when pressing enter in form Adds hidden button that triggers main command when pressing the enter key * Lint Co-authored-by: Lars Hvam --- src/ui/zcl_abapgit_html_form.clas.abap | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ui/zcl_abapgit_html_form.clas.abap b/src/ui/zcl_abapgit_html_form.clas.abap index 164c55999..3e0ac5241 100644 --- a/src/ui/zcl_abapgit_html_form.clas.abap +++ b/src/ui/zcl_abapgit_html_form.clas.abap @@ -285,6 +285,14 @@ CLASS ZCL_ABAPGIT_HTML_FORM IMPLEMENTATION. ri_html->add( |
| ). ri_html->add( |
| ). + + " Add hidden button that triggers main command when pressing enter + LOOP AT mt_commands ASSIGNING WHERE is_main = abap_true. + ri_html->add( || ). + EXIT. + ENDLOOP. + ri_html->add( |
    | ). LOOP AT mt_fields ASSIGNING .