Help With Homework Reading user input into an Array

This program is to read questions from a file and retrieve user input as answers.
This program is no where near complete, but I am stuck. (I dont know why, maybe its too late at night)
I have a total of three classes. I am currently stuck in my main class. See Comments ("What the hell am I printing/ Will this work?"). In this next line of code, i need to read the question from the file to the user, and then accept their input.
Main Class:
    public static void main(String[] args) {
        try {
        Scanner in = new Scanner(new FileReader("quiz.txt"));
            catch (Exception e) {
            System.out.println(e);
        ArrayList <Questions> Questions = new ArrayList<Questions>();
        ArrayList<String> answers = new ArrayList<String>();
              for (Questions qu : Questions)
         System.out.println(); //What the hell am I printing.
         String answer = in.nextLine(); //Will this work?
         answers.add(answer); //This should work
      }Questions Class:
public class Questions {
    String Questions = "";
    public String getQuestions() {
        return Questions;
    public void setQuestions(String Questions) {
        this.Questions = Questions;
    public Questions(String Questions)
        this.Questions = Questions;
}answers class:
package QuizRunner;
* @author Fern
public class answers {
    String answers = "";
    public String addAnswers() {
        return answers;
    public answers(String answers) {
        this.answers = answers;
    }

doremifasollatido wrote:
According to standard Java coding conventions, class names should start with a capital letter (so, your "answers" should be "Answers"). And, variable and method names should start with a lowercase letter (so, your "Questions" should be "questions").
And classnames should (almost) never be plural words. So it should probably be an 'Answer' and something else containing a collection of those objects called 'answers'.
Also, *your variable name should not be the same (case-sensitive match) as your class name.* Although it will compile if done syntactically correctly, it is highly confusing! I first wrote this because you did this for both "Questions" and "answers" classes in their class definition, but you also used "Questions" as your variable name in 'main'. (Note that applying the standard capitalization conventions will prevent you from using the same name for your class name as for your variable name, since they should start with different cases.)
Of course having an 'Answer' called 'answer' is often fine.
Your Questions class should probably be called "Question", anyway--it looks like it should hold a single question. And, your "answers" class should probably be called "Answer"--it looks like it should hold a single answer. You aren't using your "answers" class anywhere right now, anyway.Correct. There might be room for a class containing a collection of Question objects, but it's unlikely such a class would contain just that and nothing else.

Similar Messages

  • Help with creating a user input BTree for hierarchy structure

    I have been trying to create code that takes a user input string
    ex: a:b,c;b:g,h,j;g:k,m;b:u
    note: (the above string is then stored into a string array such in the format a:bc;b:ghj;g:km;b:u after it is verified that the hierarchy order is correct)
    The string is read in such that the any value before the : is a parent and its childern continue until a ; is found. Anyway verifying the sting I have accomplished and I have been able to input the string into a modified binary tree as long as there are only 2 childern per parent and graphically represents its structure of hierarchy. The problem is that each parent can have more the two childern.
    I have been working with the BTree class and find its output similar to what I am wanting which would represent a hierarchy of objects (files, employees, etc...) anyway I have been stumped as to how to get the above string into a format that can then create the correct BTree output without hard code.
    If any one has any suggestions on how to turn the data, in the string array into a usable format to create the correct BTree output, I would greatly appreciate it.
    In the above example the string array, a:bc;b:ghj;g:km;b:u would have a desired ouput of
    a
    ..b
    ....g
    ......k
    ......m
    ....h
    ....j
    ....u
    ..c
    Thanks
    Shane

    OOPS! I ment to say JTree not BTree

  • Transferring User Input Into an Array

    I want the user to input whats inside the matrix so I tell them "Enter Row 1 of Matrix 1: " Say for example they entered the length of the square matrix as 3, I would then want them to enter something like "1 2 3" as Row 1. With my current code I get:
    3 3 3
    3 3 3
    3 3 3
    I cant figure out what I should change so that its:
    1 2 3
    1 2 3
    1 2 3
    Thanks so much for any help. Heres the code so far:
    import java.util.Scanner;
    public class MatrixAddPro
      public static void main (String[] args)
         int row1, col1;
         Scanner scan = new Scanner(System.in);
         System.out.println("Enter the length of the square matrix: ");
         col1 = scan.nextInt(); 
         int[][] a = new int[col1][col1];
         System.out.println("Enter Row 1 of Matrix1: ");
         while(scan.hasNext())
         a[1][1] = scan.nextInt();
         //for (int row = 0; row < a.length; row++)
            //for (int col = 0; col < a[row].length; col++)
               //a[col1][col1] = scan.nextInt();
         for (int row = 0; row < a.length; row++)
            for (int col = 0; col < a[row].length; col++)     
               System.out.print(a[1][1] + "\t");
            System.out.println();  
    }

    import java.util.Scanner;
    public class MatrixAddPro
      public static void main (String[] args)
         int input, row, col;
         Scanner scan = new Scanner(System.in);
         System.out.println("Enter the length of the square matrix: ");
         col = scan.nextInt(); 
         row = col;
         int[][] a = new int[row][col];
         for (int x = 0; x < row; x++)
            for (int y = 0; y < col; y++)
               {System.out.println("Enter Row"+(x+1)+" Col"+ (y+1));
               input = scan.nextInt();
               a[x][y] = input;
         for (int x = 0; x < row; x++)
            for (int y = 0; y < col; y++)     
               {System.out.print(a[x][y] + "\t");
               System.out.println();      
    }OUTPUT:
    Enter the length of the square matrix:
    3
    Enter Row1 Col1
    1
    Enter Row1 Col2
    2
    Enter Row1 Col3
    3
    Enter Row2 Col1
    1
    Enter Row2 Col2
    2
    Enter Row2 Col3
    3
    Enter Row3 Col1
    1
    Enter Row3 Col2
    2
    Enter Row3 Col3
    3
    1
    2
    3
    1
    2
    3
    1
    2
    3
    Alright so now its not printing in rows...
    Thanks for your patience/help guys.

  • Newbie - help with homework.

    Create a procedure to insert a record into the Bill_Items table. All the fields in the Bill_Items table will be specified as para with the exception of the Selling_Price, which will be the Current_Price, retrieved from the Menu_Items table. Do not allow the insert to finish unless there are enough of all ingredients on hand. If the insert is successfull, the quantity field in the Ingredient table will need to be updated accordingly.
    Tables are below.
    Thanks,
    CREATE TABLE Bill_Items
    Bill_Number NUMBER(6,0)
    CONSTRAINT FK_Bill_Items_Bill_Number REFERENCES Bills(Bill_Number)
    CONSTRAINT NN_Bill_Items_Bill_Number NOT NULL,
    Menu_Item_Number NUMBER(5,0)
    CONSTRAINT FK_Menu_Item_Num REFERENCES Menu_Items(Menu_Item_Number)
    CONSTRAINT NN_Bill_Items_Menu_Item_Num NOT NULL,
    Discount NUMBER(5,2)
    CONSTRAINT N_Bill_Items_Discount NULL,
    Quantity NUMBER(3,0) DEFAULT 1
    CONSTRAINT Bills_Items_Quanity_CC CHECK(Quantity > 0)
    CONSTRAINT NN_Bill_Items_Quantity NOT NULL,
    Selling_Price NUMBER(6,2) DEFAULT 0
    CONSTRAINT Bills_Items_SellingPrice_CC CHECK(Selling_Price >= 0)
    CONSTRAINT NN_Bill_Items_Selling_Price NOT NULL,
    CONSTRAINT PK_Bill_Items PRIMARY KEY(Bill_Number,Menu_Item_Number)
    CREATE TABLE Menu_Item_Ingredients
    Menu_Item_Number NUMBER(5,0)
    CONSTRAINT FK_Menu_Item_Ing_Menu_Item_Num REFERENCES Menu_Items(Menu_Item_Number)
    CONSTRAINT NN_Menu_Item_Ing_Meun_Item_Num NOT NULL,
    Ingredient_Number NUMBER(5,0)
    CONSTRAINT FK_Menu_Item_Ing_IngredientNo REFERENCES Ingredients(Ingredient_Number)
    CONSTRAINT NN_Menu_Item_Ing_IngredientNo NOT NULL,
    Quantity NUMBER(5,2) DEFAULT 1
    CONSTRAINT Menu_Item_Ing_Quanity_CC CHECK(Quantity > 0)
    CONSTRAINT NN_Menu_Item_Ing_Quanity NOT NULL,
    Constraint PK_Menu_Item_Ing PRIMARY KEY(Menu_Item_Number, Ingredient_Number)
    CREATE TABLE Ingredients
    Ingredient_Number Number(5,0)
    CONSTRAINT PK_Ingredients_IngredientNo PRIMARY KEY
    CONSTRAINT NN_Ingredients_IngredientNo NOT NULL,
    Ingredient_Name VarChar2(35)
    CONSTRAINT NN_Ingredients_Ingredient_Name NOT NULL,
    Portion_Code CHAR(2)
    CONSTRAINT FK_Ingredients_PortionCode REFERENCES Portions(Portion_Code)
    CONSTRAINT NN_Ingredients_PortionCode NOT NULL
    REFERENCES Portions(Portion_Code),
    On_Hand NUMBER(6,2) DEFAULT 1
    CONSTRAINT Ingredients_OnHand_CC CHECK(On_Hand > 0)
    CONSTRAINT NN_Ingredients_On_Hand NOT NULL,
    Reorder_Point NUMBER(6,2) DEFAULT 1
    CONSTRAINT Ingredients_Reorder_Point CHECK(Reorder_Point > 0)
    CONSTRAINT NN_Ingredients_Reorder_Point NOT NULL,
    Current_Cost NUMBER(5,2) DEFAULT 0
    CONSTRAINT Ingredients_CurrentCost_CC CHECK(Current_Cost >= 0)
    CONSTRAINT NN_Ingredients_Current_Cost NOT NULL
    CREATE TABLE Menu_Items
    Menu_Item_Number NUMBER(5,0)
    CONSTRAINT PK_Menu_Items_MenuItemsNo PRIMARY KEY
    CONSTRAINT NN_Menu_Items_MenuItemsNo NOT NULL,
    Menu_Item_Name VARCHAR2(50)
    CONSTRAINT NN_Menu_Items_Menu_Item_Name NOT NULL,
    Current_Price NUMBER(6,2) DEFAULT 0
    CONSTRAINT Menu_Items_CurrentPrice CHECK(Current_Price >=0)
    CONSTRAINT NN_Menu_Items_Current_Price NOT NULL,
    Production_Cost NUMBER(6,2) DEFAULT 0
    CONSTRAINT Menu_Items_ProdCost CHECK(Production_Cost >=0)
    CONSTRAINT NN_Menu_Items_Production_Cost NOT NULL
    );

    Newbie to oracle - help with homework.. Letting others do your work is called cheating, where I live.
    C.

  • Help with date validation on input boxes.

    I need some help with date validation on input boxes.
    What I�m trying to create is a form where a user inputs dates and then the rest of the form calculates the other dates for them.
    i.e. � A user inputs 2 dates (A & B) and then a 3rd date which is 11 weeks before date B is calculated automatically.
    Is this possible and if so how do I do it ???
    Thanks

    Hi,
    to get third date try this:
    java.util.Date bDate = ...;
    Calendar yourCalendar = new GregorianCalendar();
    yourCalendar.setTime(bDate);
    yourCalendar.roll(Calendar.WEEK_OF_YEAR, -11);
    java.util.Date cDate = yourCalendar.getTime();Regards
    Ldinka

  • Help with a flash html inserting into DW

    Hello,
    I have created a enquiry section in flash for one of my html DW pages for my site. When I publish the flash doc ti creates a html page (Contact.html). When I open the flash html page in DW or upload it to my server, everything works fine. I recieve an email at my prefered destination etc etc. But as its only a section of my contact page of my website i need to insert it into my site page (get_in_touch.html) soon as i try and take all the stuff from contact.html and insert it into a div in my get_in_touch.html it doesn't respond when the submit button is pressed..... Can someone please help!!!!!
    Dan

    Thanks for all your help. I've managed to sort out the problem, still not
    sure what it was.... My sites live now.
    Just one question for you if you dont mind.
    The page which has the flash on it (yes this one again!) Well if someone
    goes to the page with out having flash player installed on their machine,
    i'm looking for some script to detect that there computer doesn't have
    Flash and redirect them to another html page I've created.
    Would really appreciated any advice you may have.
    many thanks,
    Dan
                                                                                    pziecina                                                 
                 <[email protected]>                                                                               
    To
                 09/09/2009 16:40                Daniel Herrington        
                                                 <[email protected]
                                                 m>                       
                    Please respond to                                       cc
                 clearspace-571537347-50                                  
                 [email protected]                               Subject
                      ums.adobe.com              Help with a
                                                 flash html inserting into DW
                                                                                    Hi
    Somewhere above your tag, you will have a line similar to this - Also in your tag the swf file -
    These are the files that I said may be wrong or missing.
    However if you just edit the flash generated page and include the items you
    require in this, and maintain the same file position, you should have no
    problems,
    PZ

  • Help with Adobe Reader update installation on mac book pro

    am trying to update adobe reader 9.4.6 to the latest version on my mac book pro. Am able to download the updtae to 10. whatever and proceed with installation. At the step where I am asked to choose the adobe reader file, I select the file and then the process stops and I get a message that installation has failed and i am to contact the software manufacturer.

    I figured it out. Thanks!
    The key, during both life and death, is to recognize illusions as illusions, projections as projections, and fantasies as fantasies. In this way we become free.
    Date: Mon, 10 Sep 2012 04:54:45 -0600
    From: [email protected]
    To: [email protected]
    Subject: Help with Adobe Reader update installation on mac book pro
        Re: Help with Adobe Reader update installation on mac book pro
        created by Nikhil.Gupta in Adobe Reader - View the full discussion
    How exactly are you trying to update your Adobe Reader 9.4.6Try the following link to download latest Adobe Raeader: http://get.adobe.com/reader/
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4686315#4686315
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4686315#4686315. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Adobe Reader by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Hello  I need your help with installing the flash drive into my laptop

    Hi
    I am Rachel Friedman asking for your help with installing the flashdrive player into my laptop.
    Thanks
    Rachel

    To give you any useful advice, I'm going to need to know more about your computer and browser:
    https://forums.adobe.com/message/5249945#5249945

  • Trouble reading user input in Mac OSX

    Hi, I am writing a program in Java (1.5) for Mac OSX that requires the user to setup files and settings, then a new frame opens with a blank screen and waits for user input (a key press) to begin. I have a setup screen that works fine (seperate frame) and triggers the blank screen and the rest of the program fine as well. The problem is when I try to have the program pause for user input. For some reason, this thread is no longer responding to user input at all. I have tried with a KeyListener Interface and with System.in.read() as well as BufferedReaders, etc and there are no keypresses registered at all.
    Another object does create a seperate thread to deal with closing down Quicktime elements, but the keypresses are not registering even when that thread has not been called.
    Can anyone tell me what might be the problem? Is there an issue with multiple frames interfering with the KeyListener? I can post the code, if you'd like, but it's pretty involved.
    Any help greatly appreciated!
    Heidi

    Actually, this still isn't working. I'm posting the program class (there are several supporting classes that are not in this post - SetUp opens a SetUp frame and gathers information, then calls MTSNewSwing. Start movie places a Quicktime Component into a Panel, and QTSessionCheck starts a thread that check to make sure that QT sessions are closed when neccessary). KeyPresses are stll not being registered at all.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.util.*;
    import java.io.*;
    import quicktime.*;
    import quicktime.std.*;
    import quicktime.app.view.*;
    import quicktime.std.movies.*;
    public class MTSNewSwing extends JFrame{
         public Insets getInsets() {
              Insets rm = new Insets (20, 20, 20, 20);
              return rm;
    char key = 'q';
    int correct = 0;
    boolean kp = false;
    int numberOfMovies;
    ArrayList<File> moviesList = new ArrayList();
    ArrayList<File> altList = new ArrayList();
         public MTSNewSwing() {
              super("Matching to Sample");
              setSize(1024, 768);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setBackground(Color.black);
              getRootPane().registerKeyboardAction(new ActionListener(){
                   public void actionPerformed(ActionEvent e) {
                   System.out.println("keystroke"); }
              },KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0),JComponent.WHEN_IN_FOCUSED_WINDOW);
              moviesList = SetUp.movieList;
              numberOfMovies = moviesList.size();
              int randomSampleIndex;
              int randomAlternativeIndex;
              boolean corrAltAdded = false;
              //run new trial through numOfTrials
              for (int t = 0; t < SetUp.numOfTrials; t++) {
                   //clear screen
                   BlankScreen bs = new BlankScreen();
                   getContentPane().add(bs);
                   setVisible(true);
                   //put random alternatives into array list
                   randomSampleIndex = (int) (Math.random() * SetUp.numOfMovies);
                   File sample = (File) moviesList.get(randomSampleIndex);
                   altList.add(sample);
                   int correctAlternativePosition = (int) (Math.random() * SetUp.numOfAlternatives);
                   for (int altPosition = 1; altPosition <= SetUp.numOfAlternatives; altPosition++) {
                        if (altPosition == correctAlternativePosition) {
                             altList.add(sample);
                             corrAltAdded = true;
                             System.out.println("correct alternative added");
                        } else if (altPosition == SetUp.numOfAlternatives && corrAltAdded == false) altList.add(sample);
                        else {
                             do {
                                  randomAlternativeIndex = (int) (Math.random() *
    SetUp.numOfMovies);
                             } while (randomAlternativeIndex == randomSampleIndex);      
                             File nextAlt = (File) moviesList.get(randomAlternativeIndex);
                             altList.add(nextAlt);
                             System.out.println("alternative added");
                   corrAltAdded = false;
                   //wait for keypress to start trial
              //this is the part that still doesn't work
                   //add movies to screen
                   for (int i=0; i<= SetUp.numOfAlternatives; i++) {
                        File file = (File) altList.get(i);
                        StartMovie sm = new StartMovie();
                        try {
                             sm.go(file);
                        } catch (Exception e) {
                             e.printStackTrace();
                        if (SetUp.numOfAlternatives < 4) {
                             BorderLayout bdr = new BorderLayout();
                             this.setLayout(bdr);
                             JPanel samp = new JPanel();
                             JPanel alts = new JPanel();
                             BorderLayout altbdr = new BorderLayout();
                             alts.setLayout(altbdr);
                             if (i ==0) {
                                  samp.add(sm);
                                  this.getContentPane().add(samp, BorderLayout.NORTH);
                                  setVisible(true);
                                  System.out.println("sample added");
                             } else if (i == 1) {
                                  alts.add(sm, BorderLayout.WEST);
                                  System.out.println("alt1 added");
                             } else if (i == 2) {
                                  alts.add(sm, BorderLayout.EAST);
                                  System.out.println("alt2 added");
                             } else if (i == 3) {
                                  alts.add(sm, BorderLayout.CENTER);
                                  System.out.println("alt3 added");
                             this.getContentPane().add(alts, BorderLayout.SOUTH);
                             setVisible(true);
                             try {
                                  Thread.sleep(10000);
                             } catch (InterruptedException ex) {
                                  ex.printStackTrace();
                             continue;
         public static void main(String args[]) {
                   SetUp setup = new SetUp();
    }

  • Search help unavailable in Read-only input field since EHP4

    Dear Experts!
    I have a problem with a Portal page since the deploy of the EHP4. The page has standard input fields with Search Helps. I needed to have the input field non-modifiable so the user would have to use the search help to get the proper information.
    Prior to the EHP4 installation, I set the input field to Read Only in the WebDynpro explorer, this disabled the editing while permitting the user to use the Search Help.
    Since the installation, the search help is no longer visible or accessible on a Read Only standard inputfield.
    Do you know if there is a way to allow the search help on a read only field?
    Thanks so much for your answer,
    Brian Foster.

    >Since the installation, the search help is no longer visible or accessible on a Read Only standard inputfield.
    This was a conscious design decision on SAP's part that disabled or read-only fields should no longer fire value help.  I am aware that this situation was used in the past as you describe.  It is even still used in SE80 for the Web Dynpro ABAP wizards. However usability studies showed that this often confused end users and therefore it is no longer allowed.  The field must be input enabled to fire the attached serach help.

  • Help needed, Createing Dynamic User input

    Hello,
    I am attempting to create some dynamic user input by "predicting" what the user requires in a text box.
    For example if the user enters "Smi" I have a select list pop up which gives the user all options that begin with "Smi".
    I am able to achieve the popups but the interface is quite jerky and not terribly responsive I am trying to solve this by using a thread which starts and stops when new input is received but it is still not quite right.
    The program uses a Sorted TreeSet to hold the data (I thought this would give me a quick search time) and a simple interface at this stage.
    Any help would be fantastic
    Thanks in advance :P
    import java.io.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import java.text.*;
    import java.util.*;
       /** This program represents part of a larger user interface for allowing the
       user to select data from a file or database.
       <p>
       When the program starts up, it will read in data from a given file, and hold
       it in some type of container allowing rapid access.
       <p>
       The user may then type in the first few letters of the surname of a person,
       and this program should immediately present in a popup dialog the names which
       match.  The user will be able to click on one of the names in the popup and
       that will cause all data about that person to be displayed in the JTextArea
       at the bottom of the window.
       <p>
       This program requires the FormLayout.class, FormLayout$Placement.class, and
       FormLayout$Constraint.class files in the same directory
       (folder) or in its classpath.  These is provided separately.
    class PartMatch extends JFrame implements Runnable
                        /** Close down the program. */
       JButton quitbtn;
                        /** Field for the surname. */
       JTextField namefld;
                        /** Full details of the person(s). */
       JTextArea  results;
                        /** Popup dialog to display the names and addresses which
                        match the leading characters given in namefld. */
       Chooser matches;
                      /** Default background color for a window. */
       final static  Color            defBackground = new Color(0xD0C0C0);
                      /** Default foreground color for a window. */
       final static  Color            defForeground = new Color(0x000000);
                      /** Default background color for a field */
       final static  Color            fldBackground = new Color(0xFFFFFF);
                      /** Default background color for a button */
       final static  Color            btnBackground = new Color(0xF0E0E0);
       final static  Color            dkBackground = new Color(0xB0A0A0);
                      /** Larger font */
       final static  Font bold = new Font("Helvetica", Font.BOLD, 30);
       TreeSet members;
       String input;
       String[] found;
       public static void main(String arg[])
          UIManager.put("TextField.background",fldBackground);
          UIManager.put("TextField.foreground",defForeground);
          UIManager.put("TextField.selectionBackground",btnBackground);
          UIManager.put("TextArea.background",fldBackground);
          UIManager.put("TextArea.foreground",defForeground);
          UIManager.put("TextArea.selectionBackground",btnBackground);
          UIManager.put("Panel.background",defBackground);
          UIManager.put("Label.background",defBackground);
          UIManager.put("Label.foreground",defForeground);
          UIManager.put("Button.background",btnBackground);
          UIManager.put("Button.foreground",defForeground);
          UIManager.put("CheckBox.background",defBackground);
          UIManager.put("ScrollBar.background",defBackground);
          UIManager.put("ScrollBar.thumb",btnBackground);
          UIManager.put("ComboBox.background",btnBackground);
          UIManager.put("ComboBox.selectionBackground",dkBackground);
          PartMatch trial = new PartMatch(arg);
       public PartMatch( String [] arg )
          super("Part Match");
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          Container cpane = getContentPane();
          FormLayout form = new FormLayout(cpane);
          JLabel lab1 = new JLabel("Fetch details") ;
          lab1.setFont( bold );
          form.setTopAnchor( lab1, 4 );
          form.setLeftAnchor( lab1, 4 );
          JLabel lab2 = new JLabel("Surname: ") ;
          form.setTopRelative( lab2, lab1, 4 );
          form.setLeftAlign( lab2, lab1 );
          namefld = new JTextField( 30 );
          form.setBottomAlign( namefld, lab2 );
          form.setLeftRelative( namefld, lab2, 4 );
          namefld.addCaretListener( new CaretListener()
             public void caretUpdate(CaretEvent e)
                 showMatches();
          quitbtn = new JButton( "Quit" );
          quitbtn.addActionListener( new ActionListener()
             public void actionPerformed(ActionEvent e)
                quitProcessing();
          form.setBottomAlign( quitbtn, namefld );
          form.setLeftRelative( quitbtn, namefld, 15 );
          results = new JTextArea( 10,50 );
          results.setEditable(false);
          JScrollPane jsp = new JScrollPane( results,
                                     JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                     JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED );
          form.setTopRelative( jsp, lab2, 6 );
          form.setLeftAlign( jsp, lab2 );
          form.setBottomAnchor( jsp, 5 );
          form.setRightAnchor( jsp, 5 );
          form.setRightAnchor( quitbtn, 5 );
          matches = new Chooser( this );
          //matches.setUndecorated(true);
          pack();
          setVisible(true);
          namefld.requestFocus();
          if (arg.length > 0) init(arg[0]);
          else init("triathlon.txt"); //<<<<<<<<<<<<<<<< Place the default filename here
          /** Called once only, at the end of the constructor, to read the data
            * from the membership file.
       public void init( String fname )
          members = new TreeSet();
           try {
               FileReader fr = new FileReader(new File (fname));
               Scanner scan = new Scanner(fr);
               trimember cmem;
               String cLine, eTag, memberNo, first, last, gender, yob, tel ,addr,
                       club;
               while(scan.hasNextLine())
                   cLine = scan.nextLine();
                   Scanner scan2 = new Scanner(cLine);
                   scan2.useDelimiter(";");
                   eTag = scan2.next().trim();
                   memberNo = scan2.next().trim();
                   first = scan2.next().trim();
                   last = scan2.next().trim();
                   gender = scan2.next().trim();
                   yob = scan2.next().trim();
                   tel = scan2.next().trim();
                   addr = scan2.next().trim();
                   club = scan2.next().trim();
                   cmem = new trimember(eTag, memberNo, first, last, gender, yob,
                           tel, addr, club);
                   members.add(cmem);
           catch (FileNotFoundException ex)
               results.append("Sorry can't find the input file\n");
               results.append("Please check file name and location and try again");
               ex.printStackTrace();
          /** Called every time there is a change in the contents of the text field
            * namefld.  It will first clear the text area.  It then needs to search
            * through the container of data to find all records where the surname
            * starts with the characters that have been typed.  The names and
            * addresses need to be set up as strings and placed in
            * an array of Strings.  This can be placed in the "matches" window and
            * displayed for the user, inviting one to be selected.
            * <p>
            * The performance of this is very important.  If necessary, it may be
            * necessary to run as a separate thread so that the user interface is
            * not delayed.  It is essential that the user be able to type letters at a
            * reasonable speed and not have the keystroke processing held up by
            * previous text.
       public void showMatches( )
           run();
                // First clear the text area
          //results.setText("");
                // Determine the leading characters of the surname that is wanted
                input = namefld.getText();
                // Locate the data for this name, and display each matching item
                //  in the JTextArea ...
                // Example of how to set the data in the popup dialog
          matches.list.setListData(found);
          matches.pack();   // resize the popup
                // set the location of the popup if it is not currently visible
          if ( ! matches.isVisible())
             Dimension sz = matches.getSize();
             Point mouse = getMousePosition();
             Point framepos = getLocation();
             int x=0, y=0;
             if (mouse == null)
                Point pt = results.getLocation();
                x = pt.x + 20 + framepos.x;
                y = pt.y + 20 + framepos.y;
             else
                x = mouse.x - 2 + framepos.x;
                y = mouse.y - 2 + framepos.y;
             matches.setLocation(x,y);
          matches.setVisible(true);
          namefld.requestFocus();
          /** Perform any final processing before closing down.
       public void quitProcessing( )
          // Any closing work.  Then
          System.exit(0);
        public void run()
            ArrayList<String> foundit = new ArrayList<String>();
            System.out.println(input);
            if(input != null)
            Iterator it = members.iterator();
            while(it.hasNext())
               trimember test = (trimember) it.next();
               if (test.last.startsWith(input))
                   foundit.add(test.last +", "+ test.first);
            found = new String[foundit.size()];
            for(int i=0; i<foundit.size();i++)
                found[i] = foundit.get(i);
         /** A window for displaying names and addresses from the data set which
          match the leading characters in namefld.
          <p>
          This will automatically pop down if the user moves the mouse out of the
          window.
          <p>
          It needs code added to it to respond to the user clicking on an item in
          the displayed list. */
       class Chooser extends JWindow
                /** To display a set of names and addresses that match the leading
                characters of the namefld text field. */
          public JList list = new JList();
          Chooser( JFrame parent )
             super( parent );
             Container cpane = getContentPane();
             cpane.addMouseListener( new MouseAdapter()
                public void mouseExited(MouseEvent e)
                   Chooser.this.setVisible(false);
             cpane.add("Center",list);
             list.addListSelectionListener( new ListSelectionListener()
                public void valueChanged(ListSelectionEvent e)
                   Chooser.this.setVisible(false);
                   System.out.println("ValueChanged");
                   // First clear the text area
                   results.setText("");
                   String in = (String) list.getSelectedValue();
                   System.out.println("Selected Value was : "+in);
                   String[] inlf = in.split(", ");
                   System.out.println("inlf[0]:"+inlf[0]+" inlf[1]:"+inlf[1]);
                   results.append("Surname \tFirst \teTag \tMemberNo \tSex \tYOB " +
                           "\tTel \tAddress \t\t\tClub\n");
                   Iterator it = members.iterator();
                   while(it.hasNext())
                       trimember test = (trimember) it.next();
                       if (test.last.equals(inlf[0])&&test.first.equals(inlf[1]))
                           results.append(test.toString()+"\n");
                   namefld.requestFocus();
          public class trimember implements Comparable
           String eTag;
           public String memberNo;
           public String first;
           public String last;
           String gender;
           String yob;
           String tel;
           String addr;
           String club;
           public trimember(String eT, String me, String fi, String la,
                   String ge, String yo, String te, String ad, String cl)
               eTag = eT;
               memberNo = me;
               first = fi;
               last = la;
               gender = ge;
               yob = yo;
               tel = te;
               addr = ad;
               club = cl;         
           //To String method to output string of details
           public String toString()
               return last + "\t" + first + "\t" + eTag + "\t" +
                       memberNo + "\t" + gender + "\t" + yob + "\t"+ tel + "\t" +
                       addr + "\t" + club;
           //Compare and sort on Last name
           public int compareTo(Object o)
               trimember com = (trimember) o;
               int lastCmp = last.compareTo(com.last);
               int firstCmp = first.compareTo(com.first);
               int memCmp = memberNo.compareTo(com.memberNo);
               if (lastCmp == 0 && firstCmp !=0)return firstCmp;
               else if (lastCmp==0&&firstCmp==0)return memCmp;
               else return lastCmp;
    }

    Please don't cross-post. It is considered very rude to do that here:
    http://forum.java.sun.com/thread.jspa?messageID=9953193

  • Help needed, Providing Dynamic User input

    Hello,
    I am attempting to create some dynamic user input by "predicting" what the user requires in a text box.
    For example if the user enters "Smi" I have a select list pop up which gives the user all options that begin with "Smi".
    I am able to achieve the popups but the interface is quite jerky and not terribly responsive I am trying to solve this by using a thread which starts and stops when new input is received but it is still not quite right.
    The program uses a Sorted TreeSet to hold the data (I thought this would give me a quick search time) and a simple interface at this stage.
    Any help would be fantastic
    Thanks in advance :P
    import java.io.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import java.text.*;
    import java.util.*;
       /** This program represents part of a larger user interface for allowing the
       user to select data from a file or database.
       <p>
       When the program starts up, it will read in data from a given file, and hold
       it in some type of container allowing rapid access.
       <p>
       The user may then type in the first few letters of the surname of a person,
       and this program should immediately present in a popup dialog the names which
       match.  The user will be able to click on one of the names in the popup and
       that will cause all data about that person to be displayed in the JTextArea
       at the bottom of the window.
       <p>
       This program requires the FormLayout.class, FormLayout$Placement.class, and
       FormLayout$Constraint.class files in the same directory
       (folder) or in its classpath.  These is provided separately.
    class PartMatch extends JFrame implements Runnable
                        /** Close down the program. */
       JButton quitbtn;
                        /** Field for the surname. */
       JTextField namefld;
                        /** Full details of the person(s). */
       JTextArea  results;
                        /** Popup dialog to display the names and addresses which
                        match the leading characters given in namefld. */
       Chooser matches;
                      /** Default background color for a window. */
       final static  Color            defBackground = new Color(0xD0C0C0);
                      /** Default foreground color for a window. */
       final static  Color            defForeground = new Color(0x000000);
                      /** Default background color for a field */
       final static  Color            fldBackground = new Color(0xFFFFFF);
                      /** Default background color for a button */
       final static  Color            btnBackground = new Color(0xF0E0E0);
       final static  Color            dkBackground = new Color(0xB0A0A0);
                      /** Larger font */
       final static  Font bold = new Font("Helvetica", Font.BOLD, 30);
       TreeSet members;
       String input;
       String[] found;
       public static void main(String arg[])
          UIManager.put("TextField.background",fldBackground);
          UIManager.put("TextField.foreground",defForeground);
          UIManager.put("TextField.selectionBackground",btnBackground);
          UIManager.put("TextArea.background",fldBackground);
          UIManager.put("TextArea.foreground",defForeground);
          UIManager.put("TextArea.selectionBackground",btnBackground);
          UIManager.put("Panel.background",defBackground);
          UIManager.put("Label.background",defBackground);
          UIManager.put("Label.foreground",defForeground);
          UIManager.put("Button.background",btnBackground);
          UIManager.put("Button.foreground",defForeground);
          UIManager.put("CheckBox.background",defBackground);
          UIManager.put("ScrollBar.background",defBackground);
          UIManager.put("ScrollBar.thumb",btnBackground);
          UIManager.put("ComboBox.background",btnBackground);
          UIManager.put("ComboBox.selectionBackground",dkBackground);
          PartMatch trial = new PartMatch(arg);
       public PartMatch( String [] arg )
          super("Part Match");
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          Container cpane = getContentPane();
          FormLayout form = new FormLayout(cpane);
          JLabel lab1 = new JLabel("Fetch details") ;
          lab1.setFont( bold );
          form.setTopAnchor( lab1, 4 );
          form.setLeftAnchor( lab1, 4 );
          JLabel lab2 = new JLabel("Surname: ") ;
          form.setTopRelative( lab2, lab1, 4 );
          form.setLeftAlign( lab2, lab1 );
          namefld = new JTextField( 30 );
          form.setBottomAlign( namefld, lab2 );
          form.setLeftRelative( namefld, lab2, 4 );
          namefld.addCaretListener( new CaretListener()
             public void caretUpdate(CaretEvent e)
                 showMatches();
          quitbtn = new JButton( "Quit" );
          quitbtn.addActionListener( new ActionListener()
             public void actionPerformed(ActionEvent e)
                quitProcessing();
          form.setBottomAlign( quitbtn, namefld );
          form.setLeftRelative( quitbtn, namefld, 15 );
          results = new JTextArea( 10,50 );
          results.setEditable(false);
          JScrollPane jsp = new JScrollPane( results,
                                     JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                     JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED );
          form.setTopRelative( jsp, lab2, 6 );
          form.setLeftAlign( jsp, lab2 );
          form.setBottomAnchor( jsp, 5 );
          form.setRightAnchor( jsp, 5 );
          form.setRightAnchor( quitbtn, 5 );
          matches = new Chooser( this );
          //matches.setUndecorated(true);
          pack();
          setVisible(true);
          namefld.requestFocus();
          if (arg.length > 0) init(arg[0]);
          else init("triathlon.txt"); //<<<<<<<<<<<<<<<< Place the default filename here
          /** Called once only, at the end of the constructor, to read the data
            * from the membership file.
       public void init( String fname )
          members = new TreeSet();
           try {
               FileReader fr = new FileReader(new File (fname));
               Scanner scan = new Scanner(fr);
               trimember cmem;
               String cLine, eTag, memberNo, first, last, gender, yob, tel ,addr,
                       club;
               while(scan.hasNextLine())
                   cLine = scan.nextLine();
                   Scanner scan2 = new Scanner(cLine);
                   scan2.useDelimiter(";");
                   eTag = scan2.next().trim();
                   memberNo = scan2.next().trim();
                   first = scan2.next().trim();
                   last = scan2.next().trim();
                   gender = scan2.next().trim();
                   yob = scan2.next().trim();
                   tel = scan2.next().trim();
                   addr = scan2.next().trim();
                   club = scan2.next().trim();
                   cmem = new trimember(eTag, memberNo, first, last, gender, yob,
                           tel, addr, club);
                   members.add(cmem);
           catch (FileNotFoundException ex)
               results.append("Sorry can't find the input file\n");
               results.append("Please check file name and location and try again");
               ex.printStackTrace();
          /** Called every time there is a change in the contents of the text field
            * namefld.  It will first clear the text area.  It then needs to search
            * through the container of data to find all records where the surname
            * starts with the characters that have been typed.  The names and
            * addresses need to be set up as strings and placed in
            * an array of Strings.  This can be placed in the "matches" window and
            * displayed for the user, inviting one to be selected.
            * <p>
            * The performance of this is very important.  If necessary, it may be
            * necessary to run as a separate thread so that the user interface is
            * not delayed.  It is essential that the user be able to type letters at a
            * reasonable speed and not have the keystroke processing held up by
            * previous text.
       public void showMatches( )
           run();
                // First clear the text area
          //results.setText("");
                // Determine the leading characters of the surname that is wanted
                input = namefld.getText();
                // Locate the data for this name, and display each matching item
                //  in the JTextArea ...
                // Example of how to set the data in the popup dialog
          matches.list.setListData(found);
          matches.pack();   // resize the popup
                // set the location of the popup if it is not currently visible
          if ( ! matches.isVisible())
             Dimension sz = matches.getSize();
             Point mouse = getMousePosition();
             Point framepos = getLocation();
             int x=0, y=0;
             if (mouse == null)
                Point pt = results.getLocation();
                x = pt.x + 20 + framepos.x;
                y = pt.y + 20 + framepos.y;
             else
                x = mouse.x - 2 + framepos.x;
                y = mouse.y - 2 + framepos.y;
             matches.setLocation(x,y);
          matches.setVisible(true);
          namefld.requestFocus();
          /** Perform any final processing before closing down.
       public void quitProcessing( )
          // Any closing work.  Then
          System.exit(0);
        public void run()
            ArrayList<String> foundit = new ArrayList<String>();
            System.out.println(input);
            if(input != null)
            Iterator it = members.iterator();
            while(it.hasNext())
               trimember test = (trimember) it.next();
               if (test.last.startsWith(input))
                   foundit.add(test.last +", "+ test.first);
            found = new String[foundit.size()];
            for(int i=0; i<foundit.size();i++)
                found[i] = foundit.get(i);
         /** A window for displaying names and addresses from the data set which
          match the leading characters in namefld.
          <p>
          This will automatically pop down if the user moves the mouse out of the
          window.
          <p>
          It needs code added to it to respond to the user clicking on an item in
          the displayed list. */
       class Chooser extends JWindow
                /** To display a set of names and addresses that match the leading
                characters of the namefld text field. */
          public JList list = new JList();
          Chooser( JFrame parent )
             super( parent );
             Container cpane = getContentPane();
             cpane.addMouseListener( new MouseAdapter()
                public void mouseExited(MouseEvent e)
                   Chooser.this.setVisible(false);
             cpane.add("Center",list);
             list.addListSelectionListener( new ListSelectionListener()
                public void valueChanged(ListSelectionEvent e)
                   Chooser.this.setVisible(false);
                   System.out.println("ValueChanged");
                   // First clear the text area
                   results.setText("");
                   String in = (String) list.getSelectedValue();
                   System.out.println("Selected Value was : "+in);
                   String[] inlf = in.split(", ");
                   System.out.println("inlf[0]:"+inlf[0]+" inlf[1]:"+inlf[1]);
                   results.append("Surname \tFirst \teTag \tMemberNo \tSex \tYOB " +
                           "\tTel \tAddress \t\t\tClub\n");
                   Iterator it = members.iterator();
                   while(it.hasNext())
                       trimember test = (trimember) it.next();
                       if (test.last.equals(inlf[0])&&test.first.equals(inlf[1]))
                           results.append(test.toString()+"\n");
                   namefld.requestFocus();
          public class trimember implements Comparable
           String eTag;
           public String memberNo;
           public String first;
           public String last;
           String gender;
           String yob;
           String tel;
           String addr;
           String club;
           public trimember(String eT, String me, String fi, String la,
                   String ge, String yo, String te, String ad, String cl)
               eTag = eT;
               memberNo = me;
               first = fi;
               last = la;
               gender = ge;
               yob = yo;
               tel = te;
               addr = ad;
               club = cl;         
           //To String method to output string of details
           public String toString()
               return last + "\t" + first + "\t" + eTag + "\t" +
                       memberNo + "\t" + gender + "\t" + yob + "\t"+ tel + "\t" +
                       addr + "\t" + club;
           //Compare and sort on Last name
           public int compareTo(Object o)
               trimember com = (trimember) o;
               int lastCmp = last.compareTo(com.last);
               int firstCmp = first.compareTo(com.first);
               int memCmp = memberNo.compareTo(com.memberNo);
               if (lastCmp == 0 && firstCmp !=0)return firstCmp;
               else if (lastCmp==0&&firstCmp==0)return memCmp;
               else return lastCmp;
    }Edited by: Roger on Nov 3, 2007 11:50 AM

    Please don't cross-post. It is considered very rude to do that here:
    http://forum.java.sun.com/thread.jspa?threadID=5233033&messageID=9953169#9953169

  • How to save User input into DB using webdynpro abap

    Hi,
    Im trying to create an application using webdynpro abap.
    I want to know how to save the data input by user, into a database table.
    In my UI, I have a table control which is editable and user inputs data into this. I need to know how i can transfer this data to a DB table.

    hello,
    u can do it by reading ur context node.
    we bind our UI elements to context attributes of appropriate type .
    we read their values using the code wizard or by pressing control+F7, click on radio button read node/attribute
    here for ur specific case , u must have binded ur table control with the context attribute , now u need to simply read this attribute
    eg suppose u have created a context node " cn_table"
      reading context node cn_table
       DATA : lo_nd_cn_table TYPE REF TO if_wd_context_node ,
             lo_el_cn_table TYPE REF TO if_wd_context_element ,
             ls_cn_table    TYPE wd_this->element_cn_table.
    *   navigate from <CONTEXT> to <CN_TABLE> via lead selection
      lo_nd_cn_table = wd_context->get_child_node(
                       name = wd_this->wdctx_cn_table ).
    **    get element via lead selection
      lo_el_cn_table = lo_nd_cn_table->get_lead_selection(  ).
      lo_el_cn_table->get_static_attributes( IMPORTING
                 static_attributes = wa_table ).
    here wa_table is the work area of structure type . u need to create a structure first with the same variables as there are the context attributes in ur node cn_table
    in ur
    now ur wa_tablecontains value
    u can nw use appropriate FM to update , delete and modify the DB table using the value
    u cn directly use SQL statements as well in the method of ur view , but direct SQL statements are nt recommende
    rgds,
    amit

  • How can i read user input value to my User exist

    Hi Guru's,
    I am facing one problem in Variables in BPS.
    I am calculating days from Month/year .I have one variable it is for Days,Second variable it is for Month/Year.
    First variable is user exist (for calculating the days),Second varible is user defined variable(this is a Input to the first variable).
    When i am giving the Month/Year(02/2008)variable i am getting the 29 days from the first variable.again i am changing the value of Month/Yera(03/2008) i am not getting the desired value.
    my doubt is my user exist not able to read current value of variable(month/year).how can i pass my value to user exist because this value is user input value based on this value i am calculating the days and dynamically displaying the layout.
    Here is the my sample code..
    seq = '0000'.
    ind = 0.
       i_area = 'ZTEST1'.
       area_var = 'ZVar2'.
    PERFORM instantiate_object USING    i_area
                                        area_var
                                 CHANGING lsr_var.
    PERFORM get_current_value_of_variable
                            USING lsr_var
                            CHANGING lto_value.
    READ TABLE lto_value INTO lso_value index 1  .
    i_month = lso_value-low.
    iv_month = i_month+4(2).
    iv_year = i_month(4).
    concatenate iv_year iv_month '01' into iv_date.
    begindate = iv_date.
    below bracket code calculating the leap year
    ( IF iv_date+4(2) = lc_feb.
        lv_hlp_date_year = iv_date+0(4).
        lv_hlp_rest      = lv_hlp_date_year MOD 4.
        IF lv_hlp_rest = 0.
          EV_DAYS = lc_days_29.
          lv_hlp_rest = lv_hlp_date_year MOD 100.
          IF lv_hlp_rest = 0.
            lv_hlp_rest = lv_hlp_date_year MOD 400.
            IF lv_hlp_rest NE 0.
              EV_DAYS = lc_days_28.
            ENDIF.
          ENDIF.
        ELSE.
          EV_DAYS = lc_days_28.
        ENDIF.)
      ELSE.
    below bracket code calculating the days
    (   CASE iv_date+4(2).
          WHEN lc_jan. EV_DAYS = lc_days_31.
          WHEN lc_mar. EV_DAYS = lc_days_31.
          WHEN lc_may. EV_DAYS = lc_days_31.
          WHEN lc_jul. EV_DAYS = lc_days_31.
          WHEN lc_aug. EV_DAYS = lc_days_31.
          WHEN lc_oct. EV_DAYS = lc_days_31.
          WHEN lc_dec. EV_DAYS = lc_days_31.
          WHEN lc_apr. EV_DAYS = lc_days_30.
          WHEN lc_jun. EV_DAYS = lc_days_30.
          WHEN lc_sep. EV_DAYS = lc_days_30.
          WHEN lc_nov. EV_DAYS = lc_days_30.
          WHEN OTHERS.   CLEAR EV_DAYS.
        ENDCASE.)
      ENDIF.
    data: st_date(2) type c.
    st_date = '01'.
    ind = 0.
    ind = ind + 1.
    here i am passing the low value and high value.
    yto_charsel-chanm = '0CALDAY'.
    yto_charsel-seqno = 1.
    yto_charsel-sign  = 'I'.
    yto_charsel-opt   = 'EQ'.
    yto_charsel-LOW = st_date.
    yto_charsel-chanm = '0CALDAY'.
    yto_charsel-seqno = 1.
    yto_charsel-sign  = 'I'.
    yto_charsel-opt   = 'BT'.
    yto_charsel-high = ev_days.
    INSERT yto_charsel INTO sto_charsel INDEX ind.
    ETO_CHARSEL = sto_charsel.
    lto_value = sto_charsel.
    How can i pass user input value to read this exist ,some where again i have to write code or else??
    This is very urgent can you help me..

    Hi,
    Instead of two perform statements, use single perform.
    PERFORM get_value USING i_area
                              i_variable
                         CHANGING lw_varsel.
    Take the values from lw_varsel-low.
    FORM statement for this perform is as follows.
    DATA: li_varsel TYPE STANDARD TABLE OF upc_ys_api_varsel,
            lv_varsel TYPE REF TO cl_sem_variable.
      FORM get_value USING p_area TYPE upc_y_area
                           p_variable TYPE upc_y_variable
                     CHANGING
                           p_lw_varsel TYPE upc_ys_api_varsel.
        CALL METHOD cl_sem_variable=>get_instance
          EXPORTING
            i_area       = p_area
            i_variable   = p_variable
             I_CREATE     =
          RECEIVING
            rr_variable  = lv_varsel.
           EXCEPTIONS
             NOT_EXISTING = 1
             others       = 2
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        REFRESH li_varsel.
    ****Getting the Value*********
        CALL METHOD lv_varsel->get_value
          EXPORTING
            i_user     = sy-uname
            i_restrict = 'X'
          RECEIVING
            rto_value  = li_varsel.
        CLEAR : p_lw_varsel.
        READ TABLE li_varsel INTO p_lw_varsel INDEX 1.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
      ENDFORM.                    "get_value
    Try this code.
    Bindu

  • Cannot Read user input on Adobe Form .

    Hi team,
    Can you please go through the issue -
    Developed Interactive Adobe form. Called by webdynpro application.
    Interactive properties enable, display type - native, with pdfsource, template source and data source cleanly populated.
    Submit button is webdynpro native with option CLICK and corresponding code selected in ADOBE FORM.
    All the elements in adobe forms cleanly binded and checked more than 10 times to avoid any mistakes or wrong bindings.
    Event handler code is written for submit button to read the data eneted by user on adobe form.
      lo_el_zleaver_form->get_static_attributes(
        IMPORTING
          static_attributes = ls_zleaver_form ).
    User is able to enter data on adobe form and control is comming to Submit button code but i am not able to read the user input with above code.
    BASIS has check and confirmed that license is installed properly. I am using adobe reader 9 and adobe designer 8.2 and will ECC version 6.0 . Basis has confirmed the ADS configuration, Java stack and ABAP stack are compatible.
    We are using the ADS from SAP NetWeaver 7.01 (EhP1, Java Stack) in
    combination with SAP NetWeaver 7.00 SP15 (ABAP stack).
    Mohan.

    Hi Guys,
    I also created one more Adobe interactive form to test and again USER INPUT CANNOT BE READ. After user click on SUBMIT button the below code is written in SUBMIT button. I am not able to read department details below enteted by user. Is there any othe method you want me to call. I also tried GET_ATTRIBUTE
    Will there be any problem with above version of ADS or ALD etc..
          DATA lo_nd_zdept TYPE REF TO if_wd_context_node.
          DATA lo_el_zdept TYPE REF TO if_wd_context_element.
          DATA ls_zdept TYPE wd_this->element_zdept.
        navigate from <CONTEXT> to <ZDEPT> via lead selection
          lo_nd_zdept = wd_context->path_get_node( path = `ADOBE.ZDEPT` ).
        @TODO handle non existant child
        IF lo_nd_zdept IS INITIAL.
        ENDIF.
        get element via lead selection
          lo_el_zdept = lo_nd_zdept->get_element( ).
        @TODO handle not set lead selection
          IF lo_el_zdept IS INITIAL.
          ENDIF.
        get all declared attributes
          lo_el_zdept->get_static_attributes(
            IMPORTING
              static_attributes = ls_zdept ).
    This is other interactive form where i also tried GET_ATTRIBUTE
    USING GET_ATTRIBUTE***************
      node_info = lo_nd_zleaver_form->get_node_info( ).
    I tried both GET_ATTRIBUTE and GET_ATTRIBUTES but failed.
      node_info->GET_ATTRIBUTES(
      RECEIVING
      ATTRIBUTES = stru_zleaver_Forms ) .
    OR
    lo_nd_zleaver_form = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_ZLEAVER_FORM ).
      lo_EL_zleaver_form->GET_ATTRIBUTE( EXPORTING NAME  = 'LEAVES_TAKEN'
                               IMPORTING VALUE = LW_LEAVES_TAKEN ).

Maybe you are looking for

  • How can i disable the ~3 search "guesses" in the location bar, above the suggestions from my history?

    In the new version of Firefox, when I start typing something to the address bar, instead of showing suggestions from my history, it shows ~3 "popular search strings", as in Google search bar (for example if i type 'a', it shows aol, aol mail and amaz

  • ESS is not working properly after upgrade from 4.7 to ECC6.0

    ESS Scenario in 4.7 4.7 Scenario: The IMG configuration u201CWork and Life Eventsu201D is done to map them with the PZM3 service (Home Page) to get them as different folders/links on the home page as given below: List of Services used to set up ESS:

  • BPM - Exception not thrown

    Hi , I created a BPM in which I I have Receive Step -> Send Step -> Block Step -> Block Processing branch - Receive Step ->Send Step Block Dead Line Branch - Dead line of 1 minute and Control step for raising exception Block Exception handler branch

  • Bulk collect limit 1000 is looping only 1000 records out of 35000 records

    In below code I have to loop around 35000 records for every month of the year starting from Aug-2010 to Aug-2011. I am using bulk collect with limit clause but the problem is: a: Limit clause is returning only 1000 records. b: It is taking too much t

  • Last Post Date (and Time?)

    Before the last revision of Discussions format the My Subscriptions page under Last Post the date of the last post in a forum or category was listed along with _the time_ of the post. This was a very helpful feature as one could scan the list and see