Differnence between two codes of event handling

hello i am learning event handling in swing but confused between two codes :-
the first code of event handling is given in book "head first java " and working fine
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Swingdemo implements ActionListener {
    JButton jbut = new JButton("Click me");
      public void go(){
        JFrame jfrm = new JFrame(" sample swing");
        JLabel jlab = new JLabel("hello Swing");
        jfrm.add(BorderLayout.NORTH,jlab);
        jfrm.add(BorderLayout.CENTER,jbut);
        jfrm.setVisible(true);
        jbut.addActionListener(this); 
        jfrm.setSize(100,100);
        jfrm.setDefaultCloseOperation(jfrm.EXIT_ON_CLOSE);
   public static void main(String[] args) {
        Swingdemo obj = new Swingdemo();
        obj.go();
public void actionPerformed(ActionEvent e)
    jbut.setText("i have been clicked");
}}THe second code which i think is fine is giving the following error :-
C:\java\iodemo\src\Swingdemo.java:26: non-static variable jbut cannot be referenced from a static context
        jfrm.add(BorderLayout.CENTER,jbut);
C:\java\iodemo\src\Swingdemo.java:28: non-static variable this cannot be referenced from a static context
        jbut.addActionListener(this); 
C:\java\iodemo\src\Swingdemo.java:28: non-static variable jbut cannot be referenced from a static context
        jbut.addActionListener(this);  the second code is as follows :-
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Swingdemo implements ActionListener {
public static void main(String[] args) {
JFrame jfrm = new JFrame(" sample swing");
JLabel jlab = new JLabel("hello Swing");
jfrm.add(BorderLayout.NORTH,jlab);
jfrm.add(BorderLayout.CENTER,jbut);
jfrm.setVisible(true);
jbut.addActionListener(this);
jfrm.setSize(100,100);
jfrm.setDefaultCloseOperation(jfrm.EXIT_ON_CLOSE);
JButton jbut = new JButton("Click me");
public void actionPerformed(ActionEvent e)
jbut.setText("i have been clicked");
Plz help me wat this error means that not static variable cannot be reffered from static context .
thanks

There are multiple problems in your 2nd set of code. You call this:
jfrm.add(BorderLayout.CENTER,jbut);
Before you actually create the jbut button:
JButton jbut = new JButton("Click me");
But based on the error message, you have another 'jbut' variable somewhere that's not included in the code you posted, and that's the one it's complaining about being referenced in a static context.
The problem with the static context is because all your code is in the static void main method. In that method, a Swingdemo instance doesn't exist yet, therefore any non-static variables won't exist yet either. If you move all that code into the Swingdemo constructor, and just have main create a new Swingdemo instance, that should do it.

Similar Messages

  • Can't see any difference between two code examples

    Hi,
    I wonder, what is the difference between these two code examples?
    In my eyes they do the same thing, or?
    protected void processWindowEvent(WindowEvent e) {
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
    dispose();
    super.processWindowEvent(e);
    public void actionPerformed(ActionEvent e) {
    if (e.getSource() == button1) {
    dispose();
    /A

    Where did you learn Swedish? You wrote it right but this sentence: "Mig sj�lv, jag kommer fr�n....." is not quite right. You have to write it like this: "Sj�lv s� kommer jag fr�n ...." or "Jag kommer fr�n....".
    When I wrote "or" before, I meant or like in "right or wrong" not like in "eller hur".
    I'm born in Poland but i moved to Sweden when I was 6,5 years old.
    I have one more question about the window-closing-thing:
    In an other file it looks like this:
    private class SymWindow extends java.awt.event.WindowAdapter
              public SymWindow(){}
                        public void windowClosing(java.awt.event.WindowEvent event)
    jMenuFileExit_actionPerformed();
    ////////this comes after that one above//////////
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING){
    jMenuFileExit_actionPerformed();
    In this file you can choose to exit the program by choosing exit from a menu or just click in the upper right corner (the cross). If you have a file open, don't save it and want to exit, a message will appear with a question if you want to save. This worked fine from the beginning but to this message I added a cancel button (before it was only yes and no). This didn't work. I took away the second code example and and added this: "setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE)" to the first one and everything works fine. The three buttons work if I choose exit from the menu or if I click the cross. Is it right?
    By the way, thanks for your help
    /A

  • Code driven event handling in a while loop

    I have an event driven while loop. Is there any way to trigger an event by code and not by any user action? Sometimes I need to execute the while loop once but I don't like to use the timeout event because it causes some trouble in my timecritical application.
    Thank you in advance,
    Andreas Langer

    Andreas,
    The following page has an example on how to accomplish this:
    Generating an Event in LabVIEW Programmatically
    http://zone.ni.com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/c0128a70970d0a0386256b48008366be?OpenDocument
    Zvezdana S.
    National Instruments

  • Event handling in Dynpage

    Hi all,
    This is my first post in SDN.
    Can any one tell me how to submit a form in DYNPAGE via radio button. If I check the radio button on, it should submit the form and should return the same page.
    Appreciate you help.
    Thanks,
    Karthik

    Hi,
    The following code regarding Event Handling for Dynpage. May be this example code useful for you.
    package com.customer.training;
    import com.sapportals.htmlb.Button;
    import com.sapportals.htmlb.Component;
    import com.sapportals.htmlb.DropdownListBox;
    import com.sapportals.htmlb.Form;
    import com.sapportals.htmlb.FormLayout;
    import com.sapportals.htmlb.GridLayout;
    import com.sapportals.htmlb.InputField;
    import com.sapportals.htmlb.Label;
    import com.sapportals.htmlb.TextView;
    import com.sapportals.htmlb.enum.ButtonDesign;
    import com.sapportals.htmlb.enum.TextViewDesign;
    import com.sapportals.htmlb.event.Event;
    import com.sapportals.htmlb.page.DynPage;
    import com.sapportals.htmlb.page.PageException;
    import com.sapportals.htmlb.rendering.IPageContext;
    import com.sapportals.portal.htmlb.page.PageProcessorComponent;
    public class Suresh_SearchDynPage extends PageProcessorComponent {
      public DynPage getPage() {
        return new Suresh_SearchDynPageDynPage();
      public static class Suresh_SearchDynPageDynPage extends DynPage {
         public int flag ;
         public final static int disp_info = 1;
         public final static int read_info = 2;
         public final static int error_info = 3;
         public static String flag_info = "MyFlag";
         public static String disp_drop = " ";
         public String errorMessage;
           String firstName ;
           String lastName ;
           String Email ;
           String dropsel;
    Initialization code executed once per user.
        public void doInitialization() {
                        flag = read_info;          
                        IPageContext ctx = this.getPageContext();
                        ctx.setAttribute("FirstName","");
                        ctx.setAttribute("LastName","");
                        ctx.setAttribute("email","");     
    Input handling code. In general called the first time with the second page request from the user.
        public void doProcessAfterInput() throws PageException {
              Component comp;
              comp = this.getComponentByName("FirstName");
              if (comp instanceof InputField)
                        firstName = ((InputField) comp).getString().getValue();
              comp = this.getComponentByName("LastName");
              if (comp instanceof InputField)
                                  lastName = ((InputField) comp).getString().getValue();
              comp = this.getComponentByName("email");
                        if (comp instanceof InputField)
                                            Email = ((InputField) comp).getString().getValue();
              comp = this.getComponentByName("DisplayType");
                        if (comp instanceof DropdownListBox)
                             dropsel = ((DropdownListBox) comp).getSelection();          
    // Store the selected values in corresponding field name for nextScreen                         
              IPageContext ctx = this.getPageContext();
              flag = new Integer(ctx.getAttribute(flag_info).toString()).intValue();
              ctx.setAttribute("FirstName",firstName);
              ctx.setAttribute("LastName",lastName);
              ctx.setAttribute("email",Email);
              ctx.setAttribute("DisplayName",dropsel);                                   
    Create output. Called once per request.
        public void doProcessBeforeOutput() throws PageException {
          Form myForm = this.getForm();
           this.getPageContext().setAttribute(flag_info,new Integer(flag));
         switch(flag)
          case read_info:
                    FormLayout f1 = new FormLayout();
                    TextView t1 = new TextView();
                    t1.setDesign(TextViewDesign.HEADER2);
                    t1.setText("This is the Info U Entered................");
                    TextView t2 = new TextView();
                    t2.setText(firstName);
                    Label dispFname = new Label("dispFirstName");
                    dispFname.setText("First Name");
                    dispFname.setLabelFor(t2);
                    TextView t3 = new TextView();
                    t3.setText(lastName);
                    Label dispLname = new Label("dispLastName");
                    dispLname.setText("Last Name");
                    dispLname.setLabelFor(t3);
                    TextView t4 = new TextView();
                    t4.setText(Email);
                    Label dispEmail = new Label("dispEmail");
                    dispEmail.setText("Email");
                    dispEmail.setLabelFor(t4);
                    TextView t5 = new TextView();
                    t5.setText(dropsel);
                    Label dispType = new Label("dispInfo");
                    dispType.setText("Display Info");
                    dispType.setLabelFor(t5);
                    Button btnback = new Button("Back");
                    btnback.setText("Back");
                    btnback.setOnClick("Back");
                    f1.addComponent(1,1,t1);
                    f1.addComponent(2,1,dispFname);
                    f1.addComponent(2,2,t2);
                    f1.addComponent(3,1,dispLname);
                    f1.addComponent(3,2,t3);
                    f1.addComponent(4,1,dispEmail);
                    f1.addComponent(4,2,t4);
                    f1.addComponent(5,1,dispType);
                    f1.addComponent(5,2,t5);
                    f1.addComponent(6,1,btnback);
                    myForm.addComponent(f1);
               break;
          case error_info:
                    FormLayout f2 = new FormLayout();
                    IPageContext ctx = this.getPageContext();
                    TextView t6 = new TextView();
                    t6.setText("Error : ");
                    t6.setDesign(TextViewDesign.HEADER2);
                    t6.setText(errorMessage);
                    f2.addComponent(3,1,t6);
                    myForm.addComponent(f2);
               break;
                default:
                              // create your GUI here....
                                        GridLayout g1 = new GridLayout();
    //                                    IPageContext ctx1 = this.getPageContext();
                                        Label first_l = new Label("First Name");
                                        InputField first_if = new InputField("FirstName");
                                        Label last_l  =  new Label("Last Name");
                                        InputField last_if = new InputField("LastName");
                                        Label email_l = new Label("E-Mail Address");
                                        InputField email_if = new InputField("email");
                                        Label info_l = new Label("Display Info for");
                                        DropdownListBox displayType = new DropdownListBox("DisplayType");
                                        displayType.addItem("userinfo", "User Info");
                                        displayType.addItem("groupinfo", "Group Membership");
                                        displayType.addItem("roleinfo", "Role Assignment");     
    //                                    displayType.setSelection(ctx1.getAttribute("DisplayType").toString());
                                        Button btn = new Button("submit");            
                                        btn.setText("Get Info");
                                        btn.setDesign(ButtonDesign.EMPHASIZED);
                                        btn.setOnClick("Get");
    //                                    add the ui controls to grid
                                        g1.setCellPadding(4);
                                        g1.addComponent(1,1,first_l);
                                        g1.addComponent(1,2,first_if);
                                        g1.addComponent(2,1,last_l);
                                        g1.addComponent(2,2,last_if);
                                        g1.addComponent(3,1,email_l);
                                        g1.addComponent(3,2,email_if);
                                        g1.addComponent(4,1,info_l);
                                        g1.addComponent(4,2,displayType);
                                        g1.addColSpanComponent(5,1,btn,2);
                                        g1.setHeightPercentage(50);
                                        g1.setColumnSize(50);
                                        myForm.setFocusedControl(displayType);
                                        myForm.setMessageBarAtFormEnd(true);
                                        myForm.setWidthInHundredPercent(true);
                                        myForm.addComponent(g1);     
                                        break;
        public void onGet(Event e)
         if(firstName.length()== 0)
              flag = error_info;
              errorMessage = "Invalid Input..............";
         else
              flag = read_info;
          public void onBack(Event e1)
                flag = disp_info;

  • Event Handling in labview with arrays as event data

    Hey folks,
    I have a Labview Application which uses a dll to read Ethernet data. The setup is such that, when the dll has fresh data it sends out an event to the Labview Application so that the fresh data can be displayed.
    However i have only managed to get this event based mechanism to send out a single structure at a time. Hence if there are 10 fresh data values, i need to send out 10 events (each event structure contains the parameter name, parameter value, unit and time stamp). It would be more efficient to send out an array of structures in a sigle shot.
    I have tried this but Labview keeps crashing saying that an error was encountered and Labview needs to close along with an access violation message. I did a lot of online searching and found some LV code for event handling but not come accross any implementation which uses arrays as evend data. Is this supoorted? And if so is there any example vi that can be shared so that i get some knowledge about this.
    Many Thanks in adavance,
    Abel. 

    I also gave a try by using a variant as the event data type instead of the cluster which contains the array of floats. I converted the cluster into a variant and used that to create the user event reference. Followed the same logic while decoding the dats.
    But still the crash.... Here is the windbg output...
    ModLoad: 07580000 075b7000 C:\Program Files\National Instruments\LabVIEW 2012\resource\lvalarms.dll
    ModLoad: 0ca90000 0cb72000 C:\Program Files\National Instruments\LabVIEW 2012\resource\mesa.dll
    ModLoad: 0c7f0000 0c7f9000 C:\Program Files\National Instruments\LabVIEW 2012\resource\lvuste.dll
    ModLoad: 35000000 3509b000 C:\Program Files\National Instruments\Shared\TDMS\tdms.dll
    ModLoad: 0c860000 0c87c000 D:\SapphireViewer\dll\SapphireClientDll.dll
    ModLoad: 0e240000 0e2c7000 C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262b86\MSVCP80.dll
    ModLoad: 0e2d0000 0e36b000 C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262b86\MSVCR80.dll
    (1cb0.1a34): Access violation - code c0000005 (first chance)
    First chance exceptions are reported before any exception handling.
    This exception may be expected and handled.
    eax=0e47f8b4 ebx=051f0040 ecx=051f0040 edx=061e5764 esi=22820840 edi=07b10040
    eip=03c2050c esp=0e47f5cc ebp=0e47f810 iopl=0 nv up ei pl nz na po nc
    cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010202
    *** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Program Files\National Instruments\LabVIEW 2012\resource\tdcore_12_0.dll -
    tdcore_12_0!LvVariant:etContents+0xac:
    03c2050c 837e3100 cmp dword ptr [esi+31h],0 ds:0023:22820871=????????
    I cannot really tell whats going on. Looking for some pointers.
    Regards,
    Abel.

  • OIM 10g Event Handler : Integrated with User Groups.User Members

    I have created custom event handler and integrated it with User Groups.User Members data object.
    here is my code od event handler class:
    public class GroupEventHandler extends tcBaseEvent {
         public GroupEventHandler() {
              this.setEventName("Event Handler Sample");
         protected void implementation() throws Exception {
              System.out.println("============@@@@@@@@ IN EVENT HANDLER ");
              try
              String groupKey = this.getDataObject().getString("Groups.Key");
              writeToFile(groupKey);
              catch (Exception e)
                   e.printStackTrace();
    But I am getting this exception :
    ERROR [ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)' XELLERATE.SERVER - Class/Method: tcTableDataObj/getString encounter some problems: Column 'GROUPS.KEY' not found
    com.thortech.xl.dataaccess.tcDataSetException: Column 'GROUPS.KEY' not found
         at com.thortech.xl.dataaccess.tcDataSet.getColumnIndex(Unknown Source)
         at com.thortech.xl.dataaccess.tcDataSet.getString(Unknown Source)
         at com.thortech.xl.dataobj.tcTableDataObj.getString(Unknown Source)
         at oim.GroupEventHandler.implementation(GroupEventHandler.java:19)
         at com.thortech.xl.client.events.tcBaseEvent.run(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.runEvent(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.eventPostInsert(Unknown Source)
         at com.thortech.xl.dataobj.tcUSG.eventPostInsert(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.insert(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
         at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
         at com.thortech.xl.ejb.beansimpl.tcGroupOperationsBean.addMemberUsers(Unknown Source)
         at com.thortech.xl.ejb.beans.tcGroupOperationsSession.addMemberUsers(Unknown Source)
         at com.thortech.xl.ejb.beans.tcGroupOperations_ejm77u_EOImpl.addMemberUsers(tcGroupOperations_ejm77u_EOImpl.java:1671)
         at Thor.API.Operations.tcGroupOperationsClient.addMemberUsers(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at Thor.API.Base.SecurityInvocationHandler$1.run(Unknown Source)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.security.Security.runAs(Security.java:41)
         at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(Unknown Source)
         at Thor.API.Base.SecurityInvocationHandler.invoke(Unknown Source)
         at $Proxy66.addMemberUsers(Unknown Source)
         at com.thortech.xl.webclient.actions.UserGroupMembersAction.assignMemberUsers(Unknown Source)
         at com.thortech.xl.webclient.actions.UserGroupMembersAction.assignGroupMembers(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
         at com.thortech.xl.webclient.actions.tcLookupDispatchAction.execute(Unknown Source)
         at com.thortech.xl.webclient.actions.tcActionBase.execute(Unknown Source)
         at com.thortech.xl.webclient.actions.tcAction.execute(Unknown Source)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at com.thortech.xl.webclient.security.SecurityFilter.doFilter(Unknown Source)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)

    Anyone have idea about why "Groups.Key" not found exception thrown here..
    I have assigned this event handler at postinsert event of User Groups.User Members Data Object.

  • Java 1 vs. Java 2 Event Handling

    Prelude: This question relates to writing code for event handling.
    Java 1 is based on a hierarchy model to handle events, ie. inheritance from superclasses. Java 2 uses delagation event handling method. Java 2 code will not compile if it includes Java 1 code still modeled according to Java 1 event handling.
    Question:
    Is it generally easier to start completely over in trying to convert Java 1 code into Java 2 code by not retaining any Java 1 code and begin reconceptualizing what is needed for a conversion to Java 2?

    From what I understand java2 should support both models, however not both at the same time, you cant mix the modles...
    I also think that the older models methods or at least most have been depreciated, meaning that the old model will, if it hasnt allready in the latest release, dissapear.. For that single reason I would recommend updating the event model to the delegation model if you hope to keep it around and running for years to come. You gain a bit by doing this since the newer model is much faster!!!

  • How to handle events between two custom components?

    Hi ,
         i want to handle events between two custom components, example if an event is generated in one custom component ,and i want to handle it any where in the application.....can any one suggest me any tutorial or meterial in this concept...
    thanks

    Events don't really go sideways in ActionScript by default. They bubble upward. If you want to send an event sideways, you will probably have to coordinate with something higher up in the event hierarchy. You can send the event to a common ancestor, and then pass it down the hierarchy as a method argument.
    Another option is to use a framework that supports Injection. There are a number around these days. The one I'm most familiar with is Mate, which allows you to handle events and inject data in MXML. Mate is meant to be used as an MVC framework, and you may want to look into it if your application is complex, but you can also use it to coordinate global event handling if you don't need that level of structure.

  • Two event handler

    I am using two event handler
        CLASS-METHODS:
            handle_data_changed_finished
                FOR EVENT data_changed_finished OF cl_gui_alv_grid
                    IMPORTING e_modified
                              et_good_cells.
        CLASS-METHODS: catch_doubleclick
               FOR EVENT double_click OF cl_gui_alv_grid
               IMPORTING e_column   es_row_no sender.
    And after I call them like that 
        SET HANDLER ci_events_grid->handle_data_changed_finished
                FOR ci_grid .
        CALL METHOD ci_grid->register_edit_event
          EXPORTING
            i_event_id = cl_gui_alv_grid=>mc_evt_enter.
       SET HANDLER ci_events_grid->catch_doubleclick FOR ci_grid.
    There is a problem that when the changes finish on grid , it can handels handle_data_changed_finished
    truely but when the user double click it couldnt gets true row id .
    But when I do not use handle_data_changed_finished method there wasnt problem occurs ,
    How can I use two methods together ?

    No I dont catch with user-command
    Please below the code method implementations.
          CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_data_changed_finished.
        PERFORM data_changed_finished TABLES et_good_cells.
    ENDMETHOD.                    "HANDLE_DATA_CHANGED_FINISHED
      METHOD catch_doubleclick .
        IF e_column-fieldname NE 'REASON_ICON'.
          EXIT.
        ENDIF.
        READ TABLE gt_itab  INDEX es_row_no-row_id INTO gt_ch_itab.
        CASE e_column.
          WHEN 'REASON_ICON'.
            IF gt_ch_itab-changed = 'X'.
              CALL SCREEN 200 STARTING AT 40 8
                            ENDING AT 80 20.
            ENDIF.
        ENDCASE.
      ENDMETHOD.                    "handle_double_click
    ENDCLASS.                    "LCL_EVENT_RECEIVER IMPLEMENTATION
    FORM data_changed_finished  TABLES et_good_cells STRUCTURE lvc_s_modi.
      DATA ls_good_cells TYPE lvc_s_modi.
      LOOP AT et_good_cells INTO ls_good_cells.
        AT NEW row_id.
          READ TABLE gt_itab INDEX ls_good_cells-row_id.
          IF sy-subrc = 0.
            IF gt_itab-pwmt1   NE gt_itab-old_pwmt1 OR
               gt_itab-pwtt1   NE gt_itab-old_pwtt1 OR
               gt_itab-dlvcnt  NE gt_itab-old_dlvcnt.
              gt_itab-changed        = 'X'.
              gt_itab-status         = icon_led_yellow.
             gt_itab-reason_icon    = icon_system_help.
            ELSE.
              CLEAR : gt_itab-changed,gt_itab-status.
            ENDIF.
            MODIFY gt_itab INDEX ls_good_cells-row_id.
          ENDIF.
        ENDAT.
      ENDLOOP.
      CALL METHOD ci_grid->refresh_table_display
        EXPORTING
          i_soft_refresh = 'X'.
    ENDFORM.                    " data_changed_finished

  • Convert onEnterFrame Event Handler  AS2 code into AS3

    My code of AS2 is given below. I do not know what event handler type is used and which event handler is used in AS3.
    onEnterFrame = function(){

    this.addEventListener(Event.ENTER_FRAME,onEf);
    // "this" references the movie itself, you can also use "stage" or the instance name of an object on the stage
    // look up addEventListener in the online help. This method takes two arguments, the event that you want to "listen" for and the name of the function to execute when the event occurs.
    // the function that will be called when the event occurs. It takes one argument that corresponds with the first argument of the addEventListener method.
    function onEf(event:Event):void {

  • Is there a way to dispatch or bubble events between two pop-up windows?

    Hi. I was wondering if there is a way to dispatch custom
    events between two or more pop-up windows created using the
    PopUpManager?
    I understand how to pass an event from one pop-up window to
    the main application (or FrontController) by dispatching the event
    from Application.application under Cairngorm 2.0.
    However, as I understand it, that will only bubble the event
    through the Application chain of visual controls and not to the
    other pop-up windows created using the PopUpManager.
    I tried dispatching the event directly from the pop-up window
    itself, but the other pop-ups still does not seem to receive the
    event.
    It would be nice to be able to do this so that each non-modal
    pop-up can have some awareness with each other.
    Thank you very much in advance.

    If you have just 2 pop-ups you can have them each do a
    addEventListener on the other, listening for the event (custom or
    otherwise).
    If you have an unpredicatable number, then you devise
    something else. Suppose you have 3 pop-ups, p1, p2, and p3. Let's
    say you also have 1 custom event, E1. Any of those pop-ups is
    capable of dispatching an E1 event and you want all of them to
    receive it.
    Create a class that extends EventDispatcher and instantiate
    an object of that class. Each pop-up "registers" with that class,
    something like:
    controller.addEventListener( "E1", handler ); where handler
    is a function in the pop-up.
    When a pop-up wants to dispatch an E1 event, it does it
    through the controller: controller.dispatchEvent( new E1(data) );
    This will automatically dispatch that event to all the
    pop-ups, including the one that dispatched the event. So a pop-up
    will have to examine the event to see if it sent it and perhaps
    ignore it.

  • Billing in Stock Transfer between two plants of two different company codes

    Hi Friends,
    I am doing the scenario of stock transfer between two plants of different  company codes.
    I have some issues in Billing for this..
    What are the settings do i need to to for Pricing in SD point of view.
    Ex:
    Supplying         /         Receiving
    Com.Code:2000     /        CompanyCode:1000
    Plant:2100              /         Plant:1100
    SA:2000/10/00      /          SA:1000/10/00
    I created Customer 5555 w.r.t sales area of supplying company code (2000/10/00)
    I created Vendor  7777 and assigned Supplying Plant 2100 in add purchasing data.
    In IMG Settings:
    Define Shipping Data for Plants: In Receving Plant i assigned customer 5555 and sales area blank
                                                        In Supplying Plant i assigned customer blank and sales area as 2000/10/00
    Create Checking Rule: Standard(B SD Delivery)
    Define Checking Rule: Standard(Avallability-01assigned to checking rule B)
    Assign Delivery Type and Checking rule: Document type(NB)-Supplying Plant(2100)-Delivery Type(NLCC)-Checking Rule-(B)
    Assign Doc Type:Supplying Plant(2100)-Receving Plant(1100)-Doc type(NB)
    What are Pricing settings in SD i have to do?????????
    Process:
    ME21N->VL10B->VL02N(PGI)->VF01(IV)->MIGO->MIRO
    I have gone through many threads in Forum but confusion in Pricing Part..
    Some are mixing with the inter company sales proces..
    Pls guide me..
    With Regards

    Do the following steps for STO Customizing:-
    1. Create a customer master record for the issuing plant.
    2. Create a vendor master record for the issuing plant, and enter customer account number in the Customer field on the Control screen.
    3. Repeat steps 1 and 2 for the receiving plant.
    4. Assign the plants to the customer master record in Customizing for Materials Management (MM), by choosing Purchasing <Purchase Order < Set Up Stock Transport Order< Plants.
    The Process Flow would be as follows :-
    Create a stock transport order, following the standard procedure, and send the order to the issuing plant.
    Issuing plant has processes your order, and when it is ready to ship,the storeperson at the issuing plant issues the goods using a transfer posting. The excise clerk there creates an excise invoice.The excise supervisor verifies and posts the excise invoice.It then sends the goods to you, together with the excise invoice.
    Once the goods arrive, you follow the standard procedure for incoming excise invoices:
    The excise clerk captures the excise invoice, using the stock transport order as the reference document. The storeperson enters the goods receipt, again using the stock transport order as the reference document.Alternatively, you can first enter the goods receipt and then capture the excise invoice.
    The excise supervisor then posts the excise invoice.
    Best Regards,
    Ankur

  • Error while running code template mapping between two oracle tables

    Hello All
    Iam getting the following error while running code template mapping between two oracle tables. Using OWB 11gR2 and oracle 11gR2 DB.
    java.sql.SQLException: ORA-20001: The active workspace is not valid as a target for this mapping
    c: at "OWBSYS.WB_RT_MAPAUDIT_UTIL", line 1065
    ORA-06512: at "OWBSYS.WB_RT_MAPAUDIT_UTIL", line 1087
    ORA-06512: at "SOURCE.FILENET_EX_UNIT_3", line 555
    ORA-06512: at line 4                                        
    Job 51 error: java.sql.SQLException: ORA-20001: The active workspace is not valid as a target for this mapping
    ORA-06512: at "OWBSYS.WB_RT_MAPAUDIT_UTIL", line 1065
    ORA-06512: at "OWBSYS.WB_RT_MAPAUDIT_UTIL", line 1087
    ORA-06512: at "SOURCE.FILENET_EX_UNIT_3", line 555
    ORA-06512: at line 4
    Quick help is highly appreciated.

    Dera Dallan
    its only a target user for the workspace where you are deploying the mapping from.
    I have two repositories for two different projects. each repositary has its own workspace.
    ex:-
    Project 1
    Work space bpms_rep_owner
    Repositary owner bpms_rep_owner
    Repositary user bpms_rep_user
    Project 2
    Work space dem_rep_owner
    Repositary owner dem_rep_owner
    Repositary user dem_rep_user
    Reg
    S.Gyazuddin

  • Stock Transport Order between Two Company codes

    Dear All
    Scenario-- Stock transport order Between two company codes.
    The valuation of Comapny Codes is at Moving Average Price.
    I have a scenario
    MAP of Issuing Plant-- Rs. 10 / kg
    I am able to pick up the price of Rs.10 (MAP) of issuing plant while creating PO.
    in receving plant.
    At the time of Goods issu the MAP has changed & become Rs.12/kg. Hence the goods issue takes place at Rs.12/- perkg.
    When we make GR at receiving plant ,the valuation of GR is at Rs.10 i.e at PO price.
    Is it possible to have a GR valuation at Goods issue price for that delivery note?
    Request Your feedback urgently.

    The invoice has the material costs at time of goods issue.
    You receipt is valuated to PO price. But when you post the invoice, then the MAP is adjusted,
    By setting up EDI, SAP will probably post the invoice before the goods receipt is done, hence the GR should be valuated with the invoice price.
    from Note 518368 - FAQ: Valuation for the purchase order;
    With which price is the goods receipt posted for a purchase order?
    Answer:
    If the goods receipt is executed before the invoice receipt, the goods movement is valuated with the purchase order price. If an invoice is already posted, the system uses the price of the invoice. If a partial invoice is received, the partial quantity corresponding to the invoice is valuated with the invoice price, the rest is valuated with the purchase order price.
    For more detailed information, refer to both the documentation of the material valuation and Note 380883.
    see as well Note 547570 - FAQ: VPRS in pricing

  • HOW TO DO BILLING IN STO BETWEEN TWO COMPANY CODES?

    Hi All,
    I have done sto between two plants of two different company codes.
    PO generated(ME21N)
    delivery in background(VL10B)
    PICK N PGI(VL02N)
    Stock Posting (MIGO)
    All the steps completed and stock overview is also reflected the transfer.
    Now Can any body clarify me about do a billing document should be raised between two plants?
    what is process to track accounts in each company code abt stock transfer?
    Thanks in advance.
    Please clarify with steps to do after MIGO.
    Regards,
    reddyy

    Hi Reddy
    The intercompany there are 2 processes
    Intercompany STO means there is a stock transfer happens between two plants of different company codes
    For that del type used is NLCC order type is NB
    Not del type NL as written by you
    After the STO the suppying company will bill the ordering company that is intercompany billing
    I beleive this is what the process you are trying as per the heading of your thread
    Another is intercompany sales followed by intercompany billing and this is what Mr.Murali had sent settings
    For this no STO is reqd
    The supplying plant will deliver directly to the customer who lies in the sales set up of ordering plant
    NO STO here
    After the supply is over the ordering company will bill the customer F2 inv and the supplying plant will bill the ordering plant/company
    The billing will be between company code to company code that is intercompany
    Scenario 1 is Intercompany STO followed by intercompany billing
    Whatever we move from 1 plant to another is stock transfer
    Scenario 2 is Intercompanysales followed by intercompany billing
    Whatever we supply to the end customer is is sales
    By going tro the initial thread once again you are trying  Intercompany STO only
    The del type you are using is wrong and it should be NLCC
    _I think you are mixed between both as per my knowledge you cant map this as that and that as this
    They both are process wise different_
    Pls tell exactly where you are struck?
    Regards
    Raja

Maybe you are looking for