Java SystemTray with timer event

I have just recently began working with the java system tray feature. In my application I have took the example from http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/systemtray/ for an example as to how this works.
My application also has a timer event that goes off every two seconds and checks for new messages. However if I open up the system tray popup menu, then the rest of the application hangs and waits for the pop up window to close. Is there any way to make the system tray so that the rest of the application does not freeze waiting for the menu to go away or a choice to be selected? I wold like the timer event to go off every 2 seconds, even if I have the system tray popup menu open.
Thanks for any help or suggestions.

Hmm. It's not that the Timer is stopped, it's that the TrayIcon displays the popup on the EDT and blocks actionPerformed -- which also has to run on the EDT -- till the popup is closed. Swing Timer by default coalesces multiple timer events when there's a backlog.
As the showing of the popup is handled by the native peer, it doesn't look like there'll be any solution with a Swing Timer. Your problem should be solvable with java.util.Timer and TimerTask.
Try this code, then uncomment the setCoalesce(false) and try it again. Note the difference.import java.awt.AWTException;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.MenuItem;
import java.awt.PopupMenu;
import java.awt.SystemTray;
import java.awt.TrayIcon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
public class TrayIconTest {
   public static void main(String[] args) {
      SwingUtilities.invokeLater(new Runnable() {
         @Override
         public void run() {
            new TrayIconTest().makeUI();
   public void makeUI() {
      PopupMenu popup = new PopupMenu();
      popup.add(new MenuItem("One"));
      popup.add(new MenuItem("Two"));
      TrayIcon trayIcon = new TrayIcon(getImage(), null, popup);
      try {
         SystemTray.getSystemTray().add(trayIcon);
      } catch (AWTException ex) {
         ex.printStackTrace();
      JFrame frame = new JFrame();
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.setSize(200, 200);
      frame.setLocationRelativeTo(null);
      frame.setVisible(true);
      javax.swing.Timer swingTimer = new javax.swing.Timer(1000, new ActionListener() {
         int count = 0;
         @Override
         public void actionPerformed(ActionEvent e) {
            System.out.println("Swing Count: " + count++);
      //swingTimer.setCoalesce(false);
      swingTimer.start();
      java.util.TimerTask timerTask = new java.util.TimerTask() {
         int count = 0;
         @Override
         public void run() {
            System.out.println("Util Count: " + count++);
      java.util.Timer utilTimer = new java.util.Timer();
      utilTimer.scheduleAtFixedRate(timerTask, 1200, 1000);
   private Image getImage() {
      BufferedImage image = new BufferedImage(16, 16,
            BufferedImage.TYPE_INT_ARGB);
      Graphics2D g2 = image.createGraphics();
      g2.setColor(Color.RED);
      g2.fillOval(1, 1, 14, 14);
      g2.setColor(Color.YELLOW);
      g2.fillOval(5, 5, 6, 6);
      return image;
}db

Similar Messages

  • Cannot Deploy JPD with Timer Event Subscription in WLI 9.2 MP1 cluster

    Has anyone had any luck deploying a JPD with a timer event subscription to a 9.2 MP1 WLI cluster? I am able to deploy Synchronous Client Request JPDs without any trouble but the ones that rely on internal WLI queues for invocation will not deploy in production. I am able to deploy the problematic JPDs to a non-clustered development environment without any issues but when I try to deploy the same artifact to a 9.2 MP1 cluster I see the following error:
    Throwable: java.security.PrivilegedActionException: java.security.PrivilegedActionException: java.security.PrivilegedActionException: javax.management.InstanceNotFoundException: tosipDomain_phase2:Name=cgJMSServer,Type=JMSServer
    Stack Trace:
    java.security.PrivilegedActionException: java.security.PrivilegedActionException: java.security.PrivilegedActionException: javax.management.InstanceNotFoundException: tosipDomain_phase2:Name=cgJMSServer,Type=JMSServer
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:373)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at com.bea.wli.knex.runtime.core.bean.EJBGenerator.deployWorkshopQueues(EJBGenerator.java:178)
         at com.bea.wli.knex.runtime.core.dispatcher.DispResources.deployQueues(DispResources.java:727)
         at com.bea.wli.knex.runtime.core.dispatcher.DispCache.ensureDispUnit(DispCache.java:667)
         at com.bea.wli.knex.runtime.core.dispatcher.DispCache.ensureDispUnitForURI(DispCache.java:1025)
         at com.bea.wli.knex.runtime.core.dispatcher.DispCache.ensureDispUnitForURI(DispCache.java:946)
         at com.bea.wli.management.adminhelper.AdminHelperBean.getDispFile(AdminHelperBean.java:348)
         at com.bea.wli.management.adminhelper.AdminHelperBean.getProcessMetadata(AdminHelperBean.java:94)
         at com.bea.wli.management.adminhelper.AdminHelperSSB_wivmoo_EOImpl.getProcessMetadata(AdminHelperSSB_wivmoo_EOImpl.java:70)
         at com.bea.wli.management.adminhelper.AdminHelperSSB_wivmoo_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:548)
         at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:438)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:434)
         at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:57)
         at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:965)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    I am suprised about this error, b/c we are running out of a vanilla WLI domain created with the Configuration Wizard and the error message has to do with an internal JMS server that we have left with the default configuration. Has anyone else had success with this?
    On a side note, I have to complain about the lack of 9.2 WLI documentation about deploying applications to production. The links on e-docs.bea.com actually redirect you to 8.5 documentation?!? I can't believe that this is the documentation we are left to use for 9.2 because there are so many changes between WLS 8 and 9.

    Hey buddies,
    I have a very similar error on WLI 9.2 MP2 on development mode with a cluster of managed servers on the same machine. I'm afraid that the automatic resource creation feature of dev mode is creating the error.
    The ...processes.UnlockService is jpd called by a JMS Broker thru a channel, and I considering it as the first suspect point.
    Any help is welcome.
    LOG CONTENT:
    <May 15, 2008 8:04:57 PM GMT-03:00> <Notice> <Stdout> <000000> <2008-05-15 20:04:57,575 [PERFO] localServer 10.10.10.10 xMDA  [iid=15899 prd=TC DATA act=INSTALL otp=I onb=00011552111 cid=12345189 mrt=]  END Designar_TCDATA OK>
    <May 15, 2008 8:04:57 PM GMT-03:00> <Error> <WLI> <000000> <Exception processing com.oi.integra.provisioning.lockManager.processes.UnlockService
    java.security.PrivilegedActionException: java.security.PrivilegedActionException: java.security.PrivilegedActionException: javax.management.InstanceNotFoundException: granite_wli_dev:Name=cgJMSServer,Type=JMSServer
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:373)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at com.bea.wli.knex.runtime.core.bean.EJBGenerator.deployWorkshopQueues(EJBGenerator.java:178)
         at com.bea.wli.knex.runtime.core.dispatcher.DispResources.deployQueues(DispResources.java:727)
         at com.bea.wli.knex.runtime.core.dispatcher.DispCache.ensureDispUnit(DispCache.java:671)
         Truncated. see log file for complete stacktrace
    java.security.PrivilegedActionException: java.security.PrivilegedActionException: javax.management.InstanceNotFoundException: granite_wli_dev:Name=cgJMSServer,Type=JMSServer
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:373)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at com.bea.wli.knex.runtime.core.bean.EJBGenerator.ensureQueue(EJBGenerator.java:442)
         at com.bea.wli.knex.runtime.core.bean.EJBGenerator.ensureWorkshopQueues(EJBGenerator.java:412)
         at com.bea.wli.knex.runtime.core.bean.EJBGenerator$3.run(EJBGenerator.java:194)
         Truncated. see log file for complete stacktrace
    java.security.PrivilegedActionException: javax.management.InstanceNotFoundException: granite_wli_dev:Name=cgJMSServer,Type=JMSServer
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:373)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at com.bea.wli.knex.runtime.core.bean.EJBGenerator.doesQueueExist(EJBGenerator.java:359)
         at com.bea.wli.knex.runtime.core.bean.EJBGenerator$6.run(EJBGenerator.java:449)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         Truncated. see log file for complete stacktrace
    javax.management.InstanceNotFoundException: granite_wli_dev:Name=cgJMSServer,Type=JMSServer
         at weblogic.management.mbeanservers.compatibility.internal.MBeanHomeImpl.getProxy(MBeanHomeImpl.java:68)
         at weblogic.management.mbeanservers.compatibility.internal.MBeanHomeImpl.getMBean(MBeanHomeImpl.java:88)
         at weblogic.management.mbeanservers.compatibility.internal.MBeanHomeImpl.getAdminMBean(MBeanHomeImpl.java:265)
         at com.bea.wli.knex.runtime.core.bean.WLSUtil.getWorkshopJMSServer(WLSUtil.java:713)
         at com.bea.wli.knex.runtime.core.bean.EJBGenerator$5.run(EJBGenerator.java:372)
         Truncated. see log file for complete stacktrace
    >
    java.security.PrivilegedActionException: java.security.PrivilegedActionException: java.security.PrivilegedActionException: javax.management.InstanceNotFoundException: granite_wli_dev:Name=cgJMSServer,Type=JMSServer
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:373)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)

  • LIssue with time events upload through RPTEUP10

    Dear experts,
    I am using the standard report RPTEUP10 for uploading time events in IT 2011. It works fine but in the log, it just indicates the number of records read, posted, placed in the error pool ...
    Can we by any chance know the PERNRs for which the upload failed? The FM HR_CC1_TIMEEVENT_INSERT directly takes table of time events as parameter.
    Will I have to put this FM inside a loop and pass a each entry for each PERNR separately, so that I could catch the failed PERNRs? or is there any standard solution to this?
    Please advice.
    Regards,
    Sumit Nene

    Hi,
    Actually we tried to upload the data manually through RPTEUP10 using txt file and also our client also want this for few locations.
    But we are unable to sort it out.
    I have gone through your document  and we adopted for automatic recording process as  my colleague confirmed it works excellent.
    But the problem is with manual uploading, the same is not showing in it 2011.
    any changes required in 2011 or 0050 before recording.
    it 0007, 1-1 is selected.
    please suggest some measure to achieve this.
    Regards,
    Sumana

  • How to validate overtime (IT2005) with time event (IT2011)

    dear gurus,
    how can i validate overtime, so only overtime that occurs within time event (IT2011) which can be paid ?
    example:
    work schedule: 08.00 - 17.00
    IT2011: 08.00 (P10 - clock in),  19.00 (P20 - clock out)
    IT2005: 17.00 - 20.00
    when run PT60, i want the system to calculate overtime from 17.00 - 19.00 (not 17.00 - 20.00).
    how can i configure the system?
    thank & regards,

    Hi
    There are multiple issues here ...
    i.Why are you maintaining both IT2005 and IT2011 at the same time.OT calculation can be done through IT2011 solely...
    ii.Anyway if you still want to write a rule yu can try as per the spec given below:
    1. Generate a custom Time Type say 9999
    2. Make a rule like OUTTPERTYP if P20 then SCOND=T IF otherwise SCOND=F IF.
    3. If SCOND=T IF then write a rule saying that HRS=PEND
    4.HRS-SWTE
    5.ADDDB9999
    6.ELSE SCOND=F IF VARSTP2005 (Entry exists if Y then check 9999..if 9999 is not ZERO then Kill the time types of P2005)
    7.Otherwise Pass On...do nothing..

  • Java Crash with windows event 1000

    I have windows 2003 installed on itanium 2 server. i installed java 1.4.2. Every time I restart it give me error in the event viewer application log. the error ID 1000 stated that "Faulting application java.exe, version 0.0.0.0, faulting module unknown, version 0.0.0.0, fault address 0x0000000001f40070.". when I try to type java -version it give me "Another exception has been detected while we were handling last error.
    Dumping information about last error:
    ERROR REPORT FILE = (N/A)
    PC = 0x0000000010020070
    SIGNAL = -1073741795
    FUNCTION NAME = (N/A)
    OFFSET = 0xFFFFFFFF
    LIBRARY NAME = (N/A)
    Please check ERROR REPORT FILE for further information, if there is any"
    Does anyone have solution?

    Hi,
    I have run into same crash, can anyone throw some light on this topic? Does JRE 1.4.2 depend the hardware model of the server?
    Regards,
    Raveendra

  • Isn't its possible to pass parameter with timer events

    helo every one,
    i have a array which i need to plot on the screen. the
    plotting should have some delay in between so that we can see the
    points being plotted. i tried using timer class but when the event
    occurs my loop index has always reached last element. any help...
    heres the code i used

    i have around 1000 data so the flash chrashes as i run your
    code.
    any suggestions to handel such case

  • (hr)problem with time-event upload

    hi friends, flowing codes like rpteup10 program. but we changed it. (december 2005) . but now there is problem not working . it is writing done but infotype 2011 from pa20 there is no change. maybe problem is fm HR_CC1_TIMEEVENT_INSERT. please help me.
    note sorry for my english.
    report rpteup10 no standard page heading.
    * Die Struktur der eingelesenen Saetze ist in der Feldleiste EXTREC
    * beschrieben.
    * Die Umsetzung der Saetze in die Struktur TIMEEVENT erfolgt in FORM
    * SET_EXTREC_TO_TIMEEVENT. Die Zuweisung erfolgt an die Feldleiste
    * timeevent.
    * The structure of the imported records is described in the internal
    * structure EXTREC.
    * The transport of the imported records into the structure TIMEEVENT
    * is done in FORM SET_EXTREC_TO_TIMEEVENT.
    tables: teven.
    data: begin of extrec occurs 0.
            include structure z1hrkk1teup.
    data: end of extrec.
    data: timeevent like cc1_timeevent occurs 0 with header line.
    data: last_timeevent like cc1_timeevent.
    data: skipped_timeevent like cc1_timeevent occurs 0 with header line.
    data: begin of stat occurs 1,
            ldate like teven-ldate,
            anzhl(4) type p value 1,
          end of stat.
    data: l_posted_timeevents   like sy-dbcnt,
          l_faulty_timeevents   like sy-dbcnt,
          l_locked_timeevents   like sy-dbcnt,
          l_total_timeevents    like sy-dbcnt,
          l_uploaded_timeevents like sy-dbcnt,
          l_skipped_timeevents  like sy-dbcnt.                  "P40K025970
    data: msg(100).
    * Syntax von MASKE siehe Doku FB WS_FILENAME_GET
    data: begin of maske,
            f01(30),
            '*.txt',
            f02(30),
          end of maske.
    selection-screen begin of block quelle with frame title text-src.
    * Pushbuttons for selection of source
    selection-screen begin of line.
    parameters:
      dataset like rptxxxxx-kr_feld1
        radiobutton group g001 default 'X'.
    selection-screen comment 03(30) text-010.
    parameters:
         file like rptaxxxx-rfile default '/usr/sap/up.tmp'.
    selection-screen end of line.
    selection-screen begin of line.
    parameters:
       workstn like rptxxxxx-kr_feld1
          radiobutton group g001.
    selection-screen comment 03(30) text-011.
    parameters:
         name like rlgrap-filename default 'A:UPLOAD.TXT'.
    selection-screen end of line.
    selection-screen end of block quelle.
    selection-screen begin of block frm1 with frame title text-par.
    parameters:
         upload like rptxxxxx-kr_feld1 default 'X',
         update like cc1par-x_verb default 'X',
         protokol like rptxxxxx-kr_feld2 default 'X'.
    selection-screen end of block frm1.
    *                      AT SELECTION-SCREEN                            *
    at selection-screen.
    *            AT SELECTION-SCREEN ON VALUE-REQUEST FOR ...             *
    at selection-screen on value-request for name.
      call function 'WS_FILENAME_GET'
           exporting
    *           DEF_FILENAME     = 'hallo'
                def_path         = 'C:'
                mask             = maske
    *           MODE             = 'O'
    *           TITLE            = ' '
           importing
                filename         = name
    *           RC               =
          exceptions
                inv_winsys       = 1
                no_batch         = 2
                selection_cancel = 3
                selection_error  = 4
                others           = 5.
    * end of -------------------------------------------------- "P30K108491
    initialization.
    start-of-selection.
      perform check_parameters.
      if not workstn is initial.
        call function 'WS_UPLOAD'
               exporting
                    filename            = name
                    filetype            = 'ASC'
               tables
                    data_tab            =  extrec
             exceptions
                  conversion_error    = 1
    *         FILE_OPEN_ERROR     = 2
                  file_read_error     = 3
                  invalid_table_width = 4
                  invalid_type        = 5
                  no_batch            = 6
                  unknown_error       = 7
                  others              = 8.
        if sy-subrc eq 2.
          write: / 'Fehlerhafter Pfadname'(013).
        endif.
      elseif not dataset is initial.
        open dataset file for input message msg.
        if sy-subrc ne 0.
          write: / msg.
          stop.
        endif.
        do.
          read dataset file into extrec.
          if sy-subrc ne 0. exit. endif.
          append extrec.
        enddo.
      else.
    * Nur zum Testen
        extrec-zausw = '10005301'.
        extrec-satza = 'P10'.
        extrec-ldate = sy-datum.
        extrec-ltime = '120000'.
    *    extrec-otype = 'S '.
    *    extrec-plans = '12345678'.
    *    extrec-usrup = 'VIELZWECKFELD'.
        append extrec.
        extrec-ltime = '140000'.
        extrec-satza = 'Z10'.
        append extrec.
      endif.
      loop at extrec.
        check not extrec is initial.
        perform set_extrec_to_timeevent.
        perform append_timeevent.
        perform fill_stat.
      endloop.
    *for double entry
      CLEAR SKIPPED_TIMEEVENT. REFRESH SKIPPED_TIMEEVENT.
      LOOP AT TIMEEVENT.
      SELECT SINGLE * FROM TEVEN WHERE PERNR = TIMEEVENT-PERNR AND
                                       LDATE = TIMEEVENT-LDATE AND
                                       LTIME = TIMEEVENT-LTIME AND
                                       SATZA = TIMEEVENT-SATZA AND
                                       STOKZ = ''.
      IF SY-SUBRC EQ 0.
        MOVE-CORRESPONDING TIMEEVENT TO SKIPPED_TIMEEVENT.
        APPEND SKIPPED_TIMEEVENT.
        DELETE TIMEEVENT.
      ENDIF.
      ENDLOOP.
      if protokol eq 'X'.
        perform show_timeevent.
        perform show_skipped_timeevent.
      endif.
      if upload eq 'X'.
        describe table timeevent lines sy-tfill.
        if not timeevent[] is initial.
          perform get_numbers.
          call function 'HR_CC1_TIMEEVENT_INSERT'
               tables
                    timeevent = timeevent
               exceptions
                    others    = 1.
          commit work.
          describe table timeevent lines l_uploaded_timeevents.
        endif.
      endif.
      if update eq 'X'.
        call function 'HR_CC1_TIMEEVENT_POST'
             importing
                  posted_timeevents  = l_posted_timeevents
                  faulty_timeevents  = l_faulty_timeevents
                  locked_timeevents  = l_locked_timeevents
                  skipped_timeevents = l_skipped_timeevents     "P40K026655
             exceptions
                  others            = 0.
    *       Zeitpunkt zur Steuerung der Batchverarbeitung setzen
    *   GET TIME.
    *   start_datum = sy-datum.
    *   start_uzeit = sy-uzeit + 10.
    *       Übergabe Steuerungsparameter an Task-handler -> BATCH !
    *   CALL FUNCTION 'START_OF_BACKGROUNDTASK'
    *        EXPORTING
    *             startdate = start_datum
    *             starttime = start_uzeit
    *        EXCEPTIONS
    *             others    = 1.
        commit work.
      endif.
    * PERFORM show_stat.
      perform show_verarbeitung.
    *=====================================================================*
    *    FORM SET_EXTREC_TO_TIMEEVENT                                     *
    *       Hier ist gegebenenfalls Sondercoding erforderlich.            *
    form set_extrec_to_timeevent.
    * Nutzdaten
      move-corresponding extrec to timeevent.
    *  move: extrec-otype to timeevent-pdc_otype,
    *        extrec-plans to timeevent-pdc_plans,
    *        extrec-usrup to timeevent-pdc_usrup.
    * technische Felder
      timeevent-indeu = 'I'.
    endform.
    *       FORM APPEND_timeevent.
    form append_timeevent.
    *  IF sorted EQ 'X'.
    ** Die Sätze sind nach Ausweisnummer gruppiert,
    ** performant: nur den letzten Satz vergleichen.
    *    IF timeevent-zausw EQ last_timeevent-zausw AND
    *       timeevent-ldate EQ last_timeevent-ldate AND
    *       timeevent-ltime EQ last_timeevent-ltime AND
    *       timeevent-erdat EQ last_timeevent-erdat AND
    *       timeevent-ertim EQ last_timeevent-ertim .
    *      DESCRIBE TABLE timeevent LINES sy-tfill.
    *      MODIFY timeevent INDEX sy-tfill.
    *      skipped_timeevent = last_timeevent.
    *      APPEND skipped_timeevent.
    *    ELSE.
    *      APPEND timeevent.
    *    ENDIF.
    *    last_timeevent = timeevent.
    *  ELSE.
    * Die Sätze sind nicht sortiert,
    * immer mit allen vorhandenen Sätzen vergleichen.
        read table timeevent into last_timeevent
                          with key  zausw = timeevent-zausw
                                    ldate = timeevent-ldate
                                    ltime = timeevent-ltime
                                    erdat = timeevent-erdat
                                    ertim = timeevent-ertim
                          binary search.
        if sy-subrc eq 0.
    * Früherer Eintrag wird protokolliert und überschrieben.
          modify timeevent index sy-tabix.
          skipped_timeevent = last_timeevent.
          append skipped_timeevent.
        else.
          insert timeevent index sy-tabix.
        endif.
    *  ENDIF.
    endform.
    *       FORM CHECK_PARAMETERS                                         *
    form check_parameters.
      if file eq space.
        write: / 'Bitte Namen für seq. Datenbestand angeben'(e01).
        stop.
      endif.
    endform.
    *       FORM FILL_STAT                                                *
    form fill_stat.
      read table stat with key timeevent-ldate binary search.
      if sy-subrc eq 0.
        add 1 to stat-anzhl.
        modify stat index sy-tabix.
      else.
        move timeevent-ldate to stat-ldate.
        move 1 to stat-anzhl.
        insert stat index sy-tabix.
      endif.
    endform.
    *       FORM SHOW_STAT                                                *
    form show_stat.
      skip 1.
      summary.
      format color col_background intensified.
      write:    'Statistik                     '(s06)
                color col_background intensified off.
      write: /(23)  sy-uline.
      format color col_heading.
      write: / sy-vline no-gap.
      write:  (10) 'Datum     '(s07) no-gap.
      write:   sy-vline no-gap.
      write:   (10) 'Sätze     '(s10) no-gap.
      write:   sy-vline.
      write: /(23) sy-uline.
      loop at stat.
        write: /  sy-vline no-gap.
        format color col_key.
        write:    stat-ldate no-gap.
        write:    sy-vline no-gap.
        format color col_normal.
        write: (10) stat-anzhl no-gap.
        write:    sy-vline no-gap.
      endloop.
      write: /(23) sy-uline.
    endform.
    *       FORM SHOW_VERARBEITUNG                                        *
    form show_verarbeitung.
      l_total_timeevents = l_posted_timeevents +
                           l_faulty_timeevents +
                           l_locked_timeevents.
      skip 1.
      summary.
      format color col_background intensified.
      write:    'Verarbeitung                  '(par)
                color col_background intensified off.
      write: /(78)  sy-uline.
      format color col_heading.
      write: / sy-vline no-gap.
      write:  (65) ' ' no-gap.
      write:   sy-vline no-gap.
      write:   (10) 'Sätze     '(s10) no-gap.
      write:   sy-vline.
      write: /(78) sy-uline.
      write: /  sy-vline no-gap.
      format color col_key.
      write: (65) 'in Schnittstelle gestellt'(v01) no-gap.
      write:    sy-vline no-gap.
      format color col_normal.
      write: (10) l_uploaded_timeevents no-gap.
      write:    sy-vline no-gap.
      write: /  sy-vline no-gap.
      format color col_key.
      write: (65) 'aus Schnittstelle gelesen'(v02)  no-gap.
      write:    sy-vline no-gap.
      format color col_normal.
      write: (10) l_total_timeevents no-gap.
      write:    sy-vline no-gap.
      write: /  sy-vline no-gap.
      format color col_key.
      write: (65) 'in Zeitwirtschaft verbucht'(v03)  no-gap.
      write:    sy-vline no-gap.
      format color col_normal.
      write: (10) l_posted_timeevents no-gap.
      write:    sy-vline no-gap.
      write: /  sy-vline no-gap.
      format color col_key.
      write: (65) 'in Fehlervorrat gestellt'(v04)    no-gap.
      write:    sy-vline no-gap.
      format color col_normal.
      write: (10) l_faulty_timeevents no-gap.
      write:    sy-vline no-gap.
      write: /  sy-vline no-gap.
      format color col_key.
      write: (65)
             'in Schnittstelle belassen, da Personalnummer gesperrt'(v05)
             no-gap.
      write:    sy-vline no-gap.
      format color col_normal.
      write: (10) l_locked_timeevents no-gap.
      write:    sy-vline no-gap.
      write: /  sy-vline no-gap.                                "P40K026655
      format color col_key.                                     "P40K026655
      write: (65) 'durch Zeitwirtschaft verworfen'(v06) no-gap. "P40K026655
      write:    sy-vline no-gap.                                "P40K026655
      format color col_normal.                                  "P40K026655
      write: (10) l_skipped_timeevents no-gap.                  "P40K026655
      write:    sy-vline no-gap.                                "P40K026655
      write: /(78) sy-uline.
    endform.
    *    FORM SHOW_timeevent                                              *
    form show_timeevent.
      summary.
      format color col_background intensified.
      write:    'Protokoll                     '(s08)
                color col_background intensified off.
      write: /(78) sy-uline.
      format color col_heading.
      write: / sy-vline no-gap.
      write: (10) 'PersNr.   '(001) no-gap.
      write:   sy-vline no-gap.
      write: (10) 'Zeitausw. '(002) no-gap.
      write:   sy-vline no-gap.
      write: (10) 'Datum     '(003) no-gap.
      write:   sy-vline no-gap.
      write: (10) 'Uhrzeit   '(004) no-gap.
      write:   sy-vline no-gap.
      write: (10) 'Satzart   '(005) no-gap.
      write:   sy-vline no-gap.
      write: (10) 'Terminal  '(006) no-gap.
      write:   sy-vline no-gap.
      write: (10) 'An/Abw    '(007) no-gap.
      write:   sy-vline no-gap.
      write: /(78) sy-uline.
      format color col_normal.
      loop at timeevent.
        write: / sy-vline no-gap.
        write: (10) timeevent-pernr no-zero no-gap,
                    sy-vline no-gap,
               (10) timeevent-zausw no-zero no-gap,
                    sy-vline no-gap,
               (10) timeevent-ldate no-gap,
                    sy-vline no-gap,
               (10) timeevent-ltime no-gap,
                    sy-vline no-gap,
               (10) timeevent-satza no-gap,
                    sy-vline no-gap,
               (10) timeevent-terid no-gap,
                    sy-vline no-gap,
               (10) timeevent-abwgr no-gap,
                    sy-vline no-gap.
      endloop.
      write: /(78) sy-uline.
    endform.
    *       FORM SHOW_SKIPPED_timeevent                                   *
    form show_skipped_timeevent.
      check not skipped_timeevent[] is initial.
      skip 1.
      summary.
      format color col_background intensified.
    * WRITE:    'Überschriebene Sätze'(s09)                     "P40K026655
      write:    'Überlesene doppelte Sätze'(s09)                "P40K026655
                color col_background intensified off.
      write: /(78) sy-uline.
      format color col_heading.
      write: / sy-vline no-gap.
      write: (10) 'PersNr.   '(001) no-gap.
      write:   sy-vline no-gap.
      write: (10) 'Zeitausw. '(002) no-gap.
      write:   sy-vline no-gap.
      write: (10) 'Datum     '(003) no-gap.
      write:   sy-vline no-gap.
      write: (10) 'Uhrzeit   '(004) no-gap.
      write:   sy-vline no-gap.
      write: (10) 'Satzart   '(005) no-gap.
      write:   sy-vline no-gap.
      write: (10) 'Terminal  '(006) no-gap.
      write:   sy-vline no-gap.
      write: (10) 'An/Abw    '(007) no-gap.
      write:   sy-vline no-gap.
      write: /(78) sy-uline.
      format color col_normal.
      loop at skipped_timeevent into timeevent.
        write: / sy-vline no-gap.
        write: (10) timeevent-pernr no-zero no-gap,
                    sy-vline no-gap,
               (10) timeevent-zausw no-zero no-gap,
                    sy-vline no-gap,
               (10) timeevent-ldate no-gap,
                    sy-vline no-gap,
               (10) timeevent-ltime no-gap,
                    sy-vline no-gap,
               (10) timeevent-satza no-gap,
                    sy-vline no-gap,
               (10) timeevent-terid no-gap,
                    sy-vline no-gap,
               (10) timeevent-abwgr no-gap,
                    sy-vline no-gap.
      endloop.
      write: /(78) sy-uline.
    endform.
    *       FORM GET_NUMBERS                                              *
    form get_numbers.
      data: retcd  like inri-returncode,
            quantity_wanted like inri-quantity,
            number          like pdsnr-pdsnr,
            object like inri-object      value 'PD_SEQ_NR',
            range  like inri-nrrangenr   value '01',
            quantity_get    like inri-quantity .
      describe table timeevent lines quantity_wanted.
      check quantity_wanted gt 0.
      call function 'NUMBER_GET_NEXT'
           exporting
                object                  = object
                nr_range_nr             = range
                quantity                = quantity_wanted
           importing
                returncode              = retcd
                number                  = number
                quantity                = quantity_get
           exceptions
                object_not_found        = 1
                interval_not_found      = 2
                number_range_not_intern = 3.
      case sy-subrc.
        when 0.
          case retcd.
            when 1.                        "kritischer Bereich
              message w093(53) with object number.
            when 2.                        "erschöpft
              message e094(53) with object number.
            when 3.                        "erschöpft
              message e094(53) with object number.
          endcase.
        when 1.                            "Objekt nicht angelegt
          message a090(53) with object.
        when 2.                            "Intervall nicht angelegt
          message a091(53) with object number.
        when 3.                            "Intervall nicht intern
          message a092(53) with object number.
      endcase.
      loop at timeevent.
        timeevent-pdsnr = number - quantity_wanted + sy-tabix.
        modify timeevent.
      endloop.
      commit work.
    endform.
    Message was edited by:
            Fatih AYDIN

    Hi Atish,
    ok you are right. I add new function to solve problem. its HR_TMW_DB_UPDATE_TEVENT.
    i am directly insert to teven with that fm.  but I want to solve why it is not working. it was working before and now its working now just some personel. i will become insane. what is problem?
    note my name is Fatih, not Faith.

  • Recording Additional Data on Time Event Types

    Our company is using the following time event types to record time data:P10 - In
    P15 - Break Start
    P02 - Lunch Start
    P25 - Lunch End
    P20 - Out
    We have only been able to associate a cost center to time event type
    P10, but have the need to associate it to P25 or identify a time event
    type not already in use that will accept a cost center to be associated
    to it. When we try to enter a cost center with time event tyep P25, the
    error message states "You can not use time event type P25 to record
    additional data."
    In our comapny, we have the need to round the in and out punches for
    each employee, but not round the other punches of the day. We can't use
    the first and last punch of the day to accomplish this because we have
    people who work split shifts. We also require a cost center to be
    associated with every punch that begins a productive time pair.
    Returning from lunch is the start of a productive time block, and is
    considered an "In" punch that shouldn't be rounded.
    I need to know if there is a way to configure the time event types to
    accept additional data or if there are any other time event types
    besides P10 that allow additional data to be recorded with them.

    Hi,
    Does the person entering the punch enters the cost center? How do you identify outside the SAP system before entering the data in SAP system what is the cost center related to the punch.
    Also Time events table or teven table cannot be enhanced.
    You could use CATS for hours recording related to a cost center.
    Regards,
    Divya

  • In firefox, the video from website "tv.vu.edu.pk" is not displaying even i have installed the latest version of JAVA. There rotates a circle around java monogram every time but video is not playing even it is working fine with internet explorer

    In firefox, the video from website "tv.vu.edu.pk" is not displaying even i have installed the latest version of JAVA. There rotates a circle around java monogram every time but video is not playing even it is working fine with internet explorer

    It's not working here as well with Java 6 U25 on Linux.

  • Time Evaluation with multiple time events

    Dear Friends,
    I have an issue in our current project. Kindly try to help me with a solution.
    We are working on Time Management module with Positive Time Recording method and evaluation- India. (Payroll module is not implemented)
    My issue is:
    Evaluation with multiple time events in a day: In our project, we have a scenario like the employees record multiple clock in and clock out times for one day and are uploaded into infotype 2011. But during time evaluation, only first Time event that is P10 (Clock In) and the last Time event P20 (Clock-out) in a day should be considered for evaluation, ignoring any multiple time entries in between duration in the table TEVEN (Infotype 2011).
    Pls let me know how this requirement can be met. Do we need to define any new PCR’s or create any functions? If yes, pls tell me the process in detail as I am new and implementing Time management (Positive Time recording with Evaluation) for first time. Try to help me as soon as possible.
    Thanks & Regards,
    Chiranjeevi
    Edited by: chiran reddy on Feb 15, 2008 2:20 PM

    is it not possible to enter only the first p10 and last p20 from the time systems into 2011.

  • Time event C019 integration with results recording

    Hi ,
          Posted this in the QM forum and got no response so reposting it here.  I am asking for a discrete manufacturing scenario. Does any one know how to integrate CO19 time event confirmation with the results recording transaction. Usually on the mfg floor the mfg people will do in process inspection. They are used to more of a clock in clock out way of working. They clock into the operation, they do the manufacturing activities and then they do the inspection activities. Once both are done they clock out and the material moves to the next operation. I knoe we can tie in manufacturing confirmation (CO11N) transaction with the results recording for inspection points. But I am looking to tie in the CO19  time event transaction to do the clock in clock out and tie it with the inspection point results recording transaction. The operators on the floor do not want to go to mutliple transactions to record thier time on that operation. Do you know how that can be done and if its even possible ?
    Also do we have to use inspection points or can we do it without inspection points ?.
    Thanks

    GS, Time events are always tied to a record group technically and this prohibits free/extended usage of the transaction compared to say CO11N.
        Explore further on the details provided in the sap help site which states,
    'You can only confirm quantities when you confirm processing time events.
    You can only confirm activities that cannot be assigned to a particular record type group (Set-up,processing, teardown) by using the time event ‘Variable activity’. The confirmed value is assigned to corresponding value in the standard value key parameters'..

  • Time events with errors

    Hi,
    Whether I can delete the entire error pool list?
    Since 2003, the post processing errors were still exists. These errors can be ignored. In the "Time Events with Errors: Postprocessing" screen, I have an option to delete a single batch process errors. I couldn't find an option to delete an entire pool list. ie,, to delete batch process from 2003 to 12/2007.
    Is there a way to do mass delete?
    Please share your experience with me. Thanks.
    Best Regards,
    Bala

    Hi,
    Actually I want to delete those errors, which was generated while POSTing time events.
    We have a clock interface, from there we poll a clock-in and out time for all employees and then this will be uploaded to SAP, then its posted to TIMEVENT. While Posting, if there is error, it stores in transp. table CC1ERH and CC1ERP. I need to delete these entries. Is there any standard report available to delete old records?
    Thanks and Regards,
    Bala

  • Timer event with parameter

    Hi guys,
    I implemented a BPM with 3 Times inputs and 3 timers. I need to set the TimeDate of the Timer Event with the three inputs. How can I do it? I tried with to create a DataObject with three Time attributes, before the Timer activities I assign the inputs to the data objects and in the Time Date I inserted the Expression with the data object attributes but it doesn't work!
    I tried also to insert three string as inputs (instead the Time) and then I insterted a trasformation before the Timer activities but it doesn't work too...
    Please help me!
    Thanks

    I solved inserting -'2h' in the Timer expression...So the question now is: Why the input DateTime has increased of 2 hours? I will open a topic...
    Thanks

  • My Ical events disappeared how do I restore with time machine/mountain lion?

    I recently installed mountain lion.    Today my ICal events disappeared and I can't restore them with time machine.   What happened?   How do I fix it?

    Did you try rebuilding the library's database file as follows:  make a temporary, backup copy of your library if you don't already have one (Control-click on the library and select Duplicate from the contextual menu) and  apply the two fixes below in order as needed:
    Fix #1
    Launch iPhoto with the Command+Option keys held down and rebuild the library.
    Since only one option can be run at a time start with Option #3, followed by #4 and then #1 as needed.
    Fix #2
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    1 - download iPhoto Library Manager and launch.
    2 - click on the Add Library button, navigate to your Home/Pictures folder and select your iPhoto Library folder.
    3 - Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File ➙ Rebuild Library menu option.
    4 - In the next  window name the new library and select the location you want it to be placed.
    5 - Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments.  However, books, calendars, cards and slideshows will be lost. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.

  • Can't create events with times between 10:01 and 19:59

    I've recently updated to OSX 10.4.9, and now can't create events with times that start with a '1'. This only seems to be a problem on the day British Summer Time begins on 25 March.
    I usually create my events in the month view, and input the start and end times by clicking in the time boxes and typing in the hours and minutes. However when I try to put in a start time of, say, 11:00, it puts in 21:00 instead. The only way around this seems to be to put in a time it will accept, like 09:00, and using the arrow keys to move it to the time I want. Or creating the events in the day view and clicking on the start time there.
    Any ideas?

    Looks like you have found a wee bug. I can replicate it. You could report it though OS X Feedback or better though ADC, but for the latter you have to register first.
    I usually create events by double-clicking in week view; often this gets the start time right, but if not then edit the start time in the info pane. Your bug is there with events created in day and week views too.
    AK

Maybe you are looking for