ValueChanged- and keyReleased-Events in JTree

Hello,
Suppose I have Items in a JTree. Any time the selected item changes, heavy work has to be done to get the details of the node and present it to the user.
Suppose further the user uses the arrow-keys to scroll through the list an he holds down the key. I do get many calls to my Listeners valueChanged(TreeSelectionEvent event), but I am interested just in the last event, in order to avoid all the heavy work. How can this be done?
I tried the following, but I do get a keyReleased-Event at any new selection. (Maybe because a nested component of the JTree feels like I had released the arrow-key. Is this a bug?):
private class NodeSelectionEventHandler implements KeyListener, TreeSelectionListener {
private boolean forwardEvents = true;
private EventObject lastEvent;
public void keyTyped(KeyEvent e) {
public void keyPressed(KeyEvent e) {
forwardEvents = false;
public void keyReleased(KeyEvent e) {
//System.out.println(e.getComponent());
// Leider bekomme ich nach jeder auswahl mit Cursortaste auch einen
// keyReleased-Event, obwohl die Taste immer noch gedrueckt ist.
forwardEvents = true;
if (lastEvent != null) {
lastEvent = null;
fireNodeSelectionChanged();
//System.out.println("Last Selection forwarded");
public void valueChanged(TreeSelectionEvent event) {
// there is no event.getValueIsAdjusting() in JDK1.3
handelEvent(event);
private void handelEvent(EventObject event) {
//Thread.dumpStack();
if (forwardEvents) {
lastEvent = null;
fireNodeSelectionChanged();
//System.out.println("Selection forwarded");
else {
lastEvent = event;
//System.out.println("Selection eaten");

I have a JTree from which I generate classes on selection.
To ensure only one event is fired I install two listeners.
I install a mouse listener and capture an event when the mouse is clicked, and I install a key listener and only catch the enter key being pressed as follows:
tree.addMouseListener(new java.awt.event.MouseAdapter() {
          public void mouseClicked(MouseEvent e) {
          showFunction();
tree.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
showFunction();
This means something happens only if a user clicks on the node with the mouse or selects the node and presses the enter button. I have used this as a general standard throughout my application and it works on all platforms.
Hope this helps

Similar Messages

  • [SOLVED] Keyboard issue - fn+key "KeyRelease" event not triggered

    Hi Archers :)
    First post, sorry if not in the right section.
    I have a quite anoying bug. I bought a no name laptop, imported by Textorm, model M116 SU7300, same model as this one (http://www.textorm.com/pc-portable/pc-p … 22%5D.html)
    On the keyboard, the '<' and '>' symbols are mapped on "fn+W" and "fn+MAJ+W".
    Everything works fine in a TTY console. All others fn-KEY are working well.
    The problem is with a Xorg environment : when pressing fn+W or fn+MAJ+W, it seems that the release key is never triggered, acting like if I was pressing the key in continue.
    When pressing another key, the crazy '<' input stop, but then, fn+W won't works again... until I trigger a press/release event with 'acpi_fakekey 86'.
    Then, same scenario.
    I booted a live Archbang,  same result (well, I wasn't very surprised), and a live Sabayon... same result.
    Using xev, I can see that when pressing/releasing fn+W, the KeyReleased event is never triggered. I can provide a log if needed.
    So it seems related to the Xorg driver....
    I tryied to use the kbd driver by adding an xorg.conf
    Section "InputDevice"
    Identifier "Generic Keyboard"
    Driver "kbd"
    Option "CoreKeyboard"
    Option "XkbRules" "xorg"
    Option "XkbModel" "pc105"
    Option "XkbLayout" "fr" # "fr-oss" pour Feisty et +
    Option "XkbVariant" "latin9"
    EndSection
    Section "ServerFlags"
    Option "AutoAddDevices" "Off"
    EndSection
    I can confirm that the kbd driver was in use with Xorg log :
    [ 900.371] (II) LoadModule: "kbd"
    [ 900.371] (II) Loading /usr/lib/xorg/modules/input/kbd_drv.so
    [ 900.371] (II) Module kbd: vendor="X.Org Foundation"
    [ 900.371] compiled for 1.14.0, module version = 1.7.0
    [ 900.371] Module class: X.Org XInput Driver
    [ 900.371] ABI class: X.Org XInput driver, version 19.1
    [ 900.780] (II) Using input driver 'kbd' for 'Generic Keyboard'
    [ 900.780] (**) Option "CoreKeyboard" "on"
    [ 900.780] (**) Generic Keyboard: always reports core events
    [ 900.780] (**) Generic Keyboard: always reports core events
    [ 900.780] (**) Option "Protocol" "standard"
    [ 900.780] (**) Option "XkbRules" "xorg"
    [ 900.780] (**) Option "XkbModel" "pc105"
    [ 900.780] (**) Option "XkbLayout" "fr"
    [ 900.780] (**) Option "XkbVariant" "latin9"
    [ 900.780] (II) XINPUT: Adding extended input device "Generic Keyboard" (type: KEYBOARD, id 6)
    ... no luck. Same comportement.
    I tryed the xorg-input-evdev git version, no luck. (But if I understand, xorg-input-evdev use kbd as underlying driver?)
    I also tryed xorg-server-dev 1.14.99.1-1
    So for now, I use a ugly hack : I mapped "W-W" and "S-W-W" in my openbox rc.xml to execute "acpi_fakekey 86". Nearly working all the time.
    I know this isn't directly related to Arch, but if someone has any pointers... I take any ideas.
    Thanks in advance!
    PS :
    xorg-server 1.14.1-1
    xf86-input-evdev 2.8.0-1
    Last edited by jc.saaddupuy (2013-05-28 18:28:05)

    Wow thanks!
    I confirm that this is working.
    Thanks to your infos, I investigate the udev stuff.
    You will have to know the vendor and product name of your machine :
    cat /sys/class/dmi/id/{sys_vendor,product_name}
    Thats the strings your udev rule have to match in ENV{DMI_VENDOR} and ATTR{[dmi/id]product_name}.
    For me, both was empty, so I use a wildcard :
    ENV{DMI_VENDOR}=="*", ATTR{[dmi/id]product_name}=="*"
    Then, you'll have to specify which codes needs to trigger a key release (sames as found with keymap -i)
    Add a file in /usr/lib/udev/keymaps/force-release/  whith the hex values (one per line)
    I named mine 'textorm'
    /echo 0x56 > /usr/lib/udev/keymaps/force-release/textorm
    And add it in the RUN of your udev rule (not the full file name):
    ENV{DMI_VENDOR}=="*", ATTR{[dmi/id]product_name}=="*", RUN+="keyboard-force-release.sh $devpath textorm"
    Knowing your serio ( /sys/bus/serio/devices/serio0), you can test the keyboard-force-release.sh script (the serio parameter HAVE TO NOT begin with /sys/)
    /usr/lib/udev/keyboard-force-release.sh bus/serio/devices/serio0 textorm
    You can then check the /sys/bus/serio/devices/serio0/force_release content.
    Works like a charm :)

  • Unable to capture startup and shutdown event of Photoshop in automation Plugin.

    Hi,
    I am creating an automation plugin and I want to register some events. I have seen listener plugin sample to register event in startup and unregister event in shutdown. I have used same code in my plugin but I am unable to capture the startup nad shutdown event of Photoshop. On clicking the menu item of my plugin the calls come inside the AutoPluginMain but during the startup or shutdown of plugin, the calls does not come inside the AutoPluginMain.
    I am unable to detect the cause of the problem. Can someone please giude me??
    Thanks in advance.

    Hi Tom,
    Thanks for the suggestion.
    Yes, I am working on Windows. As you suggested, I compiled .rc file but the compile option for .r file was disabled. After compiling the .rc file, I again rebuild the complete project and tested my build. But still I was not able to achive the desired result.
    Any other thing that I need to do to make it work?
    Thanks

  • When I sync my iPod to my MacBook through iTunes new events do not show up and old events are not deleted. I am using Snow Leopard  and not iSync.

    I am using Snow Leopard on a MacBook. I have an iPod touch 3G. I do not use iSync it Mobile Me. When I sync my iPod through iTunes new events on my iPod do not show up on my Mac and old events do not delete. I have read help instructions that include deleting the data on the iPod. The iPod has the correct data and the Mac does not so I have not followed those instructions. I need help as the only reason I bought the Mac was to be able to sync, back up, view and print my calendar. Currently it is useless. If only Apple could have learned from the elegance of the Palm software.

    Start here:
    iPhone, iPad, or iPod touch: Device not recognized in iTunes for Windows

  • I wonder to know what is the enterprise solution for windows and application event log management and analyzer

    Hi
    I wonder to know what is the enterprise solution for windows and application event log management and analyzer.
    I have recently research and find two application that seems to be profession ,1-manageengine eventlog analyzer, 2- Solarwinds LEM(Solarwind Log & Event Manager).
    I Want to know the point of view of Microsoft expert and give me their experience and solutions.
    thanks in advance.

    Consider MS System Center 2012.
    Rgds

  • What is the diffrence between sap events and application events

    Hi all,
    what is the diffrence between sap events and application events.Can any one tell me with examples.
    regards,

    Hi,
    Look at this,
    <b>System Events (Default)</b>
    The event is passed to the application server, but does not trigger the PAI. If you have registered an event handler method in your ABAP program for the event (using the SET HANDLER statement), this method is executed on the application server.
    Within the event handler method, you can use the static method SET_NEW_OK_CODE of the global class CL_GUI_CFW to set a function code and trigger the PAI event yourself. After the PAI has been processed, the PBO event of the next screen is triggered.
    The advantage of using this technique is that the event handler method is executed automatically and there are no conflicts with the automatic input checks associated with the screen. The disadvantage is that the contents of the screen fields are not transported to the program, which means that obsolete values could appear on the next screen. You can work around this by using the SET_NEW_OK_CODE method to trigger field transport and the PAI event after the event handler has finished.
    <b>Application Events</b>
    The event is passed to the application server, and triggers the PAI. The function code that you pass contains an internal identifier. You do not have to evaluate this in your ABAP program. Instead, if you want to handle the event, you must include a method call in a PAI dialog module for the static method DISPATCH of the global class CL_GUI_CFW. If you have defined an event handler method in your ABAP program for the event (using the SET HANDLER statement), the DISPATCH method calls it. After the event handler has been processed, control returns to the PAI event after the DISPATCH statement and PAI processing continues.
    The advantage of this is that you can specify yourself the point at which the event is handled, and the contents of the screen fields are transported to the application server beforehand. The disadvantage is that this kind of event handling can lead to conflicts with the automatic input checks on the screen, causing events to be lost.
    Hope u understood.
    Thanks&Regards,
    Ruthra.R

  • How can i set action on UITaBar and get event from that

    Hi All,
    I m doing one apps in which i have to add three UITabBarItem and this is UITabBarSystemItem.
    Now i cannot understand that how can i set action and get event from the?
    And how can i set various views on three tab bar item.
    I have to use UITabBar means i have to use UINavigationController+UITabBar
    My code id
    tabBar =[[UITabBar alloc] initWithFrame:CGRectMake(0,370,320,50)];
    tabBar.backgroundColor =[UIColor blackColor];
    UITabBarItem *search =[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemSearch tag:0];
    UITabBarItem *recents =[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemRecents tag:1];
    UITabBarItem *favorites =[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFavorit es tag:2];
    tabBar.items =[[NSArray arrayWithObjects:search,recents,favorites, nil] retain];
    tabBar.selectedItem = search;
    [myView addSubview:tabBar];
    [tabBar release];
    I add a action:
    UITabBarItem *search =[[UITabBarItem alloc] InitWithTabBarSystemItem:UITabBarSystemItemSearch tag:0 action:@selector(select:)];
    So it error: Warning -no'InitWithTabBarSystemItem:tag:action:' method fount
    So any can help me regarding it?

    Thanks RickMaddy very much.
    I read and do with sample at the View Controller Programming Guide . But when run it only view TabBar with title but haven't got any TabBarItem on it. I searched a few example about TabBar and i did, but i want do a form with a button then press on button it view a form with 2 TabBarItem on TabBar and press each TabBarItem will show correlative form page 1, page 2.
    UITabBarController *tabBarControl = [[[UITabBarController alloc] initWithNibName:nil bundle:nil] autorelease];
    tabBarControl.title = @"Tab bar";
    ViewControl1 *view1 = [[[ViewControl1 alloc] initWithNibName:@"ViewControl1" bundle:nil] autorelease];
    ViewControl1 *view2 = [[[ViewControl1 alloc] initWithNibName:@"ViewControl2" bundle:nil] autorelease];
    tabBarControl.viewControllers = [NSArray arrayWithObjects:view1,view2,nil];
    [self.navigationController pushViewController:tabBarControl animated:YES];

  • Badi and Business event( Urgent)

    Hi experts,
          I am new to badi and business event 1120P. Please post how this business event exactly comes in to picture in this badi. also how to find this business event?
    And also Post the logic or code. The requirement is given below . Pls Post the solution. Its very urgent.
    Enhancement Summary
    Two user exits are needed to determine the correct G/L Account and Cost Center on Shipment Cost documents and post the Material Group on the Accounting document. BADI_SCD_ACCTG and Business Event 1120P can be used to accommodate the new functionality.
    Business Process
    Specific G/L Accounts and Cost Centers have to be determined to post on the Shipment Cost document. This is needed to provide accurate management reporting capabilities on shipments for Sales Order or Stock Transfer Order. A new custom table must be created which contains the following information: Distribution, Mode of Transport, Account, Cost Center Material group. Distribution is an identifier here if this shipment originated from an SO or STO.
    There are no screens involved in this enhancement.
    Components
    Table: ZTABLE1
    Field     Data Element     Type     Length     Description
    MANDT     MANDT     CLNT (key)     3     Client
    DISTRIBUTION     Z_DISTRIBUTION     CHAR (key)     1     Distribution
    MOT     ZZDEF_MOT     CHAR (key)     2     Mode of Transportation
    MATKL     MATKL     CHAR (key)     9     Material group
    SAKNR     SAKNR     CHAR     10     G/L Account Number
    KOSTL     KOSTL     CHAR     10     Cost Center
    This table gets updated manually by the FI team.
    Values for Distribution are:
    ‘1’  =  Primary Distribution to Refinery
    ‘2’ = Primary and Secondary– Excluding refinery
    All entries must be checked against SAP config and master tables
    User exit BADI BADI_SCD_ACCTG will be used to determine the correct G/L Account, Cost Center and Product Group based on Distribution and Mode of Transport. This BADI gets called only when a new Shipment Cost document get created.
    Once the BADI determined the new values it populates field c_vfkn-sakto with the G/L account, field c_vfkn-kostl with the Cost Center and exports the Product group to memory.
    There is no field on the Shipment Cost Document to store the Product group. Therefore another mechanism must be used to get the Product Group on the accounting document.
    Business Event 1120P can be used to import the Product group out of memory and put it on BSEG-MATNR. Structure BSEG_SUBST must be enhanced with field MATNR for this purpose.
    Function, Rules, Exits      Description of Functionality, Rules, Exits
    BADI_SCD_ACCTG     Business Add-In for Shipment Cost Account Assignment
    Business Framework     Business Event 1120P can be used to import the Product Group from memory and to populate field BSEG_SUBST-MATNR.
    This event gets called from different places. It needs to be ensured that it only populates the value when it was called from BADI_SCD_ACCTG.
    Custom Table     A look-up Table needs to be maintained for Distribution, Mode of Transport, G/L Account, Cost Center and Material Group
    Transaction code     To maintain the new table
    Append Structure     To enhance structure BSEG_SUBST with MATNR
          Business Add-In BADI_SCD_ACCTG can be used to determine the account assignments for a shipment cost item to set the G/L Account and Cost Center. All data needed to determine the new information gets provided in this BADI.
    Logic:
    •     Determine if STO or SO based on Document Category from internal table I_REFOBJ-VTRLP field VGTYP If is C then Distribution type is Sales Order (Primary and Secondary – Excluding Refinery – ‘2’ ) else we need to check the receiving plant. If the receiving plant (I_REFOBJ-VTRLK field WERKS) is a refinery the Distribution type is Primary (1) else it’s a (Primary and Secondary – Excluding Refinery – ‘2’ ). Refineries can be identified via Function Module ZPLANTCLASSIFICATION. The plant must be passed into Import Parameter IP_SAPPLANT and field INT_PLANTCHAR-ATNAM must be looked up with value SAPTYPE. If it exists and field ATWRT contains ‘RFY’, the plant is a refinery.
    •     Product Group can be determined from the Material master through Material group field MARA-MATKL.
    •     Mode of Transport will be passed in the BADI in VTRLK-OIC_MOT.
    •     Select single entry from table ZTABLE1based on Distribution, Mode of Transport and Material Group. If nothing gets selected, error message ‘No entry exists in table ZTABLE1for Distribution (distribution), MOT (MOT) & Mat. Group (material group)’ should be triggered.
    •     Move ZTABLE1-SAKNR  to c_vfkn-sakto and ZTABLE1-KOSTL to c_vfkn-kostl
    •     The Material group must be exported to memory in BADI_SCD_ACCTG
    •     The Material group must be imported from memory in Business Event BP1120P
    •     Free Memory in Business Event BP1120P
    This is VI01 – Creation of Freight Cost Item screen
    and also code for function module ZPLANTCLASSIFICATION below
    FUNCTION zplantclassification .
    ""Local interface:
    *"  IMPORTING
    *"     REFERENCE(IP_SAPPLANT) LIKE  AUSP-OBJEK OPTIONAL
    *"     REFERENCE(IP_CPSPLANT) LIKE  AUSP-ATWRT OPTIONAL
    *"     REFERENCE(IP_SISLOC) LIKE  AUSP-ATWRT OPTIONAL
    *"  EXPORTING
    *"     VALUE(EP_SAPPLANT) LIKE  AUSP-OBJEK
    *"     VALUE(EP_CPSPLANT) LIKE  AUSP-ATWRT
    *"     VALUE(EP_SISLOC) LIKE  AUSP-ATWRT
    *"     VALUE(EP_OWNERSHIP) LIKE  AUSP-ATWRT
    *"     VALUE(EP_SMISTYPE) LIKE  AUSP-ATWRT
    *"     VALUE(EP_SPOTREF) LIKE  AUSP-ATWRT
    *"     VALUE(EP_SUBTYPE) LIKE  AUSP-ATWRT
    *"     VALUE(EP_SUPPLYREGION) LIKE  AUSP-ATWRT
    *"     VALUE(EP_TYPE) LIKE  AUSP-ATWRT
    *"     VALUE(EP_DISTAREA) LIKE  AUSP-ATWRT
    *"     VALUE(EP_GEOGAREA) LIKE  AUSP-ATWRT
    *"     VALUE(EP_HMF) LIKE  AUSP-ATWRT
    *"     VALUE(EP_IATACODE) LIKE  AUSP-ATWRT
    *"     VALUE(EP_IRSTCN) LIKE  AUSP-ATWRT
    *"     VALUE(EP_OPSAREA) LIKE  AUSP-ATWRT
    *"     VALUE(EP_PLANTSTAT) LIKE  AUSP-ATWRT
    *"     VALUE(EP_PORTCODE) LIKE  AUSP-ATWRT
    *"     VALUE(EP_REFAREA) LIKE  AUSP-ATWRT
    *"     VALUE(EP_SAPTYPE) LIKE  AUSP-ATWRT
    *"     VALUE(EP_MFGWARRANTY) LIKE  AUSP-ATWRT
    *"     VALUE(EP_USERTYPE) LIKE  AUSP-ATWRT
    *"     VALUE(EP_TRMCENTER) LIKE  AUSP-ATWRT
    *"     VALUE(EP_TRANSCENTER) LIKE  AUSP-ATWRT
    *"     VALUE(EP_FEIN) LIKE  AUSP-ATWRT
    *"  TABLES
    *"      INT_PLANTCHAR STRUCTURE  ZPLANTCLASSIFICATION OPTIONAL
    *"  EXCEPTIONS
    *"      NO_OBJEK_FOUND
    *"      NO_CPSPLANT_FOUND
    *"      NO_SISLOC_FOUND
    *"      NO_INPUT_FOUND
    *"      VALID_PLANT_NO_CHARACTERISTIC
    *"      ONE_TO_MANY_ISSUE
    *"      PLANT_NOT_FOUND_ZDEF_DELPLANT
    *"      UNKNOWN_ERRORS
    FM Name: ZPLANTCLASSIFICATION     
    Created By  :  SYUB                                                  *
    Description : Function Module to retrieve plant characteristics      *
    The function module has two capabilities:
    1. Retrieve only the necessary characteristics
    2. Retrieve the whole characteristics into an internal table.
    Parameter Description                                                *
    In the future, if there is a new characteristic added to the
    plant classification tables, the characteristic has to be added
    to the list of the export parameters and the loop statement.
      TABLES: ausp, cabn, ksml, zdef_delplant.
      DATA: ws_objek LIKE ausp-objek,
            ws_countchar TYPE i,
            ws_countplant TYPE i.
    *Internal table for SAP plant
      DATA: BEGIN OF int_plant OCCURS 0,
            plant LIKE ausp-objek,
            END OF int_plant.
    *sap plant code is the input parameter.Move objek, atnam, and atwrt to
    *internal table PLANTCHAR using inner join of AUSP, CABN, and KSML to
    *synch up the internal characteristic numbers throughout the 3 tables.
      IF NOT ip_sapplant IS INITIAL.
        SELECT auspobjek cabnatnam ausp~atwrt
          INTO CORRESPONDING FIELDS OF TABLE int_plantchar
          FROM ksml AS ksml
          INNER JOIN cabn AS cabn
            ON cabnatinn = ksmlimerk
          INNER JOIN ausp AS ausp
            ON ausp~objek = ip_sapplant
            AND auspatinn = cabnatinn
            AND ausp~mafid = 'O'
            AND ausp~klart = 'Z01'.
    *Checking the existence of ip_sapplant in the table, if it doesn't
    *exist, raise the exception else if it exists, check if it has
    *characteristic values.
        IF sy-subrc NE 0.
          RAISE no_objek_found.
        ELSE.
          DESCRIBE TABLE int_plantchar LINES ws_countchar.
          IF ws_countchar LT 2.
            RAISE valid_plant_no_characteristic.
          ENDIF.
        ENDIF.
    *cps plant code is the input parameter. Move objek from table AUSP to
    *ws_objek using inner join of CABN and AUSP to match up the internal
    *characteristic numbers from the 2 tables.
      ELSEIF NOT ip_cpsplant IS INITIAL.
        SELECT ausp~objek
          INTO TABLE int_plant
          FROM ausp AS ausp
          INNER JOIN cabn AS cabn
            ON cabn~atnam = 'OLDCODE'
              WHERE auspatinn = cabnatinn
                AND ausp~mafid = 'O'
                AND ausp~klart = 'Z01'
                AND ausp~atwrt = ip_cpsplant.
    *Checking the existence of ip_cpsplant in the table
        IF sy-subrc EQ 0.
    *Counting the number of SAP plants in the internal table int_plant
          DESCRIBE TABLE int_plant LINES ws_countplant.
    *Moving the values of objek, atnam, and atwrt to PLANTCHAR using objek
    *from ws_objek.
          IF ws_countplant EQ 1.
            LOOP AT int_plant.
              SELECT auspobjek cabnatnam ausp~atwrt
                INTO CORRESPONDING FIELDS OF TABLE int_plantchar
                FROM ksml AS ksml
                INNER JOIN cabn AS cabn
                  ON cabnatinn = ksmlimerk
                INNER JOIN ausp AS ausp
                  ON ausp~objek = int_plant-plant
                  AND auspatinn = cabnatinn
                  AND ausp~mafid = 'O'
                  AND ausp~klart = 'Z01'.
            ENDLOOP.
    *If there more than one SAP Plants, then raise an exception.
          ELSEIF ws_countplant GT 1.
            RAISE one_to_many_issue.
          ENDIF.
        ELSE.
          SELECT SINGLE werks FROM zdef_delplant
            INTO ws_objek
            WHERE cpsloc = ip_cpsplant.
          SELECT auspobjek cabnatnam ausp~atwrt
           INTO CORRESPONDING FIELDS OF TABLE int_plantchar
           FROM ksml AS ksml
           INNER JOIN cabn AS cabn
             ON cabnatinn = ksmlimerk
           INNER JOIN ausp AS ausp
             ON ausp~objek = ws_objek
             AND auspatinn = cabnatinn
             AND ausp~mafid = 'O'
             AND ausp~klart = 'Z01'.
          if sy-subrc ne 0.
            raise plant_not_found_zdef_delplant.
          endif.
        ENDIF.
    *cps plant code is the input parameter. Move objek from table AUSP to
    *ws_objek using inner join of CABN and AUSP to match up the internal
    *characteristic numbers from the 2 tables.
      ELSEIF NOT ip_sisloc IS INITIAL.
        SELECT ausp~objek
          INTO TABLE int_plant
          FROM ausp AS ausp
          INNER JOIN cabn AS cabn
            ON cabn~atnam = 'SISLOC'
              WHERE auspatinn = cabnatinn
                AND ausp~mafid = 'O'
                AND ausp~klart = 'Z01'
                AND ausp~atwrt = ip_sisloc.
    *Checking the existence of ip_sapplant in the table
        IF sy-subrc EQ 0.
          DESCRIBE TABLE int_plant LINES ws_countplant.
    *Moving the values of objek, atnam, and atwrt to PLANTCHAR using objek
    *from ws_objek.
          IF ws_countplant EQ 1.
            LOOP AT int_plant.
              SELECT auspobjek cabnatnam ausp~atwrt
                INTO CORRESPONDING FIELDS OF TABLE int_plantchar
                FROM ksml AS ksml
                INNER JOIN cabn AS cabn
                  ON cabnatinn = ksmlimerk
                INNER JOIN ausp AS ausp
                  ON ausp~objek = int_plant-plant
                  AND auspatinn = cabnatinn
                  AND ausp~mafid = 'O'
                  AND ausp~klart = 'Z01'.
            ENDLOOP.
    *If there more than one SAP Plants, then raise an exception.
          ELSEIF ws_countplant GT 1.
            RAISE one_to_many_issue.
          ENDIF.
        ELSE.
          SELECT SINGLE werks FROM zdef_delplant
            INTO ws_objek
            WHERE sisloc = ip_sisloc.
          SELECT auspobjek cabnatnam ausp~atwrt
           INTO CORRESPONDING FIELDS OF TABLE int_plantchar
           FROM ksml AS ksml
           INNER JOIN cabn AS cabn
             ON cabnatinn = ksmlimerk
           INNER JOIN ausp AS ausp
             ON ausp~objek = ws_objek
             AND auspatinn = cabnatinn
             AND ausp~mafid = 'O'
             AND ausp~klart = 'Z01'.
          if sy-subrc ne 0.
            raise plant_not_found_zdef_delplant.
          endif.
        ENDIF.
      ELSE.
    *Checking if there is an input parameter entered.
        RAISE no_input_found.
      ENDIF.
    Modified 7/30 by RFOR to validate SAP plant is in plant master
      data: wa_t001w like t001w.
      read table int_plantchar.
      SELECT SINGLE * from t001w into wa_t001w where
      werks = int_plantchar-objek.
      if sy-subrc ne 0.
        raise NO_OBJEK_FOUND.
      endif.
    *Moving all the characteristic values to the export parameters
      LOOP AT int_plantchar.
        MOVE int_plantchar-objek TO ep_sapplant.
        CASE int_plantchar-atnam.
          WHEN 'OLDCODE'.
            MOVE int_plantchar-atwrt TO ep_cpsplant.
          WHEN 'SISLOC'.
            MOVE int_plantchar-atwrt TO ep_sisloc.
          WHEN 'OWNERSHIP'.
            MOVE int_plantchar-atwrt TO ep_ownership.
          WHEN 'SMISTYPE'.
            MOVE int_plantchar-atwrt TO ep_smistype.
          WHEN 'SPOTREF'.
            MOVE int_plantchar-atwrt TO ep_spotref.
          WHEN 'SUBTYPE'.
            MOVE int_plantchar-atwrt TO ep_subtype.
          WHEN 'SUPPLYREGION'.
            MOVE int_plantchar-atwrt TO ep_supplyregion.
          WHEN 'TYPE'.
            MOVE int_plantchar-atwrt TO ep_type.
          WHEN 'DISTAREA'.
            MOVE int_plantchar-atwrt TO ep_distarea.
          WHEN 'GEOGAREA'.
            MOVE int_plantchar-atwrt TO ep_geogarea.
          WHEN 'HMF'.
            MOVE int_plantchar-atwrt TO ep_hmf.
          WHEN 'IATACODE'.
            MOVE int_plantchar-atwrt TO ep_iatacode.
          WHEN 'IRSTCN'.
            MOVE int_plantchar-atwrt TO ep_irstcn.
          WHEN 'OPSAREA'.
            MOVE int_plantchar-atwrt TO ep_opsarea.
          WHEN 'PLANTSTAT'.
            MOVE int_plantchar-atwrt TO ep_plantstat.
          WHEN 'PORTCODE'.
            MOVE int_plantchar-atwrt TO ep_portcode.
          WHEN 'REFAREA'.
            MOVE int_plantchar-atwrt TO ep_refarea.
          WHEN 'SAPTYPE'.
            MOVE int_plantchar-atwrt TO ep_saptype.
          WHEN 'MFG_WARRANTY'.
            MOVE int_plantchar-atwrt TO ep_mfgwarranty.
          WHEN 'USER_TYPE'.
            MOVE int_plantchar-atwrt TO ep_usertype.
          WHEN 'TERMINALCENTER'.
            MOVE int_plantchar-atwrt TO ep_trmcenter.
          WHEN 'TRANSPORTATIONCENTER'.
            MOVE int_plantchar-atwrt TO ep_transcenter.
          when 'FEIN'.
            move int_plantchar-atwrt to ep_fein.
        ENDCASE.
      ENDLOOP.
    ENDFUNCTION.
    Pls help me out from this problem its very urgent.
    Thanks

    hi SK ,
    process like this .
    in BADI
    method.
    1.Here u have to put ur logic based on the Requirement.
    2.then u have to call BTE like this
    <b>call function 'OPEN_FI_PERFORM_00001020_E'
          tables
            t_bseg = xbseg
            t_bkpf = xbkpf.</b>
    3.Update Ztables.
    endmethod.
    this is sample logic only.First get logic of TS then u will come to know how to do?
    regards
    prabhu

  • Google contacts and calendar events entered on my iPhone 5s are not syncing with my google account.

    Newly entered contacts and calendar events entered on my IPhone 5s are not syncing to google.
    Facts that may be pertinent:
    - I switched from the iPhone 4 to the iPhone 5s and did the easy option of having it automatically set up like my previous phone, so I did not change any part of the setup. It is possible that it stopped syncing at that time, based on which contacts have synced and which haven't.
    - My gmail account is set up as Exchange, with Mail, Contacts, and Calendars set to sync.
    - Server: m.google.com, Use SSl is on, S/MIME is off (I don't actually know what these are, but maybe they matter?)
    - Fetch New Data / Gmail account is set to Push
    - Contacts and Calendar Default Account is Gmail
    - In the Contacts app under Groups I have only GMAIL checked.
    I've read that Google recommends CardDAV, which I gather is not the same as Exchange?
    I'm afraid to delete anything and start over, for fear of losing my contacts.
    Is there a difference between the gmail account I set up and what the Contacts app calls GMAIL?
    If there is anything I should communicate about how things are set up on the Google end, let me know.
    Thanks in advance for help!

    Hello Marsden,
    Try this...
    Go to the isync program on your Mac. 
    Go to Preferences in the main menu
    Hit Reset Sync History
    I'm pretty sure this is how I fixed it... so far so good.
    Let me know if that works for you!

  • HT1296 When syncing to ipod and ipad i get duplicate contacts and calendar events

    Probllems syncing contacts and calendare events. I get dups and triplicates

    How are you syncing? Are you syncing through itunes, icloud or both? Most issues come from syncing the same data/content from more than one source.

  • HT4436 Why don't all my contacts and calendar events on my iMac (version 10.7.4) stream onto iCloud? For instance, there are 470 entries in my address book but only 270 on iCloud. And not all my appointments in iCal are transferred.

    Why don't all my contacts and calendar events on my iMac (version 10.7.4) stream onto iCloud? For instance, there are 470 entries in my address book but only 270 on iCloud. And not all my appointments in iCal are transferred either.
    I have the same problem transfering Address book on iMac to contacts on iPhone (old version 3G - on iCloud). this is a hard wired connection

    Might you have 200 entries in On My Mac groups and some of your appointments in On My Mac calendars?

  • Why can´t I see contacts and calendar events from my iPhone in my mac pro if I already registered it in the cloud?

    Why can´t I see contacts and calendar events already registered in my iPhone, in my Mac Pro ?  I already actualize LION OSX   and selected these items in the adjustments menu of the icloud. I could do it just once, after I installed Lion OSX, but up to the moment it does not updates.

    Assuming you activated iCloud, try going to Settings>iCloud and make sure Calendars and Contacts are set to ON.

  • I've lost the contacts and calendar events from my 3GS after setting up iCloud with iPad3 and PC Outlook.  Any solutions?

    I've lost the contacts and calendar events (& email) from my 3GS after setting up iCloud with iPad3 and PC Outlook.  Any solutions?
    I tried to re-synch it with the PC iTunes, but no luck, even when re-checking the boxes for Outlook...

    I should mention that i have NOT upgraded to iOS 5 on the 3GS and don't want to.  Therefore, no iCloud on the phone.

  • Many contacts and calendar events have disappeared

    Many of my contacts and calendar events have suddenly disappeared. Can they be retrieved?

    Mine too. I have a J Home and J Work calendar. The J Home calendar is completely gone and had all my personal events. I checked iCloud and it is gone there. No one has access except me. I opened my calendar on my iphone this afternoon to add an appt for my son. The data was there and basically disappeared in front of my eyes. I didn't touch the calendars menu until everything was gone so it wasn't me. I'm losing my mind right now. Everything is gone...just gone.
    I just noticed my wife's shared calendars also no longer appear on my phone or iCloud. Both of her calendars appear on her iCloud and they still say they are shared with me. That's just f****n great. iCloud broke something and I'm the one to suffer. I'll bet anything Apple won't do anything to help as they don't back up iCloud data. I'm sure they do as they are required by law, but they won't admit it. SONOFA!!!!

  • My contacts and calendar events disappeared from my iPad! How can I retrieve them??

    My contacts and calendar events disappeared from my iPad. Can they be retrieved?

    From
    http://btsc.webapps.blackberry.com/btsc/viewdocument.do;jsessionid=B786F9DEB73FE BE22A4D2F911A97BC3C?externalId=KB35311&sliceId=2&cmd=displayKC&docType=kc&noCoun t=true&ViewedDocsListHelper=com.kanisa.apps.common.BaseViewedDocsListHelperImpl
    BlackBerry Desktop Software utilizes Apple's SyncServices technology in order to synchronize Contact, Calendar, Notes, and Tasks information to and from the Mac computer.
    BlackBerry Desktop Software synchronizes information with the SyncServices database, which is synchronized with the desktop applications on the Mac computer (for example: Apple Address Book, iCal, Apple Mail, Microsoft Outlook for Mac). BlackBerry Desktop Software does not synchronize directly to or from the desktop applications on the Mac computer.
    Mac OS X Mavericks v10.9 and later does not use SyncServices, therefore, it is not possible to synchronize Contact or Calendar information using the BlackBerry Desktop Software on these versions of OS X.
    For more information on SyncServices and OS X Mavericks, see the following Apple Support article:
    http://support.apple.com/kb/HT5847
    Note: BlackBerry Desktop software 2.4 is still supported for use with Mac OS X v10.6, 10.7, and 10.8.
    Pete

Maybe you are looking for

  • Sales Return: credit memo Should generate automatically with goods reversal

    DEAR SD GURUS N EXPERTS, Currently we are using following system of Sales return. VA01: (Order Type: RE) --> VL01N (Return Delivery) --> VL09 (Goods Reversal) --> VA01 (Request 4 Credit Memo or remove billing bloc) --> VF01 (Credit Memo) But, now my

  • Credit Check is not working while creation of the delivery

    Hi, Credit check is not performing while creation of the delivery. As per current settings, there is no credit check at SO level. Ideally, system should show an error message while creation of the delivery if credit limit of the customer is exceeds.

  • XML element attributes in program

    I am using following FMs to create XML document from internal table CALL FUNCTION 'SDIXML_DATA_TO_DOM' CALL FUNCTION 'SDIXML_DOM_TO_XML' My internal table has field 'AMT' and generated XML file has following line <AMT>1000</AMT> But I want this line

  • HTML Tags appear in Notes : how to removing display HTML Correctly.

    Hi the Notes section of HTML CLient for service request, we are seeing HTML Tags appearing in the following format. <html><b>Some message/b></html> We want to make it appear in HTML format. Not with the HTML Tags. Is there some way to get rid of the

  • Suggestions required for Read-only cache group in timesten IMDB cache

    Hi In IMDB Cache , If the underlying oracle RAC is having two schemas ( "KAEP" & "AAEP" , having same sturcture and same name of objects ) and want to create a Read-only cache group with AS pair in timesten. Schema