MC container causes this code to fail...why ?

Hi
Flash CS5 as3
We have settlements named with suffix _Level2 such as e.g. Mitre'sGate_Level2 as well as _Level3 as MovieClips that are in a container MovieClip called Map_Collection.
The code below fails with the error shown if the code line shown in bold is used, it works with:-
var clipName :String = String(e.item[s]).replace(r,"")+currentLevel;             if the settlements are placed directly on stage.
The code identifies _Level2 or Level3 at end of button name e.g. DistrictA_Level2 and appends it to the dataGrid output on the MouseHover.
What should the code read to resolve this problem that we have poured heart and soul into for 2 hours ?
Error is:-
Map_Collection.Mitre'sGate_Level2
TypeError: Error #1010: A term is undefined and has no properties.
at BusMap_fla::MainTimeline/ShowSymbols()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at fl.controls::SelectableList/handleCellRendererMouseEvent()
at fl.controls::DataGrid/handleCellRendererMouseEvent()
Code is:-
dg.addEventListener(ListEvent.ITEM_ROLL_OVER,ShowSymbols);
function ShowSymbols(e:ListEvent):void{
makeAllVisibleF(false);
var r:RegExp = /\W/g;
for(var s:String in e.item){
//trace(currentLevel)
if(e.item[s]){
var clipName :String = String(e.item[s]).replace(r,"")+currentLevel;
trace(clipName)
this[clipName].visible=true;
trace(s,e.item[s])
function makeAllVisibleF(b:Boolean):void{
Mitre'sGate_Level2.visible=b;
UpperDowning_Level2.visible=b
//Map_Collection.Tamar Brook_Level3.visible=b;
Map_Collection.Mitre'sGate_Level2.visible=b;
This code works on sttmnts directly on stage.
I show here an extract of the code visible=b; that follows it. we have such for every sttmnt. The first two lines are for those not in the MC container.
if we use:-
var clipName :String = "Map_Collection."+String(e.item[s]).replace(r,"")+currentLevel;
which is our best stab after trying various options, it fails with error above.
My compatriot says, in code !!!  
// This is what we want
Map_Collection.Mitre'sGate_Level2.visible=true
//This doesn’t work
Map_Collection.this[clipName].visible=true
//This works, when Mitre'sGate_Level2 is placed on the stage
Mitre'sGate_Level2.visible=true
//Placing Mitre'sGate_Level2 in movie clip Map_Collection How do we get it to work
We tried a variety of  options, even replacing 'this' with Map_Collection.., my best stab,  just what should the code be ?
Envirographics

Hi,
Not sure of that, (also now have edited csv to no gaps or apostrphes, still it fails) ...because the code I posted is the code we are successfully running in a test file where there is a dataGrid fed a csv with such as Mitre's Gate Collet's Reach etc.  This code removes the  apostrophes and gaps when user hovers datagrid, MC's spelt MitresGate etc are identified and appear, then hide again when another row is hovered. Note also as said, Mitre's Gate outside of MC Map_Collection is found and shows.
The code in this test file (which is 3 columns) is:-
import flash.net.URLLoader;
import flash.events.Event;
import flash.net.URLRequest;
import fl.data.DataProvider;
import fl.controls.DataGrid;
import fl.events.ListEvent
makeAllVisibleF(false);
var urlLoader:URLLoader = new URLLoader();
urlLoader.addEventListener(Event.COMPLETE,completeF);
urlLoader.load(new URLRequest("NamesWithNullCellsGapsApostrophes.csv"));
var dg:DataGrid
function completeF(e:Event):void{
    var dataS:String = e.target.data;
    var dataA:Array = dataS.split("\n").join("").split("\r");
    var dpA:Array = [];
    var itemA:Array;
var r:RegExp = /\W/g;
    for(var i:int=0;i<dataA.length;i++){
        itemA = dataA[i].split(",");
         dpA.push({"col1":itemA[0],"col2":itemA[1],"col3":itemA[2]});
var dp:DataProvider = new DataProvider(dpA);
    dg.columns = ["col1","col2","col3"]
    dg.dataProvider = dp;
dg.addEventListener(ListEvent.ITEM_ROLL_OVER,ShowSymbols);
function ShowSymbols(e:ListEvent):void{
makeAllVisibleF(false);
var r:RegExp = /\W/g;
for(var s:String in e.item){
if(e.item[s]){
var clipName :String = String(e.item[s]).replace(r,"");
this[clipName].visible=true;
trace(s,e.item[s])
function makeAllVisibleF(b:Boolean):void{
We have introduced to that the code by Kglad, or so we hope, that appends to the output from OnHover  _Level2 or _Level3 depending on which District button is clicked on, DistrictA_Level2 or DistrictA_Level3.
Just to recap/describe what we are aiming at, a map has 6 districts, user clicks District A button named in instance DistrictA_Level 2and is taken to that District, a dataGrid appears and when user hovers a row, the settlements for that layer of the map, e.g. Mitre's Gate_Layer2  appear. csv just has Mitre's Gate. user clicks on DistrictA_Level3 button and hover will show Mitre's Gate_L
 evel3 symbol. 
Kglad code:-
var currentLevel:String="_Level2";
dg.addEventListener(ListEvent.ITEM_ROLL_OVER,ShowSymbols);
function ShowSymbols(e:ListEvent):void{
makeAllVisibleF(false);
var r:RegExp = /\W/g;
for(var s:String in e.item){
if(e.item[s]){
var clipName :String = String(e.item[s]).replace(r,"")+currentLevel;
this[clipName].visible=true;
trace(s,e.item[s])
and when asked how one gets the Level2 into that var when user clicks on e.g. DistrictA_Level2
we now have, for the 12 buttons we have named, reply from Kglad
 :-• DistrictA_Level2.addEventListener(MouseEvent.CLICK, clickF);
DistrictB_Level2.addEventListener(MouseEvent.CLICK, clickF);
DistrictF_Level2.addEventListener(MouseEvent.CLICK, clickF);
DistrictA_Level3.addEventListener(MouseEvent.CLICK, clickF);
DistrictB_Level3.addEventListener(MouseEvent.CLICK, clickF);
DistrictF_Level3.addEventListener(MouseEvent.CLICK, clickF);
var currentLevel:String;
function clickF(e:MouseEvent):void{
currentLevel="_"+e.currentTarnget.name.split("_")[1];
for the moment we are focusing on getting it operational on just button DistrictA_Level2
As said works fine if MC Mitre's Gate sits on stage, so the apostrophy and gap stripping is working as is the appending of the wording after and including the _ from the District button !  Place the settlement MC into Map_Collection MC and it fails.
Envirographics

Similar Messages

  • Why does Event.ENTER_FRAME cause this code to stop working? Is there a better alternative?

    I programmed the following code so that an array of buttons
    can be dragged across the screen when either on :
    var buttons:Array=[button1, button2, button3];
    for (var i:uint=0; i<buttons.length; i++)
    buttons[i].addEventListener(MouseEvent.CLICK, alignButtons )
    function alignButtons (e:Event)
         for (var i2:uint=0; i2<buttons.length; i2++)
          if(buttons[i2]!=e.target){buttons[i2].x=e.target.x;}
         for (var i3:uint=0; i3<buttons.length; i3++)
         buttons[i3].addEventListener(MouseEvent.MOUSE_DOWN, buttonDrag);
         function buttonDrag (e:Event)
        e.target.startDrag();
        e.target.addEventListener(MouseEvent.MOUSE_UP, buttonDrop);
        function buttonDrop(e:Event)
              e.target.stopDrag();    
    It works pretty much how I'd like it to work, except for the fact that I have to click the mouse to update the screen. However, when I change the first event listener from "MouseEvent.CLICK" to "Event.ENTER_FRAME" the code goes haywire. Is there another event listener I should be using here?

    Due to what appears to be an incomplete set of curly braces, it is hard to tell how much nesting you have there, but there should be none.  Each listener and event handler function should be able to stand on its own.  You should not have to put any functions inside a loop.
    Having the CLICK event listener is redundant if you have a MOUSE_DOWN and a MOUSE_UP because a MOUSE_DOWN followed by a MOUSE_UP is a CLICK. 
    If your goal is to have the buttons all follow each other around x-wise, then what you can do is assign a MOUSE_MOVE event listener at the same time you execute the startDrag and use its event handler for adjust button positions.  When you stopDrag, you also remove the MOUSE_MOVE listener.
    As far as why things go haywire when you change to using an ENTER_FRAME, you should show the code when it is in that form so that whatever error is evident.

  • I have an email account causes the machine to hang up after being in use for a day.  It only occurs on my Macbook Pro and only one particular account.  The problem account works fine on my iMac and Windows Machines.  Any ideas what is causing this?

    I have an email account causes the machine to hang up after being in use for a day.  It only occurs on my Macbook Pro and only one particular account.  The problem account works fine on my iMac and Windows Machines.  I have been to the local Genius bar and through trial and error we have determined that Mail is working ok but somehow the account is causing the problem.  I have used this account for years.  Any ideas what is causing this?

    No idea why, but one thing you may try if you have the time, is create a new user, and set up the problem mail account in the new user space. See if it causes your MBP to hang as well.  That will tell you if it is something wrong with your main User, or something wrong with MBP.
    Assuming this works, I'd nuke the problem account in your main user space, re-start, and reinititate the account and see if that helps.
    Depening on how many email accounts you have setup, it may be necessary to nuke the whole Mail folder in your User/Library....   Hard way to get it to work, but just my idea.

  • Can you tell me what this code does?

    Can you tell me what this code does?
    import java.io.*;
    class Assignment1
    public static String[][] tdi = {     {"Paris", "418", "Rome", "55"},
                             {"Liverpool", "121", "Copenhagen", "35"},
                             {"Liverpool", "418", "Paris", "50"},
                             {"Liverpool", "553", "Frankfurt", "55"},
                             {"Frankfurt", "553", "Budapest", "50"},
                             {"Amsterdam", "121", "Madrid", "65"},
                             {"Amsterdam", "418", "Paris", "35"},
                             {"Madrid", "121", "Stockholm", "90"},
                             {"Budapest", "553", "Warsaw", "30"},
                             {"Copenhagen", "121", "Amsterdam", "35"},
                             {"Rome", "418", "Amsterdam", "60"},
    //--Start Method--
    public static void main( String args[] ) throws IOException
    System.out.println("Welcome to NoWings Airline.");
    InputStreamReader input = new InputStreamReader(System.in);
    BufferedReader keyboardInput = new BufferedReader(input);
    System.out.println("Please enter the airport you wish to depart from:");
    String[] info = TDIDLL.searchDest( keyboardInput.readLine() );
    if (info == null)
    System.out.println("Sorry, no plane to this destination");
    else
    System.out.println(info[0]+" departing at platform "+info[1]); }}
    public static String[] searchDest( String dest )
    String[] result = null;
    for(int i = 0; i < tdi.length; i++)
         if (tdi[1].equals(dest)) {
         result = new String[2];
         result[0] = tdi[i][0];
         result[1] = tdi[i][2];
         return result;
    return result; }
    // Info Method //
    // Fly Method //
    // Exit Method //
    Thanks. Also, can you tell me where I have gone wrong in the code.
    Much appreciated.

    Can you tell me what this code does?Why don't you run it and find out for yourself?

  • This code cannot possibly fail. Why is it failing?

    LV 2010 (yes, 2010), Win Vista.
    I have a DISPLAY UPDATE event, occurring at 2 Hz.
    The event carries an array of values, one for each channel.
    Four CHANNEL SELECTORS drive an ARRAY INDEX operation.
    The four selected channels are shown separately on numeric indicators, then combined on to a waveform chart.
    The little subVIs are there to produce a NaN for charting if the channel selector is -1 (none).
    Currently they are changed to output a "123.0" value, for debugging purposes.
    The HELP says that the ARRAY INDEX will produce a default 0 if the input index is outside the bounds of the array.
    Yet, under certain circumstances (see JING at http://screencast.com/t/0kO0GDhlo0E), the "CHART VALUE" indicators fail to update.
    In that video, I set the indicators to values of 1, 2, 3, 4 before starting the program.
    I DO NOT set the DEFAULT, just enter those numbers into the panel indicators.
    The two which have selected channels are updated seemingly normally.  The other two, which are left at NONE (-1) do not update.
    I would expect them to show a zero, or SOMETHING, but the "3" and "4" never change.
    This code is called, as evidenced by the chart advancing, but the values do not change.
    If I change the channel to a live channel, then back to NONE, it will return to 0.  That's expected.
    But why doesn't it update at first?
    If I swap the channel selectors around, the problem swaps with it. Any selector set on NONE has the corresponding indicator unchanged from the starting value.
    ABOUT THE CODE:
    This is a REENTRANT VI,  inserted into a SUBPANEL.
    Here's the insertion code:
    The idea is that each control on the page is a subpanel, each will receive an instance of this one VI.
    For each subpanel, I open a new re-entrant ref to this VI (it's set to be reentrant), and insert that ref into the subpanel.
    I set a couple of control values, and start it running.
    KEY FACTS:
    1... If I change OPTIONS = 8 to OPTIONS = 0 in the above, the problem goes away. Everything works as expected.
    2... The N=1 in the above, is simply to limit the number of instances, for debugging purposes.
    3... I get no errors at any time.
    4... I've tried with and without a wire to the TYPE SPECIFIER VI REFNUM input of OPEN VI REFERENCE.  No change.
    A search on this topic brings up some 2008 issues with LV 8.0, and a suggestion there to use a VIT as the item inserted had no effect here.
    So, why does the indicator NOT update if the index is -1, at first?  It's as if the code is not there.
    And why does making it non-reentrant fix it?
    (I have to have it reentrant so I can have multiple instances).
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks
    Solved!
    Go to Solution.

    I don't know how to probe that in the real situation.
    If I put a probe there, it doesn't tell me anything, because it's a re-entrant copy that's actually running: the probe is on the original VI which isn't.
    If I make it non-reentrant, the problem goes away.
    KEY FACTS:
    8... Moving the indicators OFF the tab page does nothing different.
    9... another page of the inner tab has more text indicators (20) instead of a chart. (see pic below).  That page shows the same behavior.  Any selector inditialized to -1 fails to update until it is first set to an active channel.
    10... It doesn't matter if the selector values are converted to I32 or not (not that I would expect it to).
    11.. The selectors are given a STRINGS & VALUES property of ["< None >", -1] by the init code, or ["Speed", 2} or ["Torque", 3] or something if the channel is found in the settings file.  When you click on it, I populated the menu with all channels and all indexes.  Wonder if there's something wonky with that.
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • HT5022 When I tried installing this software, I get this error:  "The installer encountered an error that caused the installation to fail.  contact the software manufacturer for assistance."  Any idea why?  My computer is Mac OS X Version 10.7.5

    When I tried installing this software, I get this error:  "The installer encountered an error that caused the installation to fail.  contact the software manufacturer for assistance."  Any idea why?  My computer is Mac OS X Version 10.7.5

    What software are you trying to install?

  • What causes this message "Photoshop 13.1.2 for Creative Cloud Installation failed. Error Code: U44M1P7"?

    What causes error code: U44M1P7? I have rebooted my machine multiple times and continue to get the same results.

    Photoshop: Basic Troubleshooting steps to fix most issues
    ISSUE: Installation failed. Error Code: U44M1P7, U44M2P7, U44M1P6
    SOLUTION: Run the installer. Reinstall Photoshop CS6 to repair/replace the missing/modified file. Select Help>Updates… to run the updater again. http://helpx.adobe.com/creative-suite/kb/error-u44m1p7-installing-updates-ccm.html

  • Why does this code fail in command line?

    I am using the "ListDemo" from the java swing tutorial. If I compile it on the command line
    javac ListDemo.java
    It compiles fine. Then when I run it, it says:
    C:\Development\Java\Projects\Projects>java ListDemo
    Exception occurred during event dispatching:
    java.lang.NoSuchMethodError
    at ListDemo.createAndShowGUI(ListDemo.java:196)
    at ListDemo.access$400(ListDemo.java:7)
    at ListDemo$1.run(ListDemo.java:217)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Yet when I load up the same file into Netbeans, it compiles and runs fine! Here is the file:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    /* ListDemo.java is a 1.4 application that requires no other files. */
    public class ListDemo extends JPanel
                          implements ListSelectionListener {
        private JList list;
        private DefaultListModel listModel;
        private static final String hireString = "Hire";
        private static final String fireString = "Fire";
        private JButton fireButton;
        private JTextField employeeName;
        public ListDemo() {
            super(new BorderLayout());
            listModel = new DefaultListModel();
            listModel.addElement("Alan Sommerer");
            listModel.addElement("Alison Huml");
            listModel.addElement("Kathy Walrath");
            listModel.addElement("Lisa Friendly");
            listModel.addElement("Mary Campione");
            listModel.addElement("Sharon Zakhour");
            //Create the list and put it in a scroll pane.
            list = new JList(listModel);
            list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            list.setSelectedIndex(0);
            list.addListSelectionListener(this);
            list.setVisibleRowCount(5);
            JScrollPane listScrollPane = new JScrollPane(list);
            JButton hireButton = new JButton(hireString);
            HireListener hireListener = new HireListener(hireButton);
            hireButton.setActionCommand(hireString);
            hireButton.addActionListener(hireListener);
            hireButton.setEnabled(false);
            fireButton = new JButton(fireString);
            fireButton.setActionCommand(fireString);
            fireButton.addActionListener(new FireListener());
            employeeName = new JTextField(10);
            employeeName.addActionListener(hireListener);
            employeeName.getDocument().addDocumentListener(hireListener);
            String name = listModel.getElementAt(
                                  list.getSelectedIndex()).toString();
            //Create a panel that uses BoxLayout.
            JPanel buttonPane = new JPanel();
            buttonPane.setLayout(new BoxLayout(buttonPane,
                                               BoxLayout.LINE_AXIS));
            buttonPane.add(fireButton);
            buttonPane.add(Box.createHorizontalStrut(5));
            buttonPane.add(new JSeparator(SwingConstants.VERTICAL));
            buttonPane.add(Box.createHorizontalStrut(5));
            buttonPane.add(employeeName);
            buttonPane.add(hireButton);
            buttonPane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
            add(listScrollPane, BorderLayout.CENTER);
            add(buttonPane, BorderLayout.PAGE_END);
        class FireListener implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                //This method can be called only if
                //there's a valid selection
                //so go ahead and remove whatever's selected.
                int index = list.getSelectedIndex();
                listModel.remove(index);
                int size = listModel.getSize();
                if (size == 0) { //Nobody's left, disable firing.
                    fireButton.setEnabled(false);
                } else { //Select an index.
                    if (index == listModel.getSize()) {
                        //removed item in last position
                        index--;
                    list.setSelectedIndex(index);
                    list.ensureIndexIsVisible(index);
        //This listener is shared by the text field and the hire button.
        class HireListener implements ActionListener, DocumentListener {
            private boolean alreadyEnabled = false;
            private JButton button;
            public HireListener(JButton button) {
                this.button = button;
            //Required by ActionListener.
            public void actionPerformed(ActionEvent e) {
                String name = employeeName.getText();
                //User didn't type in a unique name...
                if (name.equals("") || alreadyInList(name)) {
                    Toolkit.getDefaultToolkit().beep();
                    employeeName.requestFocusInWindow();
                    employeeName.selectAll();
                    return;
                int index = list.getSelectedIndex(); //get selected index
                if (index == -1) { //no selection, so insert at beginning
                    index = 0;
                } else {           //add after the selected item
                    index++;
                listModel.insertElementAt(employeeName.getText(), index);
                //If we just wanted to add to the end, we'd do this:
                //listModel.addElement(employeeName.getText());
                //Reset the text field.
                employeeName.requestFocusInWindow();
                employeeName.setText("");
                //Select the new item and make it visible.
                list.setSelectedIndex(index);
                list.ensureIndexIsVisible(index);
            //This method tests for string equality. You could certainly
            //get more sophisticated about the algorithm.  For example,
            //you might want to ignore white space and capitalization.
            protected boolean alreadyInList(String name) {
                return listModel.contains(name);
            //Required by DocumentListener.
            public void insertUpdate(DocumentEvent e) {
                enableButton();
            //Required by DocumentListener.
            public void removeUpdate(DocumentEvent e) {
                handleEmptyTextField(e);
            //Required by DocumentListener.
            public void changedUpdate(DocumentEvent e) {
                if (!handleEmptyTextField(e)) {
                    enableButton();
            private void enableButton() {
                if (!alreadyEnabled) {
                    button.setEnabled(true);
            private boolean handleEmptyTextField(DocumentEvent e) {
                if (e.getDocument().getLength() <= 0) {
                    button.setEnabled(false);
                    alreadyEnabled = false;
                    return true;
                return false;
        //This method is required by ListSelectionListener.
        public void valueChanged(ListSelectionEvent e) {
            if (e.getValueIsAdjusting() == false) {
                if (list.getSelectedIndex() == -1) {
                //No selection, disable fire button.
                    fireButton.setEnabled(false);
                } else {
                //Selection, enable the fire button.
                    fireButton.setEnabled(true);
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
        private static void createAndShowGUI() {
            //Make sure we have nice window decorations.
            JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            JFrame frame = new JFrame("ListDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            JComponent newContentPane = new ListDemo();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();

    You are not running this code under JDK 1.4
    The setDefaultLookAndFeelDecorated method requires JDK 1.4 version.

  • Why this code is not working??? java script

    gen_validatorv2.js
         JavaScript Form Validator
    Version 2.0.2
         Copyright 2003 JavaScript-coder.com. All rights reserved.
         You use this script in your Web pages, provided these opening credit
    lines are kept intact.
         The Form validation script is distributed free from JavaScript-Coder.com
         You may please add a link to JavaScript-Coder.com,
         making it easy for others to find this script.
         Checkout the Give a link and Get a link page:
         http://www.javascript-coder.com/links/how-to-link.php
    You may not reprint or redistribute this code without permission from
    JavaScript-Coder.com.
         JavaScript Coder
         It precisely codes what you imagine!
         Grab your copy here:
              http://www.javascript-coder.com/
    function Validator(frmname)
    this.formobj=document.forms[frmname];
         if(!this.formobj)
         alert("BUG: couldnot get Form object "+frmname);
              return;
         if(this.formobj.onsubmit)
         this.formobj.old_onsubmit = this.formobj.onsubmit;
         this.formobj.onsubmit=null;
         else
         this.formobj.old_onsubmit = null;
         this.formobj.onsubmit=form_submit_handler;
         this.addValidation = add_validation;
         this.setAddnlValidationFunction=set_addnl_vfunction;
         this.clearAllValidations = clear_all_validations;
    function set_addnl_vfunction(functionname)
    this.formobj.addnlvalidation = functionname;
    function clear_all_validations()
         for(var itr=0;itr < this.formobj.elements.length;itr++)
              this.formobj.elements[itr].validationset = null;
    function form_submit_handler()
         for(var itr=0;itr < this.elements.length;itr++)
              if(this.elements[itr].validationset &&
         !this.elements[itr].validationset.validate())
              return false;
         if(this.addnlvalidation)
         str =" var ret = "+this.addnlvalidation+"()";
         eval(str);
    if(!ret) return ret;
         return true;
    function add_validation(itemname,descriptor,errstr)
    if(!this.formobj)
         alert("BUG: the form object is not set properly");
              return;
         }//if
         var itemobj = this.formobj[itemname];
    if(!itemobj)
         alert("BUG: Couldnot get the input object named: "+itemname);
              return;
         if(!itemobj.validationset)
         itemobj.validationset = new ValidationSet(itemobj);
    itemobj.validationset.add(descriptor,errstr);
    function ValidationDesc(inputitem,desc,error)
    this.desc=desc;
         this.error=error;
         this.itemobj = inputitem;
         this.validate=vdesc_validate;
    function vdesc_validate()
    if(!V2validateData(this.desc,this.itemobj,this.error))
    this.itemobj.focus();
              return false;
    return true;
    function ValidationSet(inputitem)
    this.vSet=new Array();
         this.add= add_validationdesc;
         this.validate= vset_validate;
         this.itemobj = inputitem;
    function add_validationdesc(desc,error)
    this.vSet[this.vSet.length]=
         new ValidationDesc(this.itemobj,desc,error);
    function vset_validate()
    for(var itr=0;itr<this.vSet.length;itr++)
         if(!this.vSet[itr].validate())
              return false;
         return true;
    function validateEmailv2(email)
    // a very simple email validation checking.
    // you can add more complex email checking if it helps
    if(email.length <= 0)
         return true;
    var splitted = email.match("^(.+)@(.+)$");
    if(splitted == null) return false;
    if(splitted[1] != null )
    var regexp_user=/^\"?[\w-_\.]*\"?$/;
    if(splitted[1].match(regexp_user) == null) return false;
    if(splitted[2] != null)
    var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
    if(splitted[2].match(regexp_domain) == null)
         var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
         if(splitted[2].match(regexp_ip) == null) return false;
    }// if
    return true;
    return false;
    function V2validateData(strValidateStr,objValue,strError)
    var epos = strValidateStr.search("=");
    var command = "";
    var cmdvalue = "";
    if(epos >= 0)
    command = strValidateStr.substring(0,epos);
    cmdvalue = strValidateStr.substr(epos+1);
    else
    command = strValidateStr;
    switch(command)
    case "req":
    case "required":
    if(eval(objValue.value.length) == 0)
    if(!strError || strError.length ==0)
    strError = objValue.name + " : Required Field";
    }//if
    alert(strError);
    return false;
    }//if
    break;
    }//case required
    case "maxlength":
    case "maxlen":
    if(eval(objValue.value.length) > eval(cmdvalue))
    if(!strError || strError.length ==0)
    strError = objValue.name + " : "+cmdvalue+" characters maximum ";
    }//if
    alert(strError + "\n[Current length = " + objValue.value.length + " ]");
    return false;
    }//if
    break;
    }//case maxlen
    case "minlength":
    case "minlen":
    if(eval(objValue.value.length) < eval(cmdvalue))
    if(!strError || strError.length ==0)
    strError = objValue.name + " : " + cmdvalue + " characters minimum ";
    }//if
    alert(strError + "\n[Current length = " + objValue.value.length + " ]");
    return false;
    }//if
    break;
    }//case minlen
    case "alnum":
    case "alphanumeric":
    var charpos = objValue.value.search("[^A-Za-z0-9]");
    if(objValue.value.length > 0 && charpos >= 0)
    if(!strError || strError.length ==0)
    strError = objValue.name+": Only alpha-numeric characters allowed ";
    }//if
    alert(strError + "\n [Error character position " + eval(charpos+1)+"]");
    return false;
    }//if
    break;
    }//case alphanumeric
    case "num":
    case "numeric":
    var charpos = objValue.value.search("[^0-9]");
    if(objValue.value.length > 0 && charpos >= 0)
    if(!strError || strError.length ==0)
    strError = objValue.name+": Only digits allowed ";
    }//if
    alert(strError + "\n [Error character position " + eval(charpos+1)+"]");
    return false;
    }//if
    break;
    }//numeric
    case "alphabetic":
    case "alpha":
    var charpos = objValue.value.search("[^A-Za-z]");
    if(objValue.value.length > 0 && charpos >= 0)
    if(!strError || strError.length ==0)
    strError = objValue.name+": Only alphabetic characters allowed ";
    }//if
    alert(strError + "\n [Error character position " + eval(charpos+1)+"]");
    return false;
    }//if
    break;
    }//alpha
              case "alnumhyphen":
    var charpos = objValue.value.search("[^A-Za-z0-9\-_]");
    if(objValue.value.length > 0 && charpos >= 0)
    if(!strError || strError.length ==0)
    strError = objValue.name+": characters allowed are A-Z,a-z,0-9,- and _";
    }//if
    alert(strError + "\n [Error character position " + eval(charpos+1)+"]");
    return false;
    }//if                
                   break;
    case "email":
    if(!validateEmailv2(objValue.value))
    if(!strError || strError.length ==0)
    strError = objValue.name+": Enter a valid Email address ";
    }//if
    alert(strError);
    return false;
    }//if
    break;
    }//case email
    case "lt":
    case "lessthan":
    if(isNaN(objValue.value))
    alert(objValue.name+": Should be a number ");
    return false;
    }//if
    if(eval(objValue.value) >= eval(cmdvalue))
    if(!strError || strError.length ==0)
    strError = objValue.name + " : value should be less than "+ cmdvalue;
    }//if
    alert(strError);
    return false;
    }//if
    break;
    }//case lessthan
    case "gt":
    case "greaterthan":
    if(isNaN(objValue.value))
    alert(objValue.name+": Should be a number ");
    return false;
    }//if
    if(eval(objValue.value) <= eval(cmdvalue))
    if(!strError || strError.length ==0)
    strError = objValue.name + " : value should be greater than "+ cmdvalue;
    }//if
    alert(strError);
    return false;
    }//if
    break;
    }//case greaterthan
    case "regexp":
                   if(objValue.value.length > 0)
         if(!objValue.value.match(cmdvalue))
         if(!strError || strError.length ==0)
         strError = objValue.name+": Invalid characters found ";
         }//if
         alert(strError);
         return false;
         }//if
    break;
    }//case regexp
    case "dontselect":
    if(objValue.selectedIndex == null)
    alert("BUG: dontselect command for non-select Item");
    return false;
    if(objValue.selectedIndex == eval(cmdvalue))
    if(!strError || strError.length ==0)
    strError = objValue.name+": Please Select one option ";
    }//if
    alert(strError);
    return false;
    break;
    }//case dontselect
    }//switch
    return true;
         Copyright 2003 JavaScript-coder.com. All rights reserved.
    example.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Example for Validator</title>
    <script language="JavaScript" src="gen_validatorv2.js" type="text/javascript"></script>
    </head>
    <body>
    <form action="" name="myform" >
    <table cellspacing="2" cellpadding="2" border="0">
    <tr>
    <td align="right">First Name</td>
    <td><input type="text" name="FirstName"></td>
    </tr>
    <tr>
    <td align="right">Last Name</td>
    <td><input type="text" name="LastName"></td>
    </tr>
    <tr>
    <td align="right">EMail</td>
    <td><input type="text" name="Email"></td>
    </tr>
    <tr>
    <td align="right">Phone</td>
    <td><input type="text" name="Phone"></td>
    </tr>
    <tr>
    <td align="right">Address</td>
    <td><textarea cols="20" rows="5" name="Address"></textarea></td>
    </tr>
    <tr>
    <td align="right">Country</td>
    <td>
         <SELECT name="Country">
              <option value="" selected>[choose yours]
              <option value="008">Albania
              <option value="012">Algeria
              <option value="016">American Samoa
              <option value="020">Andorra
              <option value="024">Angola
              <option value="660">Anguilla
              <option value="010">Antarctica
              <option value="028">Antigua And Barbuda
              <option value="032">Argentina
              <option value="051">Armenia
              <option value="533">Aruba     
         </SELECT>
         </td>
    </tr>
    <tr>
    <td align="right"></td>
    <td><input type="submit" value="Submit"></td>
    </tr>
    </table>
    </form>
    <script language="JavaScript" type="text/javascript">
    //You should create the validator only after the definition of the HTML form
    var frmvalidator = new Validator("myform");
    frmvalidator.addValidation("FirstName","req","Please enter your First Name");
    frmvalidator.addValidation("FirstName","maxlen=20",
         "Max length for FirstName is 20");
    frmvalidator.addValidation("FirstName","alpha");
    frmvalidator.addValidation("LastName","req");
    frmvalidator.addValidation("LastName","maxlen=20");
    frmvalidator.addValidation("Email","maxlen=50");
    frmvalidator.addValidation("Email","req");
    frmvalidator.addValidation("Email","email");
    frmvalidator.addValidation("Phone","maxlen=50");
    frmvalidator.addValidation("Phone","numeric");
    frmvalidator.addValidation("Address","maxlen=50");
    frmvalidator.addValidation("Country","dontselect=0");
    </script>
    </body>
    </html>
    documentation.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
         <title>JavaScript Form Validator Documentation</title>
    <Style>
    BODY, P,TD{ font-family: Arial,Verdana,Helvetica, sans-serif; font-size: 10pt }
    H1{ font-family: Arial,Verdana,Helvetica, sans-serif; font-size: 18pt; color : #000066}
    H3{ font-family: Arial,Verdana,Helvetica, sans-serif; font-size: 12pt; color : #000066 }
    A{font-family: Arial,Verdana,Helvetica, sans-serif;}
    B {     font-family : Arial, Helvetica, sans-serif;     font-size : 12px;     font-weight : bold;}
    CODE {font-family : Courier,monospace;font-size: 10pt;color : #800000;}
    CODE.htm {font-family : "Courier New", Courier, monospace;     font-size : x-small;     color : #000080;}
    </Style>
    </head>
    <body>
    <center>
    <table cellspacing="2" cellpadding="2" border="0" width="600">
    <tr><td>
         <h1>JavaScript Form Validations Made Easy!</h1>
         <h3>Documentation for JavaScript Form Validator</h3>
         <HR size=1>
         <P>
         The Form validation script is distributed free from JavaScript-Coder.com<br>
         You can use the script in your web pages for free.
         </P>
         <P>
         You may please add a link to JavaScript-Coder.com,
         making it easy for others to find this script.<br>
         Checkout the <A href="http://www.javascript-coder.com/links/how-to-link.php
         target="_blank">Give a Link & Get a Link!</A> page.
         </P>
         <P>
         <B>JavaScript Coder</B><br>
         It precisely codes what you imagine!<br>
         Grab your copy here: http://www.javascript-coder.com
         </P>
         <HR size=1>
         <P>
         Using client side JavaScript is an efficient way to validate the user input
         in web applications. When there are many fields in the form, the JavaScript
         validation becomes too complex.
         </P>
         <P>
    The JavaScript class presented here makes the form validations many times easier.
         </P>
         <P>
         The idea is to create a set of "validation descriptors" associated with each element
         in a form. The "validation descriptor" is nothing but a string specifying the type of
         validation to be performed.
         </P>
         <P>
         Each field in the form can have 0, 1, or more validations. For example, the input should
         not be empty, should be less than 25 chars, should be alpha-numeric, etc
         </P>
         You can associate a set of validation descriptors for each input field in the form.
         <a name="3"></a>
         <h3>Using The Script</h3>
         1.Include gen_validatorv2.js in your html file just before closing the HEAD tag<br><br>
         <CODE>
         <script language="JavaScript" src="gen_validatorv2.js" type="text/javascript"></script><BR>
         </head><BR>
         </CODE><br>
         2. Just after defining your form,
         Create a form validator object passing the name of the form<br><br>
         <CODE class='htm'>
          <FORM name='myform' action=""><BR>
          <!----Your input fields go here --><BR>
          </FORM><BR>
         </CODE><CODE>
          <SCRIPT language="JavaScript"><BR>
          var frmvalidator  = new Validator("myform");<BR>
         </CODE>
         <br>
         <br>
         3. Now add the validations required<br><br>
         <CODE>
              frmvalidator.addValidation("FirstName","alpha");
         </CODE><br><br>
         the first argument is the name of the field and the second argument is the
         validation descriptor, which specifies the type of validation to be performed.<br>
         You can add any number of validations.The list of validation descriptors are provided
         at the end of the documentation.<br>
         The optional third argument is the error string to be displayed if the validation
         fails.<br>
         <br>
         <CODE>
              frmvalidator.addValidation("FirstName","alpha");<br>
              frmvalidator.addValidation("FirstName","req","Please enter your First Name");<br>
              frmvalidator.addValidation("FirstName","maxlen=20",<br>
                   "Max length for FirstName is 20");          <br>
         </CODE>     <br>
         <br>
         4. Similarly, add validations for the fields where validation is required.<br>
         That's it! You are ready to go.
         <A name="3"></A>
         <h3>Example</h3>
         The example below will make the idea clearer<br>
         <CODE class="htm">
                   <form action="" name="myform" ><BR>
                   <table cellspacing="2" cellpadding="2" border="0"><BR>
                   <tr><BR>
                     <td align="right">First Name</td><BR>
                     <td><input type="text" name="FirstName"></td><BR>
                   </tr><BR>
                   <tr><BR>
                     <td align="right">Last Name</td><BR>
                     <td><input type="text" name="LastName"></td><BR>
                   </tr><BR>
                   <tr><BR>
                     <td align="right">EMail</td><BR>
                     <td><input type="text" name="Email"></td><BR>
                   </tr><BR>
                   <tr><BR>
                     <td align="right">Phone</td><BR>
                     <td><input type="text" name="Phone"></td><BR>
                   </tr><BR>
                   <tr><BR>
                     <td align="right">Address</td><BR>
                     <td><textarea cols="20" rows="5" name="Address"></textarea></td><BR>
                   </tr><BR>
                   <tr><BR>
                     <td align="right">Country</td><BR>
                     <td><BR>
                          <SELECT name="Country"><BR>
                             <option value="" selected>[choose yours]<BR>
                             <option value="008">Albania<BR>
                             <option value="012">Algeria<BR>
                             <option value="016">American Samoa<BR>
                             <option value="020">Andorra<BR>
                             <option value="024">Angola<BR>
                             <option value="660">Anguilla<BR>
                             <option value="010">Antarctica<BR>
                             <option value="028">Antigua And Barbuda<BR>
                             <option value="032">Argentina<BR>
                             <option value="051">Armenia<BR>
                             <option value="533">Aruba     <BR>
                         </SELECT><BR>
                        </td><BR>
                   </tr><BR>
                   <tr><BR>
                     <td align="right"></td><BR>
                     <td><input type="submit" value="Submit"></td><BR>
                   </tr><BR>
                   </table><BR>
                   </form><BR>
                   </CODE><CODE>
                   <script language="JavaScript" type="text/javascript"><BR>
                    var frmvalidator = new Validator("myform");<BR>
                    frmvalidator.addValidation("FirstName","req","Please enter your First Name");<BR>
                    frmvalidator.addValidation("FirstName","maxlen=20",<BR>
                        "Max length for FirstName is 20");<BR>
                    frmvalidator.addValidation("FirstName","alpha");<BR>
                    <BR>
                    frmvalidator.addValidation("LastName","req");<BR>
                    frmvalidator.addValidation("LastName","maxlen=20");<BR>
                    <BR>
                    frmvalidator.addValidation("Email","maxlen=50");<BR>
                    frmvalidator.addValidation("Email","req");<BR>
                    frmvalidator.addValidation("Email","email");<BR>
                    <BR>
                    frmvalidator.addValidation("Phone","maxlen=50");<BR>
                    frmvalidator.addValidation("Phone","numeric");<BR>
                    <BR>
                    frmvalidator.addValidation("Address","maxlen=50");<BR>
                    frmvalidator.addValidation("Country","dontselect=0");<BR>
                   </script><BR>     
         </CODE>
         <A name="4"></A>
         <h3>Some Additional Notes</h3>
         <LI type="disc">The form validators should be created only after defining the HTML form
         (only after the </form> tag. )<br>
         <LI type="disc">Your form should have a distinguished name.
         If there are more than one form
         in the same page, you can add validators for each of them. The names of the
         forms and the validators should not clash.
         <LI type="disc">You can't use the javascript onsubmit event of the form if it you are
         using this validator script. It is because the validator script automatically overrides the
         onsubmit event. If you want to add a custom validation, see the section below
         </LI>
         <A name="5"></A>
         <h3>Adding Custom Validation</h3>
         If you want to add a custom validation, which is not provided by the validation descriptors,
         you can do so. Here are the steps:
         <LI type="disc">Create a javascript function which returns true or false depending on the validation.<br>
         <CODE>
              function DoCustomValidation()<BR>
              {<BR>
                var frm = document.forms["myform"];<BR>
                if(frm.pwd1.value != frm.pwd2.value)<BR>
                {<BR>
                  alert('The Password and verified password does not match!');<BR>
                  return false;<BR>
                }<BR>
                else<BR>
                {<BR>
                  return true;<BR>
                }<BR>
              }<BR>
         </CODE><br>
         <LI type="disc">Associate the validation function with the validator object.<br>
         <CODE>
         frmvalidator.setAddnlValidationFunction("DoCustomValidation");
         </CODE><br>
         </LI>
         <P>
         The custom validation function will be called automatically after other validations.
         </P>
         <P>
         If you want to do more than one custom validations, you can do all those
         validations in the same function.
         </P>
         <CODE>
              function DoCustomValidation()<BR>
              {<BR>
                var frm = document.forms["myform"];<BR>
                if(false == DoMyValidationOne())<BR>
                {<BR>
                  alert('Validation One Failed!');<BR>
                  return false;<BR>
                }<BR>
                else<BR>
                if(false == DoMyValidationTwo())<BR>
                {<BR>
                  alert('Validation Two Failed!');<BR>
                  return false;<BR>
                }<BR>
                else<BR>
                {<BR>
                  return true;<BR>
                }<BR>
              }<BR>
         </CODE><br>
         where DoMyValidationOne() and DoMyValidationTwo() are custom functions for
         validation.
         <A name="6"></A>
         <h3>Clear All Validations</h3>
         In some dynamically programmed pages, it may be required to change the validations in the
         form at run time. For such cases, a function is included which clears all validations in the
         validator object.<br><br>
         <CODE>
         frmvalidator.clearAllValidations();
         </CODE><br>
         <br>
         this function call clears all validations you set.<br>
         You will not need this method in most cases.
         <a name="7"></a>
         <h3>Table of Validation Descriptors</h3>     
    <table cellspacing="2" cellpadding="2" border="1" width="520px">
    <tr>
    <td><FONT face=Arial size=2>
         required<BR>
         req </FONT>
         </td>
    <td><FONT face=Arial size=2>The field should not be
    empty </FONT>
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>
         maxlen=???<BR>
         maxlength=???
         </td>
    <td><FONT face=Arial size=2>checks the length entered data to the maximum. For
    example, if the maximum size permitted is 25, give the validation descriptor as "maxlen=25"
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>
         minlen=???<BR>
         minlength=???
         </td>
    <td><FONT face=Arial size=2>checks the length of the entered string to the
    required minimum. example "minlen=5"
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>
         alphanumeric /<BR>
         alnum </FONT>
         </td>
    <td><FONT face=Arial size=2>Check the data if it
    contains any other characters other than alphabetic or numeric characters
    </FONT>
         </td>
    </tr>     
    <tr>
    <td><FONT face=Arial size=2>num <BR>
         numeric </FONT>
         </td>
    <td><FONT face=Arial size=2>Check numeric data
    </FONT>
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>alpha <BR>
         alphabetic </FONT>
         </td>
    <td><FONT face=Arial size=2>Check alphabetic data.
    </FONT>
         </td>
    </tr>     
    <tr>
    <td><FONT face=Arial size=2>email </FONT>
         </td>
    <td><FONT face=Arial size=2>The field is an email
    field and verify the validity of the data. </FONT>
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>lt=???<BR>
         lessthan=???
         </td>
    <td><FONT face=Arial size=2>
         Verify the data to be less than the value passed.
         Valid only for numeric fields. <BR>
         example: if the
    value should be less than 1000 give validation description as "lt=1000"
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>gt=???<BR>
         greaterthan=???     </td>
    <td><FONT face=Arial size=2>
         Verify the data to be greater than the value passed.
         Valid only for numeric fields. <BR>
         example: if the
    value should be greater than 10 give validation description as "gt=10"
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>regexp=??? </FONT>
         </td>
    <td><FONT face=Arial size=2>
         Check with a regular expression the value should match the regular expression.<BR>
         example: "regexp=^[A-Za-z]{1,20}$" allow up to 20 alphabetic
         characters.
         </td>
    </tr>
    <tr>
    <td><FONT face=Arial size=2>dontselect=?? </FONT>
         </td>
    <td><FONT face=Arial size=2>This
    validation descriptor is valid only for select input items (lists)
    Normally, the select list boxes will have one item saying 'Select One' or
    some thing like that. The user should select an option other than this
    option. If the index of this option is 0, the validation description
    should be "dontselect=0"
         </td>
    </tr>
    </table>
         <P>
              <table cellspacing="2" cellpadding="2" border="1" width="520">
              <tr>
              <td>
                   <B>NOTE:</B><br>
                   The HTML Form Wizard included in JavaScript Coder contains still more
                   number of validations
                   (comparison validations, check box & radio button validations and more)<br>
                   Using the wizard, you can add validations to your forms
                   without writing a single line of code! <br>
                   JavaScript Coder takes care of
                   generating the code and inserting the code in to the HTML file.<br>
                   <A href="http://www.javascript-coder.com/index.phtml
                   target="_blank">Read more about JavaScript Coder</A>
                   </td>
              </tr>
              </table>
         </P>
         <A name="8"></A>
         <h3>Example Page</h3>     
         See the <a href="example.html target="_blank"
         >JavaScript form validation example here</a>
    </td>
    </tr>
    <tr><td align="center">
         <HR><br>
         Copyright &copy; 2003 JavaScript-Coder.com. All rights reserved.
    </td></tr>
    </table>     
    </center>
    </body>
    </html>

    The code is not working because you made a mistake somewhere, duh! So figure out what (hint: firefox javascript console, it's your friend) and fix it!
    And next time when you post code: use the [ code ]  tags to pretty format your code, as it is now it's unreadable.
    http://forum.java.sun.com/help.jspa?sec=formatting

  • I am using itunes 10 and trying to consolidate my files.  I keep getting the error "Copying files failed.  The file name was invalid or too long".  How can I indentify what file is causing this problem or resolve this issue?

    I am using itunes 10 and trying to consolidate my files.  I keep getting the error "Copying files failed.  The file name was invalid or too long".  How can I indentify what file is causing this problem or resolve this issue?

    BUMP
    Yes, I just get that message. I don't see how I could investigate this problem.
    I didn't mention that this happened when I was consolidating my library, not copying files to another computer.
    In other words, I'm using a "normal" itunes procedure, itunes won't complete it, and won't tell me exactly why or how to figure out how to fix it...
    Is there at least some easy way to tell which files were successfully copied to my itunes music folder so I can work on moving the uncopied files?
    Can anybody help me?

  • TS3694 when restoring my iphone i get an error code of 1015 , why is this and how do i restore my phone as now its stuck in recovery mode ?

    when restoring my iphone i get an error code of 1015 , why is this and how do i restore my phone as now its stuck in recovery mode ?

    Errors related to downgrading iOS
    The required resource cannot be found: This alert message occurs when your device has a newer version of iOS than what is available in iTunes. When troubleshooting a device that presents this alert message, go to Settings > General > About and check the version of iOS on the device. If it is newer than the latest released iOS version, the device may have a prerelease developer version of iOS installed. Installing an older version of iOS over a newer version is not supported.
    Error 1015: This error is typically caused by attempts to downgrade the iPhone, iPad, or iPod touch's software. This can occur when you attempt to restore using an older .ipsw file. Downgrading to a previous version is not supported. To resolve this issue, attempt to restore with the latest iPhone, iPad, or iPod touch software available from Apple. This error can also occur when an unauthorized modification of the iOS has occurred and you are now trying to restore to an authorized, default state.

  • Creating new VM ends with Error code 3430 and 3040 in Hyper-V log. Does anyone have any insight into what might cause this?

    The new VM is being created via a P2V process run from SCVVM. It reaches a completion of 60% and dies. I asked about this in another question detail of the VVM can be seen at this link:
    http://social.technet.microsoft.com/Forums/en-US/virtualmachinemgrp2vv2v/thread/71aae7dc-13b5-46f1-b794-cc1b8085541f
    Running Win2008 R2 w/ Hyper-V role enabled & SCVVM 2008R2
    In any event I checked the Hyper-V logs to see if they might shead any light on the problem and there were two error messages associated with the attempted conversion. The first Event ID 3430
    Log Name:      Microsoft-Windows-Hyper-V-Worker-Admin
    Source:        Microsoft-Windows-Hyper-V-Worker
    Date:          5/23/2011 4:51:25 PM
    Event ID:      3430
    Task Category: None
    Level:         Error
    Keywords:     
    User:          NETWORK SERVICE
    Computer:      Virtual-Mgt.amrinc-corp.local
    Description:
    'test1' failed to set/change partition property: The system cannot find message text for message number 0xtest1 in the message file for 18568CA2-82E9-4A9F-B462-701D8FB4C447. '0x8007013D'.
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Microsoft-Windows-Hyper-V-Worker" Guid="{51DDFA29-D5C8-4803-BE4B-2ECB715570FE}" />
        <EventID>3430</EventID>
        <Version>0</Version>
        <Level>2</Level>
        <Task>0</Task>
        <Opcode>0</Opcode>
        <Keywords>0x8000000000000000</Keywords>
        <TimeCreated SystemTime="2011-05-23T21:51:25.956775200Z" />
        <EventRecordID>1</EventRecordID>
        <Correlation />
        <Execution ProcessID="3316" ThreadID="2716" />
        <Channel>Microsoft-Windows-Hyper-V-Worker-Admin</Channel>
        <Computer>Virtual-Mgt.amrinc-corp.local</Computer>
        <Security UserID="S-1-5-20" />
      </System>
      <UserData>
        <VmlEventLog xmlns:auto-ns2="http://schemas.microsoft.com/win/2004/08/events" xmlns="http://www.microsoft.com/Windows/Virtualization/Events">
          <VmName>test1</VmName>
          <VmId>18568CA2-82E9-4A9F-B462-701D8FB4C447</VmId>
          <ErrorCodeString>%%2147942717</ErrorCodeString>
          <ErrorCode>0x8007013D</ErrorCode>
        </VmlEventLog>
      </UserData>
    </Event>
    And the second Event ID 3040
    Log Name:      Microsoft-Windows-Hyper-V-Worker-Admin
    Source:        Microsoft-Windows-Hyper-V-Worker
    Date:          5/23/2011 4:51:25 PM
    Event ID:      3040
    Task Category: None
    Level:         Error
    Keywords:     
    User:          NETWORK SERVICE
    Computer:      Virtual-Mgt.amrinc-corp.local
    Description:
    'test1' could not initialize. (Virtual machine ID 18568CA2-82E9-4A9F-B462-701D8FB4C447)
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Microsoft-Windows-Hyper-V-Worker" Guid="{51DDFA29-D5C8-4803-BE4B-2ECB715570FE}" />
        <EventID>3040</EventID>
        <Version>0</Version>
        <Level>2</Level>
        <Task>0</Task>
        <Opcode>0</Opcode>
        <Keywords>0x8000000000000000</Keywords>
        <TimeCreated SystemTime="2011-05-23T21:51:25.956775200Z" />
        <EventRecordID>2</EventRecordID>
        <Correlation />
        <Execution ProcessID="3316" ThreadID="2716" />
        <Channel>Microsoft-Windows-Hyper-V-Worker-Admin</Channel>
        <Computer>Virtual-Mgt.amrinc-corp.local</Computer>
        <Security UserID="S-1-5-20" />
      </System>
      <UserData>
        <VmInitialize xmlns:auto-ns2="http://schemas.microsoft.com/win/2004/08/events" xmlns="http://www.microsoft.com/Windows/Virtualization/Events">
          <VmName>test1</VmName>
          <VmId>18568CA2-82E9-4A9F-B462-701D8FB4C447</VmId>
        </VmInitialize>
      </UserData>
    </Event>
    I have blownout the server and reinstalled the operating system and SCVVM and applied all the current updates to no avail. I have the exact same issue again. The problem seem to be at least on the serface an authority problem because I have no problem creating
    new VM via the P2V process on an old Virtual Server running on Win2003R2.
    Oh yes I can create new virtual machines on the system in question and move them to the library as was suggested to verify in a Blog post so I am really wondering what the problem is?
    Configuration Analyzer Just gave me a warning about reporting not being setup on the VVM which it isn't so no suprise there?
    Any information that might help me figure this would be greatly appreciated

    I've looked at both threads, and there simply isn't enough information for me to tell you what is wrong.  Please collect a trace (instructions in General forum) and open a case with CSS.  CSS can provide more in depth analysis than what a forum
    post allows. 
    As a shot in the dark, I have seen the issue outlined in the following KB article cause this exact same error message and symptom,
    http://support.microsoft.com/kb/967902
    Best Regards, Mike Briggs [MSFT] -- posting provided "AS IS" with no warranties and confers no rights

  • Why this code is not working for alv

    Dear
    Regards,
    i have implemented the same program for ALV which i have used earlier in the reports. but now it is showing no output:
    *& Report  ZTCT1_ALV2                                                  *
    REPORT  ztct1_alv2                              .
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    * INCLUDING TABLES.
    TABLES: vbrk,
            vbrp,
            kna1,
            t001w,
            makt.
    * DECLARATION OF INTERNAL TABLES.
    DATA: BEGIN OF itab OCCURS 0,  "Including the fields of VBRK and VBRP
            kunag LIKE vbrk-kunag, "Customer Code
            name1 LIKE kna1-name1, "Customer Name
            vbeln LIKE vbrk-vbeln, "Invoice #
            fkdat LIKE vbrk-fkdat, "Invoice Date
            werks LIKE vbrp-werks, "Plant
            name2 LIKE t001w-name1,"Plant Description
            matnr LIKE vbrp-matnr, "Material #
            maktx LIKE makt-maktx, "Material Description
            meins LIKE vbrp-meins, "Unit of Measure
            fklmg LIKE vbrp-fklmg, "Quantity
            netwr LIKE vbrp-netwr, "Amount
          END OF itab,
          BEGIN OF itnm OCCURS 0,  "Including the fields of VBRK and KNA1
            kunag LIKE vbrk-kunag, "Customer Code
            name1 LIKE kna1-name1, "Customer Name
          END OF itnm,
          BEGIN OF itpt OCCURS 0,  "Including the fields of VBRP and T001W
            werks LIKE vbrp-werks, "Plant
            name1 LIKE t001w-name1,"Plant Description
          END OF itpt,
          BEGIN OF itmt OCCURS 0,  "Including the fields of VBRP and MAKT
            matnr LIKE vbrp-matnr, "Material #
            maktx LIKE makt-maktx, "Material description
          END OF itmt,
          BEGIN OF itsm OCCURS 0,
            kunag LIKE kna1-kunnr,
            name1 LIKE kna1-name1,
            fklmg LIKE vbrp-fklmg,
            netwr LIKE vbrp-netwr,
          END OF itsm,
          ok_code            LIKE sy-ucomm,
          save_ok            LIKE sy-ucomm,
          g_max              TYPE i VALUE 100,
          g_repid            LIKE sy-repid,
          gs_layout          TYPE lvc_s_layo,
          g_container        TYPE scrfname VALUE 'CUST_CONT',
          grid1              TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container,
          grid2              TYPE REF TO cl_gui_alv_grid,
          gt_sort            TYPE lvc_t_sort,
          gt_fieldcatalog    TYPE lvc_t_fcat,
          w_tot_qty          LIKE vbrp-fklmg,
          w_tot_amt          LIKE vbrp-netwr,
    * Reference to Dialogbox Container.
          dialogbox_container TYPE REF TO cl_gui_dialogbox_container,
    * Reference to local class that handles events of GRID1 and
    * DIALOGBOX_CONTAINER
          event_receiver TYPE REF TO lcl_event_receiver.
    * SELECT-OPTIONS
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN BEGIN OF BLOCK input WITH FRAME TITLE text-000.
    SELECT-OPTIONS: s_werks FOR vbrp-werks, "Plant
                    s_kunag FOR vbrk-kunag, "Customer
                    s_matnr FOR vbrp-matnr, "Material Number
                    s_fkdat FOR vbrk-fkdat. "Invoice Date
    SELECTION-SCREEN END OF BLOCK input .
    SELECTION-SCREEN SKIP 1.
    * START-OF-SELECTION
    START-OF-SELECTION.
      SET SCREEN 100.
    * CLEARING INTERNAL TABLES.
      CLEAR: itab,
             itnm,
             itmt,
             itpt.
    * QUERY FOR JOINING TABLES VBRK AND VBRP
      SELECT vbrk~kunag
             vbrk~vbeln
             vbrk~fkdat
             vbrp~werks
             vbrp~matnr
             vbrp~meins
             vbrp~fklmg
             vbrp~netwr
             INTO CORRESPONDING FIELDS OF TABLE itab
             FROM vbrk
             INNER JOIN vbrp
                 ON vbrk~vbeln = vbrp~vbeln
             WHERE vbrk~kunag IN s_kunag
               AND vbrk~fkdat IN s_fkdat
               AND vbrp~matnr IN s_matnr
               AND vbrp~werks IN s_werks.
    * QUERY FOR JOINING TABLES VBRK AND KNA1
      SELECT kna1~kunnr AS kunag
             kna1~name1
             INTO TABLE itnm
             FROM kna1
             WHERE kna1~kunnr IN s_kunag.
    * QUERY FOR JOINING TABLES VBRP AND T001W
      SELECT t001w~werks
             t001w~name1
             INTO TABLE itpt
             FROM t001w
             WHERE t001w~werks IN s_werks.
    * QUERY FOR JOINING TABLES VBRP AND MAKT
      SELECT makt~matnr
             makt~maktx
             INTO TABLE itmt
             FROM makt
             WHERE makt~matnr IN s_matnr.
    * SORTING INTERNAL TABLES.
      SORT itab BY kunag.
    *    LOOP AT itab.
    *      CLEAR: itmt, itnm, itpt.
    *      READ TABLE itnm WITH KEY kunag = itab-kunag.
    *      READ TABLE itmt WITH KEY matnr = itab-matnr.
    *      READ TABLE itpt WITH KEY werks = itab-werks.
    *      itab-name1 = itnm-name1.
    *      itab-maktx = itmt-maktx.
    *      itab-name2 = itpt-name1.
    *      MODIFY itab.
    *    ENDLOOP.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'KUNAG' 'C' 'Customer Code'.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'NAME1' 'C' 'Customer Name'.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'VBELN' 'C' 'Invoice #'.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'FKDAT' 'DATS' 'Invoice Date'.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'WERKS' 'C' 'Plant'.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'NAME2' 'C' 'Plant Description'.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'MATNR' 'C' 'Material #'.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'MAKTX' 'C' 'Material Description'.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'MEINS' 'C' 'UoM'.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'FKLMG' 'QUAN' 'Quantity'.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'NETWR' 'CURR' 'Amount'.
        LOOP AT itab.
          CLEAR itsm.
          READ TABLE itnm WITH KEY kunag = itab-kunag.
          itsm-kunag = itab-kunag.
          itsm-name1 = itnm-name1.
          itsm-fklmg = itab-fklmg.
          itsm-netwr = itab-netwr.
          COLLECT itsm.
        ENDLOOP.
        PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'KUNAG' 'C' 'Customer Code'.
        PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'NAME1' 'C' 'Customer Name'.
        PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'FKLMG' 'QUAN' 'Quantity'.
        PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'NETWR' 'CURR' 'Amount'.
      PERFORM sort_build USING gt_sort[].
      PERFORM layout_init USING gs_layout.
    *   LOCAL CLASSES: Definition
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
        handle_double_click
            FOR EVENT double_click OF cl_gui_alv_grid
                IMPORTING e_row e_column,
        handle_close
            FOR EVENT close OF cl_gui_dialogbox_container
                IMPORTING sender.
      PRIVATE SECTION.
        DATA: dialogbox_status TYPE c.  "'X': does exist, SPACE: does not ex.
    ENDCLASS.                    "lcl_event_receiver DEFINITION
    *   LOCAL CLASSES: Implementation
    CLASS lcl_event_receiver IMPLEMENTATION.
    *   §3.At doubleclick(1): The event DOUBLE_CLICK provides
    *      parameters of the clicked row and column.
    *      Use row parameter to select a line of the
    *      corresponding internal table.
      METHOD handle_double_click.
        DATA: ls_sm LIKE LINE OF itsm,
              wa_itab LIKE ITAB.
    *   read selected row from internal table gt_sflight
        READ TABLE itsm INDEX e_row-index INTO ls_sm.
    *   §4.At Doubleclick(2): Select booking data
    *    READ TABLE ITAB WITH KEY KUNAG = LS_SM-KUNAG.    .
        READ TABLE ITAB INTO WA_ITAB WITH KEY KUNAG = LS_SM-KUNAG.
    *   §5.At doubleclick(3): Create dialogbox to show detail list
    *     (if not already existent)
        IF dialogbox_status IS INITIAL.
          dialogbox_status = 'X'.
          PERFORM create_detail_list.
        ELSE.
          CALL METHOD dialogbox_container->set_visible
            EXPORTING
              visible = 'X'.
          CALL METHOD grid2->refresh_table_display.
        ENDIF.
      ENDMETHOD.                    "handle_double_click
      METHOD handle_close.
    *   §6.Handle the CLOSE-button of the dialogbox
    *   set dialogbox invisible
    *   (the dialogbox is destroyed outomatically when the user
    *   switches to another dynpro).
        CALL METHOD sender->set_visible
          EXPORTING
            visible = space.
    *   In this example closing the dialogbox leads
    *   to make it invisible. It is also conceivable to destroy it
    *   and recreate it if the user doubleclicks a line again.
    *   Displaying a great amount of data has a greater impact on performance.
      ENDMETHOD.                    "handle_close
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
    *   lcl_event_receiver (Implementation)
    *=====================================================================
    *       FORM EXIT_PROGRAM                                             *
    FORM exit_program.
      CALL METHOD g_custom_container->free.
      CALL METHOD cl_gui_cfw=>flush.
      IF sy-subrc NE 0.
    * add your handling, for example
        CALL FUNCTION 'POPUP_TO_INFORM'
          EXPORTING
            titel = g_repid
            txt2  = sy-subrc
            txt1  = 'Error in FLush'(500).
      ENDIF.
      LEAVE TO SCREEN 0.
    ENDFORM.                    "exit_program
    *  MODULE PBO_ALV OUTPUT
    MODULE pbo_alv OUTPUT.
      SET PF-STATUS 'MAIN'.
      SET TITLEBAR 'MAIN100'.
      g_repid = sy-repid.
      IF g_custom_container IS INITIAL.
        READ TABLE itsm.
        CREATE OBJECT g_custom_container
          EXPORTING
            container_name = g_container
          EXCEPTIONS
            cntl_error = 1
            cntl_system_error = 2
            create_error = 3
            lifetime_error = 4
            lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc NE 0.
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              titel = g_repid
              txt2  = sy-subrc
              txt1  = 'The control could not be created'(510).
        ENDIF.
        CREATE OBJECT grid1
          EXPORTING
            i_parent = g_custom_container.
        gs_layout-grid_title = 'Invoice Summary'.
        CALL METHOD grid1->set_table_for_first_display
          EXPORTING
            is_layout       = gs_layout
          CHANGING
            it_outtab       = itsm[]
            it_fieldcatalog = gt_fieldcatalog
            it_sort         = gt_sort.
        CREATE OBJECT event_receiver.
        SET HANDLER event_receiver->handle_double_click FOR grid1.
      ENDIF.
      CALL METHOD cl_gui_control=>set_focus
        EXPORTING
          control = grid1.
    ENDMODULE.                    "PBO_ALV OUTPUT
    *  MODULE PAI_ALV INPUT
    MODULE pai_alv INPUT.
      CALL METHOD cl_gui_cfw=>dispatch.
      CASE sy-ucomm.
        WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                    "PAI_ALV INPUT
    *&      Form  fieldcatalog_init
    *       text
    *      -->LT_FIELDCATtext
    *      -->VALUE(FIELDtextE)
    *      -->VALUE(FIELDtextE)
    *      -->VALUE(FIELDtextT)
    FORM fieldcatalog_init USING lt_fieldcatalog TYPE lvc_t_fcat
                           value(field_name) value(field_type) value(field_text).
      DATA: ls_fieldcatalog TYPE lvc_s_fcat.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = field_name.
      ls_fieldcatalog-datatype  = field_type.
      ls_fieldcatalog-reptext   = field_text.
      ls_fieldcatalog-coltext  =  field_text.
      ls_fieldcatalog-seltext  =  field_text.
      ls_fieldcatalog-tooltip  =  field_text.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
    ENDFORM.                    "fieldcatalog_init
    *&      Form  sort_build
    *       text
    *      -->LT_SORT    text
    FORM sort_build USING lt_sort TYPE lvc_t_sort.
      DATA: ls_sort TYPE lvc_s_sort.
      ls_sort-fieldname = 'KUNAG'.    "Fieldname on which to sort
      ls_sort-up        = 'X'.        "Sort Ascending
      APPEND ls_sort TO lt_sort.
      ls_sort-fieldname = 'NAME1'.    "Fieldname on which to sort
      ls_sort-up        = 'X'.        "Sort Ascending
      APPEND ls_sort TO lt_sort.
    ENDFORM.                    "sort_build
    *&      Form  layout_init
    *       text
    *      -->LS_LAYOUT  text
    FORM layout_init USING ls_layout TYPE lvc_s_layo.
      ls_layout-zebra      = 'X'.
      ls_layout-grid_title = 'Customer Details'.
      ls_layout-sel_mode   = 'A'.
      ls_layout-cwidth_opt = 'X'.
    ENDFORM.                    "layout_init
    *&      Form  create_detail_list
    *         text
    *    -->  p1        text
    *    <--  p2        text
    FORM create_detail_list.
    *   create dialogbox container as dynpro-instance
    *   When the user switches to another screen, it is
    *   destroyed by lifetime mangagement of CFW
      CREATE OBJECT dialogbox_container
          EXPORTING
            top = 150
            left = 150
            lifetime = cntl_lifetime_dynpro
            caption = 'INVOICE DETAILS'(200)
            width = 800
            height = 200.
      CREATE OBJECT grid2
          EXPORTING i_parent = dialogbox_container.
    *   Register ABAP OO event 'CLOSE'. It is not necessary to register this
    *   event at the frontend (this is done during creation).
      SET HANDLER event_receiver->handle_close FOR dialogbox_container.
    *   display data
      gs_layout-grid_title = 'Invoice Details'(100).
      CALL METHOD grid2->set_table_for_first_display
        EXPORTING
          i_structure_name = 'itab'
          is_layout        = gs_layout
        CHANGING
          it_outtab        = itab[]
          it_fieldcatalog  = gt_fieldcatalog
          it_sort          = gt_sort.
      CALL METHOD cl_gui_control=>set_focus
        EXPORTING
          control = grid2.
    ENDFORM.                    " create_detail_list[code][/
    code]

    Hi,
    I also copied and pasted the same code check once again by copying this code and create screens by double clicking on 100.
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    * INCLUDING TABLES.
    TABLES: vbrk,
            vbrp,
            kna1,
            t001w,
            makt.
    * DECLARATION OF INTERNAL TABLES.
    DATA: BEGIN OF itab OCCURS 0,  "Including the fields of VBRK and VBRP
            kunag LIKE vbrk-kunag, "Customer Code
            name1 LIKE kna1-name1, "Customer Name
            vbeln LIKE vbrk-vbeln, "Invoice #
            fkdat LIKE vbrk-fkdat, "Invoice Date
            werks LIKE vbrp-werks, "Plant
            name2 LIKE t001w-name1,"Plant Description
            matnr LIKE vbrp-matnr, "Material #
            maktx LIKE makt-maktx, "Material Description
            meins LIKE vbrp-meins, "Unit of Measure
            fklmg LIKE vbrp-fklmg, "Quantity
            netwr LIKE vbrp-netwr, "Amount
          END OF itab,
          BEGIN OF itnm OCCURS 0,  "Including the fields of VBRK and KNA1
            kunag LIKE vbrk-kunag, "Customer Code
            name1 LIKE kna1-name1, "Customer Name
          END OF itnm,
          BEGIN OF itpt OCCURS 0,  "Including the fields of VBRP and T001W
            werks LIKE vbrp-werks, "Plant
            name1 LIKE t001w-name1,"Plant Description
          END OF itpt,
          BEGIN OF itmt OCCURS 0,  "Including the fields of VBRP and MAKT
            matnr LIKE vbrp-matnr, "Material #
            maktx LIKE makt-maktx, "Material description
          END OF itmt,
          BEGIN OF itsm OCCURS 0,
            kunag LIKE kna1-kunnr,
            name1 LIKE kna1-name1,
            fklmg LIKE vbrp-fklmg,
            netwr LIKE vbrp-netwr,
          END OF itsm,
          ok_code            LIKE sy-ucomm,
          save_ok            LIKE sy-ucomm,
          g_max              TYPE i VALUE 100,
          g_repid            LIKE sy-repid,
          gs_layout          TYPE lvc_s_layo,
          g_container        TYPE scrfname VALUE 'CUST_CONT',
          grid1              TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container,
          grid2              TYPE REF TO cl_gui_alv_grid,
          gt_sort            TYPE lvc_t_sort,
          gt_fieldcatalog    TYPE lvc_t_fcat,
          w_tot_qty          LIKE vbrp-fklmg,
          w_tot_amt          LIKE vbrp-netwr,
    * Reference to Dialogbox Container.
          dialogbox_container TYPE REF TO cl_gui_dialogbox_container,
    * Reference to local class that handles events of GRID1 and
    * DIALOGBOX_CONTAINER
          event_receiver TYPE REF TO lcl_event_receiver.
    * SELECT-OPTIONS
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN BEGIN OF BLOCK input WITH FRAME TITLE text-000.
    SELECT-OPTIONS: s_werks FOR vbrp-werks, "Plant
                    s_kunag FOR vbrk-kunag, "Customer
                    s_matnr FOR vbrp-matnr, "Material Number
                    s_fkdat FOR vbrk-fkdat. "Invoice Date
    SELECTION-SCREEN END OF BLOCK input .
    SELECTION-SCREEN SKIP 1.
    * START-OF-SELECTION
    START-OF-SELECTION.
    SET SCREEN 100.
    * CLEARING INTERNAL TABLES.
      CLEAR: itab,
             itnm,
             itmt,
             itpt.
    * QUERY FOR JOINING TABLES VBRK AND VBRP
      SELECT vbrk~kunag
             vbrk~vbeln
             vbrk~fkdat
             vbrp~werks
             vbrp~matnr
             vbrp~meins
             vbrp~fklmg
             vbrp~netwr
             INTO CORRESPONDING FIELDS OF TABLE itab
             FROM vbrk
             INNER JOIN vbrp
                 ON vbrk~vbeln = vbrp~vbeln
             WHERE vbrk~kunag IN s_kunag
               AND vbrk~fkdat IN s_fkdat
               AND vbrp~matnr IN s_matnr
               AND vbrp~werks IN s_werks.
    * QUERY FOR JOINING TABLES VBRK AND KNA1
      SELECT kna1~kunnr AS kunag
             kna1~name1
             INTO TABLE itnm
             FROM kna1
             WHERE kna1~kunnr IN s_kunag.
    * QUERY FOR JOINING TABLES VBRP AND T001W
      SELECT t001w~werks
             t001w~name1
             INTO TABLE itpt
             FROM t001w
             WHERE t001w~werks IN s_werks.
    * QUERY FOR JOINING TABLES VBRP AND MAKT
      SELECT makt~matnr
             makt~maktx
             INTO TABLE itmt
             FROM makt
             WHERE makt~matnr IN s_matnr.
    * SORTING INTERNAL TABLES.
      SORT itab BY kunag.
        LOOP AT itab.
          CLEAR itsm.
          READ TABLE itnm WITH KEY kunag = itab-kunag.
          itsm-kunag = itab-kunag.
          itsm-name1 = itnm-name1.
          itsm-fklmg = itab-fklmg.
          itsm-netwr = itab-netwr.
          COLLECT itsm.
        ENDLOOP.
    * END-OF-SELECTION.
    * If not itsm[] is initial.
    *    CALL SCREEN 100.
    * endif.
    *   LOCAL CLASSES: Definition
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
        handle_double_click
            FOR EVENT double_click OF cl_gui_alv_grid
                IMPORTING e_row e_column,
        handle_close
            FOR EVENT close OF cl_gui_dialogbox_container
                IMPORTING sender.
      PRIVATE SECTION.
        DATA: dialogbox_status TYPE c.  "'X': does exist, SPACE: does not ex
    ENDCLASS.                    "lcl_event_receiver DEFINITION
    *   LOCAL CLASSES: Implementation
    CLASS lcl_event_receiver IMPLEMENTATION.
    *   §3.At doubleclick(1): The event DOUBLE_CLICK provides
    *      parameters of the clicked row and column.
    *      Use row parameter to select a line of the
    *      corresponding internal table.
      METHOD handle_double_click.
        DATA: ls_sm LIKE LINE OF itsm,
              wa_itab LIKE ITAB.
    *   read selected row from internal table gt_sflight
        READ TABLE itsm INDEX e_row-index INTO ls_sm.
    *   §4.At Doubleclick(2): Select booking data
    *    READ TABLE ITAB WITH KEY KUNAG = LS_SM-KUNAG.    .
        READ TABLE ITAB INTO WA_ITAB WITH KEY KUNAG = LS_SM-KUNAG.
    *   §5.At doubleclick(3): Create dialogbox to show detail list
    *     (if not already existent)
        IF dialogbox_status IS INITIAL.
          dialogbox_status = 'X'.
          PERFORM create_detail_list.
        ELSE.
          CALL METHOD dialogbox_container->set_visible
            EXPORTING
              visible = 'X'.
          CALL METHOD grid2->refresh_table_display.
        ENDIF.
      ENDMETHOD.                    "handle_double_click
      METHOD handle_close.
    *   §6.Handle the CLOSE-button of the dialogbox
    *   set dialogbox invisible
    *   (the dialogbox is destroyed outomatically when the user
    *   switches to another dynpro).
        CALL METHOD sender->set_visible
          EXPORTING
            visible = space.
    *   In this example closing the dialogbox leads
    *   to make it invisible. It is also conceivable to destroy it
    *   and recreate it if the user doubleclicks a line again.
    *   Displaying a great amount of data has a greater impact on
    *performance.
      ENDMETHOD.                    "handle_close
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
    *   lcl_event_receiver (Implementation)
    *=====================================================================
    *       FORM EXIT_PROGRAM                                             *
    FORM exit_program.
      CALL METHOD g_custom_container->free.
      CALL METHOD cl_gui_cfw=>flush.
      IF sy-subrc NE 0.
    * add your handling, for example
        CALL FUNCTION 'POPUP_TO_INFORM'
          EXPORTING
            titel = g_repid
            txt2  = sy-subrc
            txt1  = 'Error in FLush'(500).
      ENDIF.
      LEAVE TO SCREEN 0.
    ENDFORM.                    "exit_program
    *&      Module  STATUS_0100  OUTPUT
    *       text
    module STATUS_0100 output.
      SET PF-STATUS 'MAIN'.
      SET TITLEBAR 'MAIN100'.
      g_repid = sy-repid.
      IF g_custom_container IS INITIAL.
        READ TABLE itsm.
        CREATE OBJECT g_custom_container
          EXPORTING
            container_name = g_container
          EXCEPTIONS
            cntl_error = 1
            cntl_system_error = 2
            create_error = 3
            lifetime_error = 4
            lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc NE 0.
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              titel = g_repid
              txt2  = sy-subrc
              txt1  = 'The control could not be created'(510).
        ENDIF.
        CREATE OBJECT grid1
          EXPORTING
            i_parent = g_custom_container.
        gs_layout-grid_title = 'Invoice Summary'.
    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'KUNAG' 'C'
    'Customer Code'.
        PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'NAME1' 'C'
    'Customer Name'.
        PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'FKLMG' 'QUAN'
    'Quantity'.
        PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'NETWR' 'CURR'
    'Amount'.
      PERFORM sort_build USING gt_sort[].
      PERFORM layout_init USING gs_layout.
        CALL METHOD grid1->set_table_for_first_display
          EXPORTING
            is_layout       = gs_layout
          CHANGING
            it_outtab       = itsm[]
            it_fieldcatalog = gt_fieldcatalog
            it_sort         = gt_sort.
        CREATE OBJECT event_receiver.
        SET HANDLER event_receiver->handle_double_click FOR grid1.
      ENDIF.
      CALL METHOD cl_gui_control=>set_focus
        EXPORTING
          control = grid1.
    endmodule.                 " STATUS_0100  OUTPUT
    *  MODULE PAI_ALV INPUT
    MODULE USER_COMMAND_0100.
    CALL METHOD cl_gui_cfw=>dispatch.
      CASE sy-ucomm.
        WHEN 'BACK' OR 'EXIT' OR 'CANC'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                    "PAI_ALV INPUT
    *&      Form  fieldcatalog_init
    *       text
    *      -->LT_FIELDCATtext
    *      -->VALUE(FIELDtextE)
    *      -->VALUE(FIELDtextE)
    *      -->VALUE(FIELDtextT)
    FORM fieldcatalog_init USING lt_fieldcatalog TYPE lvc_t_fcat
                           value(field_name) value(field_type)
    value(field_text).
      DATA: ls_fieldcatalog TYPE lvc_s_fcat.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = field_name.
      ls_fieldcatalog-datatype  = field_type.
      ls_fieldcatalog-reptext   = field_text.
      ls_fieldcatalog-coltext  =  field_text.
      ls_fieldcatalog-seltext  =  field_text.
      ls_fieldcatalog-tooltip  =  field_text.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
    ENDFORM.                    "fieldcatalog_init
    *&      Form  sort_build
    *       text
    *      -->LT_SORT    text
    FORM sort_build USING lt_sort TYPE lvc_t_sort.
      DATA: ls_sort TYPE lvc_s_sort.
      ls_sort-fieldname = 'KUNAG'.    "Fieldname on which to sort
      ls_sort-up        = 'X'.        "Sort Ascending
      APPEND ls_sort TO lt_sort.
      ls_sort-fieldname = 'NAME1'.    "Fieldname on which to sort
      ls_sort-up        = 'X'.        "Sort Ascending
      APPEND ls_sort TO lt_sort.
    ENDFORM.                    "sort_build
    *&      Form  layout_init
    *       text
    *      -->LS_LAYOUT  text
    FORM layout_init USING ls_layout TYPE lvc_s_layo.
      ls_layout-zebra      = 'X'.
      ls_layout-grid_title = 'Customer Details'.
      ls_layout-sel_mode   = 'A'.
      ls_layout-cwidth_opt = 'X'.
    ENDFORM.                    "layout_init
    *&      Form  create_detail_list
    *         text
    *    -->  p1        text
    *    <--  p2        text
    FORM create_detail_list.
    *   create dialogbox container as dynpro-instance
    *   When the user switches to another screen, it is
    *   destroyed by lifetime mangagement of CFW
      CREATE OBJECT dialogbox_container
          EXPORTING
            top = 150
            left = 150
            lifetime = cntl_lifetime_dynpro
            caption = 'INVOICE DETAILS'(200)
            width = 800
            height = 200.
      CREATE OBJECT grid2
          EXPORTING i_parent = dialogbox_container.
    *   Register ABAP OO event 'CLOSE'. It is not necessary to register this
    *   event at the frontend (this is done during creation).
      SET HANDLER event_receiver->handle_close FOR dialogbox_container.
    *   display data
      gs_layout-grid_title = 'Invoice Details'(100).
      CALL METHOD grid2->set_table_for_first_display
        EXPORTING
          i_structure_name = 'itab'
          is_layout        = gs_layout
        CHANGING
          it_outtab        = itab[]
          it_fieldcatalog  = gt_fieldcatalog
          it_sort          = gt_sort.
      CALL METHOD cl_gui_control=>set_focus
        EXPORTING
          control = grid2.
    ENDFORM.                    " create_detail_list
    Nothing wrong in the code i am able to see the output with five records and the pop-up screen on double clicking a value.
    Kindly close the thread or revert back

  • After upgrading to IOS 5.1 I no longer can see Verizon at the top of my Iphone and under settings general Network says Not Available Why is this? Did the upgrade cause this?

    after upgrading to IOS 5.1 I no longer can see Verizon at the top of my Iphone and under settings>general>Network>says Not Available Why is this? Did the upgrade cause this?
    steve

    See this tip --> http://support.apple.com/kb/TS1559
    If this doesn't resolve it you most likely have a hardware failure. Fortunately, your phone is in warranty, so if you take it to an Apple store they will replace it.

  • While watching an iTunes movie from my Apple TV, why does my movie stop playing at the 1 hour mark?  I'm assuming I have a setting causing this to happen, but I have no idea what setting needs to be changed.  Can someone help me?

    While watching an iTunes movie from my Apple TV, why does my movie stop playing at the 1 hour mark?  I'm assuming I have a setting causing this to happen, but I have no idea what setting needs to be changed.  Can someone help me?

    It's right at an hour (consistently), but the computer goes to sleep prior to that. It's as if iTunes goes to sleep. Also, it wasn't always this way. Originally, the movies played through without interruption. At some point, I guess a setting was changed, and now I only get an hour. Also. My energy settings are set to go to sleep at 10 minutes.

Maybe you are looking for