Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3022

BSP Business Server Pages: Keypress F2 in Layout

$
0
0

Hello,

i want to add an reaction on pressing the key "F2" or "F5".

This reaction I want to handle in "OnInputProcessing" by pressing key F2 for example (it should be the same like click on button "Clear"--> surface of the application see on image in appendix).

In "OnInputProcessing" the coding is:

CASE event_id.
   WHEN 'insert' OR 'next' OR 'scan'.
     lv_matnr = request->get_form_field( 'matnr' ).
     application->read_matnr( matnr = lv_matnr ).
     application->count = page->messages->num_messages( ).

     IF application->count <> 0.
       "Hier wird der Inhalt der Messages aus Read_ta geschrieben!
       application->get_messages( im_count = 1 ).
       EXIT.
     ELSE.
       IF application->lgort IS NOT  INITIAL.
         navigation->goto_page( 'menge.htm' ).
       ELSE.
         navigation->goto_page( 'lagerort.htm' ).
         EXIT.
       ENDIF.
     ENDIF.
   WHEN 'logoff'.

.....


The coding in Layout is the following (clicking on buttons works, but not press key):

<%@page language="abap" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//DE" "http://www.w3.org/TR/html4/loose.dtd">
<html>
   <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
     <link rel="stylesheet" href="../zsir_mime/css/main.css" type="text/css">
     <script src="../zsir_mime/js/helper.js" type="text/javascript"></script>
     <title>MDE Dialog</title>
   </head>
   <body onload="self.focus();document.getElementById('matnr').focus()" onfocus="document.getElementById('matnr').focus()">
   <div class = "content">
     <h3 class = "header">Warenausgang ungeplant</h3>
<%-- ACHTUNG: APPLICATION-count/success kann global aus dem BSP heraus
     aufgerufen werden. Count muss größer 0 sein, damit eine Nachricht ausgegeben wird
     Bei Success wird eine Erfolgmeldung ausgegeben!         --%>
<%
   if application->count > 0.
%>
<%
   if application->success is initial.
%>
<div class="msg error">
<%
   else.
%>
<div class="msg success">
<%
   endif.
%>
   <%= application->gs_error-message%><br/>
</div>
<%
   endif.
%>
<%
   clear application->count.
%>
<%
   clear application->success.
%>
<%
   clear application->gs_error-message.
%>
<form>
   <table border="0">
     <tr>
       <td>
         &nbsp;
       </td>
     </tr>
     <tr>
       <td align="center">
           <div><strong>Materialnummer einscannen</strong></div>
       </td>
     </tr>
     <tr>
       <td align="center">
         <input type="text" id="matnr" name="matnr" class="input" onblur="tab_submit('matnr','insert', 0);document.getElementById('matnr').focus()"
         maxlength="14"/>
       </td>
     </tr>
<%-- <tr>
     <td>
      
     </td>
     </tr> --%>
   </table>
   < script language="JavaScript" type="text/javascript"> document.onkey-down=function()
{
if(event.keyCode==113){
   return  htmlbSL(this,2,'Button_id:your_button_event')
       }
    }
     </script>
   <table border="0">
     <tr>
       <td align="center"><input type="submit" name="onInputProcessing(next)" value="Weiter" class="button"></td>
       <td align="center"><input type="submit" name="onInputProcessing(logoff)" value="Beenden" class="button"></td>
        <tr> </tr>
       <td align="center"><input type="submit" name="onInputProcessing(buchen)" value="Buchen" class="button"></td>
       <td align="center"><input type="submit" name="onInputProcessing(clear)" value="Clear" class="button"></td>
         </tr>
       </table>
       <input type="hidden" name="onInputProcessing" id="event_id" value="scan"/>
     </form>
     <table border="0">
         <tr>
             <td align="center">
<%
   if application->gt_ungeplant is not initial.
%>
<div><strong>Arbeitsvorrat:</strong></div>
<%
   loop at application->gt_ungeplant into application->gs_ungeplant.
%>
<tr>
     <td align="center"> <%= application->gs_ungeplant-matnr %>  <%= application->gs_ungeplant-lgort %>  <%= application->gs_ungeplant-menge %> </td>
</tr>
<%
   endloop.
%>
<%
   endif.
%>
     </table>
     </div>
   </body>
</html>








I tried with this coding, but it only appears as a writing on the layout/frontend (no logic)

< script language="JavaScript" type="text/javascript">

document.onkey-down=function() 

{

if(event.keyCode==113){

 

  return  htmlbSL(this,2,'Button_id:your_button_event')

      }

   }

    </script>

 

 

Would be great if somebody could help me!! Thanks!



Viewing all articles
Browse latest Browse all 3022

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>