<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Send a press key event without Batch Input? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-a-press-key-event-without-batch-input/m-p/2801980#M654324</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can also check out the "SET USER-COMMAND" statement to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 02 Sep 2007 23:22:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-02T23:22:39Z</dc:date>
    <item>
      <title>Send a press key event without Batch Input?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-a-press-key-event-without-batch-input/m-p/2801978#M654322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I need send a auto press key event (by example: press F8), by code.&lt;/P&gt;&lt;P&gt;When I put a instruction in the report, the report simulate the key pressed.&lt;/P&gt;&lt;P&gt;Exist some FM to do it? Is it posible?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Sep 2007 12:28:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-a-press-key-event-without-batch-input/m-p/2801978#M654322</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-02T12:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Send a press key event without Batch Input?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-a-press-key-event-without-batch-input/m-p/2801979#M654323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no FM, but a method makes it possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You an use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

    CALL METHOD cl_gui_cfw=&amp;gt;set_new_ok_code
      EXPORTING
        new_code = 'xxxx'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Sep 2007 14:43:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-a-press-key-event-without-batch-input/m-p/2801979#M654323</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-09-02T14:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: Send a press key event without Batch Input?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-a-press-key-event-without-batch-input/m-p/2801980#M654324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can also check out the "SET USER-COMMAND" statement to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Sep 2007 23:22:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-a-press-key-event-without-batch-input/m-p/2801980#M654324</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-02T23:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Send a press key event without Batch Input?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-a-press-key-event-without-batch-input/m-p/2801981#M654325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh yes, there's also function module SAPGUI_SET_FUNCTIONCODE - a "where used" on this will turn up some sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 02:41:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-a-press-key-event-without-batch-input/m-p/2801981#M654325</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T02:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Send a press key event without Batch Input?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-a-press-key-event-without-batch-input/m-p/2801982#M654326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks by the reply, but it doesn't work &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I need refresh an ALV Grid automatic, and I think send the 'AKTU' refresh code to the Sap system.&lt;/P&gt;&lt;P&gt;I have got the code that call a rutine in some times, but this code not works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 05:55:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-a-press-key-event-without-batch-input/m-p/2801982#M654326</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T05:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Send a press key event without Batch Input?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-a-press-key-event-without-batch-input/m-p/2801983#M654327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please give your query in detail. From your query it is not clear about requirement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if possible paste the code&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 05:58:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-a-press-key-event-without-batch-input/m-p/2801983#M654327</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-09-03T05:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Send a press key event without Batch Input?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-a-press-key-event-without-batch-input/m-p/2801984#M654328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I can't put the code. It's more for the reason of this thread.&lt;/P&gt;&lt;P&gt;And... for send a key as F8 ¿Is it posible?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 07:15:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-a-press-key-event-without-batch-input/m-p/2801984#M654328</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T07:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Send a press key event without Batch Input?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-a-press-key-event-without-batch-input/m-p/2801985#M654329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can use the method I recommended in an additional timer object method .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please adapt the below sample program I used to display the current time with auto update:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZZCLOCK
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; may be used to keep connection
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*

REPORT  zzclock.

*---------------------------------------------------------------------*
*       CLASS lcl_gui_timer DEFINITION
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
 class lcl_gui_timer definition inheriting from cl_gui_control.

  PUBLIC SECTION.

    CONSTANTS:  eventid_finished TYPE i VALUE 1 .

    CLASS-DATA: interval TYPE i VALUE '0'.

    EVENTS:     finished .

    METHODS:
             cancel
                  EXCEPTIONS
                     error,
             constructor
                 IMPORTING
                     lifetime TYPE i OPTIONAL
                     value(shellstyle) TYPE i OPTIONAL
                     value(parent) TYPE REF TO cl_gui_container OPTIONAL
                 EXCEPTIONS
                     error,
             run
                 EXCEPTIONS
                     error,
             dispatch REDEFINITION.


ENDCLASS.                    "lcl_gui_timer DEFINITION

*---------------------------------------------------------------------*
*       CLASS lcl_event_handler DEFINITION
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
CLASS lcl_event_handler DEFINITION.

  PUBLIC SECTION.

    CLASS-METHODS:

                on_finished
                       FOR EVENT finished OF lcl_gui_timer.

ENDCLASS.                    "lcl_event_handler DEFINITION


DATA: gui_timer TYPE REF TO lcl_gui_timer.
DATA: event_handler TYPE REF TO lcl_event_handler.
DATA: timeout_interval TYPE i VALUE '9'.

PARAMETERS:
            p_datum TYPE sy-datum,
            p_uzeit TYPE sy-uzeit.

AT SELECTION-SCREEN OUTPUT.
* set to time rounded to 10 seconds
  p_datum = sy-datum.
  p_uzeit = sy-uzeit.

  CREATE OBJECT gui_timer.

  SET HANDLER event_handler-&amp;gt;on_finished FOR gui_timer.

  gui_timer-&amp;gt;interval = timeout_interval.
  CALL METHOD gui_timer-&amp;gt;run.

*---------------------------------------------------------------------*
*       CLASS lcl_event_handler IMPLEMENTATION
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
CLASS lcl_event_handler IMPLEMENTATION.

  METHOD on_finished.

* Start Timer again
    gui_timer-&amp;gt;interval = timeout_interval.
    CALL METHOD gui_timer-&amp;gt;run.

* cause PAI
    CALL METHOD cl_gui_cfw=&amp;gt;set_new_ok_code
      EXPORTING
        new_code = 'REFR'.

  ENDMETHOD.                    "on_finished

ENDCLASS.                    "lcl_event_handler IMPLEMENTATION

*---------------------------------------------------------------------*
*       CLASS lcl_gui_timer IMPLEMENTATION
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
CLASS lcl_gui_timer IMPLEMENTATION.

  METHOD constructor.

    TYPE-POOLS: sfes.

    DATA clsid(80).
    DATA event_tab TYPE cntl_simple_events.
    DATA event_tab_line TYPE cntl_simple_event.

    IF clsid IS INITIAL.
      DATA: return,
            guitype TYPE i.

      guitype = 0.
      CALL FUNCTION 'GUI_HAS_OBJECTS'
        EXPORTING
          object_model = sfes_obj_activex
        IMPORTING
          return       = return
        EXCEPTIONS
          OTHERS       = 1.
      IF sy-subrc NE 0.
        RAISE error.
      ENDIF.

      IF return = 'X'.
        guitype = 1.
      ENDIF.
      IF guitype = 0.
        CALL FUNCTION 'GUI_HAS_OBJECTS'
          EXPORTING
            object_model = sfes_obj_javabeans
          IMPORTING
            return       = return
          EXCEPTIONS
            OTHERS       = 1.
        IF sy-subrc NE 0.
          RAISE error.
        ENDIF.

        IF return = 'X'.
          guitype = 2.
        ENDIF.
      ENDIF.

      CASE guitype.
        WHEN 1.
          clsid = 'Sapgui.InfoCtrl.1'.
        WHEN 2.
          clsid = 'com.sap.components.controls.sapImage.SapImage'.
      ENDCASE.
    ENDIF.

    CALL METHOD super-&amp;gt;constructor
      EXPORTING
        clsid      = clsid
        shellstyle = 0
        parent     = cl_gui_container=&amp;gt;default_screen
        autoalign  = space
      EXCEPTIONS
        OTHERS     = 1.
    IF sy-subrc NE 0.
      RAISE error.
    ENDIF.

    CALL METHOD cl_gui_cfw=&amp;gt;subscribe
      EXPORTING
        shellid = h_control-shellid
        ref     = me
      EXCEPTIONS
        OTHERS  = 1.
    IF sy-subrc NE 0.
      RAISE error.
    ENDIF.

* Register the events
    event_tab_line-eventid = lcl_gui_timer=&amp;gt;eventid_finished.
    APPEND event_tab_line TO event_tab.

    CALL METHOD set_registered_events
      EXPORTING
        events = event_tab.

  ENDMETHOD.                    "constructor

  METHOD cancel.

    CALL METHOD call_method
      EXPORTING
        method     = 'SetTimer'
        p_count    = 1
        p1         = -1
        queue_only = 'X'
      EXCEPTIONS
        OTHERS     = 1.
    IF sy-subrc NE 0.
      RAISE error.
    ENDIF.


  ENDMETHOD.                    "cancel

  METHOD run.

    CALL METHOD call_method
      EXPORTING
        method     = 'SetTimer'
        p_count    = 1
        p1         = interval
        queue_only = 'X'
      EXCEPTIONS
        OTHERS     = 1.
    IF sy-subrc NE 0.
      RAISE error.
    ENDIF.


  ENDMETHOD.                    "run

  METHOD dispatch .

    CASE eventid.
      WHEN eventid_finished.
        RAISE EVENT finished.
    ENDCASE.

  ENDMETHOD.                    "dispatch

ENDCLASS.                    "lcl_gui_timer IMPLEMENTATION

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that's what you are looking for. I got the idea from a project where they used it to auto refresh an ALV grid...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may also search this forum for keywords timer or autorefresh. It has been discussed here earlier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 09:37:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-a-press-key-event-without-batch-input/m-p/2801985#M654329</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-09-03T09:37:36Z</dc:date>
    </item>
  </channel>
</rss>

