Pls help...Ur OPINION counts!

Pls i nid all to recommend a fone not mor dan #20000($140) dat supports or can install ms word,excel,access etc.jst one i can submit CVs with.I av so many options bt i'll prefer one with additional features wit within d same price. Thanks

Hope you got the answer here

Similar Messages

  • Pls help me to count the no of occurence of each word in the data file

    I want to count the no of occurence of each word the data file..
    anybody help me out to solve this ,,
    I have attached my code hereby...
    import java.io.*;
    import java.util.*;
    import java.util.Collections;
    import javax.print.attribute.standard.Media;
    class WordCounter1 {
    String s;
    String word;
    public static void main (String[] args){
         WordCounter1 simpleCounter= new WordCounter1();
    try
    File firstFile=new File("C:/Documents and Settings/janmala/file4.txt");
    simpleCounter.countWords(firstFile);
    catch(Exception e)
    System.err.println(e);
    void countWords(File inputFile)
    int count=0;
    int key=0;
    LinkedHashMap lhm=new LinkedHashMap();
    try{
    FileInputStream fin=new FileInputStream(inputFile);
    DataInputStream din=new DataInputStream(fin);
    while(din.available()!=0){
    s=din.readLine();
    StringTokenizer st=new StringTokenizer(s);
    while(st.hasMoreTokens())
    word=st.nextToken();
    lhm.put(word,count);
    if(lhm.containsKey(word))
    lhm.get(word);
    count++;
    System.out.println(word);
    System.out.println(count);
    int a=lhm.size();
    System.out.println("The size of Hash map"+a);
    Set set = lhm.entrySet();
    Iterator it = set.iterator();
    while(it.hasNext())
    Map.Entry me = (Map.Entry)it.next();
    System.out.println(me.getValue()+":"+me.getKey());
    catch(Exception e)
    System.err.println(e);
    }}

    jan07 wrote:
    anybody help me out to solve this ,,Solve what?
    Don't just dump a pile of unformatted code and expect someone to magically fix it for you.
    Post code, hightlight it and click the CODE button to retain formatting
    Include error messages if you get them
    Ask an actual question

  • URGENT, PLS HELP: AQ retry count

    Hi, need ur help again,
    Found that when setup the queue table to allow multiple subscriber, then the delay for te retry of the AQ (in oracle enterprise manager,OEM) is disabled for configuration.
    Is there any way to work around this? So that i can configure the delay in OEM.
    Then, another issue is, when set the retry count to 10, but AQ only retry 6 times. How to correct this situation?
    Many many thanks!

    I've just read this thread three times and I have absolutely no idea what you are doing, in what version, and what you are asking for help with.
    Do you want to change the message type? If you do you MUST drop the queue and start over again from the beginning.
    Do you want to enqueue messages?
    Post your DDL and other relevant information or you are on your own. We can not guess at your issue.

  • Can someone pls help me with this code

    The method createScreen() creates the first screen wherein the user makes a selection if he wants all the data ,in a range or single data.The problem comes in when the user makes a selection of single.that then displays the singleScreen() method.Then the user has to input a key data like date or invoice no on the basis of which all the information for that set of data is selected.Now if the user inputs a wrong key that does not exist for the first time the program says invalid entry of data,after u click ok on the option pane it prompts him to enter the data again.But since then whenever the user inputs wrong data the program says wrong data but after displaying the singlescreen again does not wait for input from the user it again flashes the option pane with the invalid entry message.and this goes on doubling everytime the user inputs wrong data.the second wrong entry of data flashes the error message twice,the third wrong entry flashes the option pane message 4 times and so on.What actually happens is it does not wait at the singlescreen() for user to input data ,it straight goes into displaying the JOptionPane message for wrong data entry so we have to click the optiion pane twice,four times and so on.
    Can someone pls help me with this!!!!!!!!!
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.text.*;
    import java.util.*;
    public class MainMenu extends JFrame implements ActionListener,ItemListener{
    //class     
         FileReaderDemo1 fd=new FileReaderDemo1();
         FileReaderDemo1 fr;
         Swing1Win sw;
    //primary
         int monthkey=1,counter=0;
         boolean flag=false,splitflag=false;
         String selection,monthselection,dateselection="01",yearselection="00",s,searchcriteria="By Date",datekey,smonthkey,invoiceno;
    //arrays
         String singlesearcharray[];
         String[] monthlist={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"};
         String[] datelist=new String[31];
         String[] yearlist=new String[100];
         String[] searchlist={"By Date","By Invoiceno"};
    //collection
         Hashtable allinvoicesdata=new Hashtable();
         Vector data=new Vector();
         Enumeration keydata;
    //components
         JButton next=new JButton("NEXT>>");
         JComboBox month,date,year,search;
         JLabel bydate,byinvno,trial;
         JTextField yeartext,invtext;
         JPanel panel1,panel2,panel3,panel4;
         JRadioButton single,range,all;
         ButtonGroup group;
         JButton select=new JButton("SELECT");
    //frame and layout declarations
         JFrame jf;
         Container con;
         GridBagLayout gridbag=new GridBagLayout();
         GridBagConstraints gc=new GridBagConstraints();
    //constructor
         MainMenu(){
              jf=new JFrame();
              con=getContentPane();
              con.setLayout(null);
              fr=new FileReaderDemo1();
              createScreen();
              setSize(500,250);
              setLocation(250,250);
              setVisible(true);
    //This is thefirst screen displayed
         public void createScreen(){
              group=new ButtonGroup();
              single=new JRadioButton("SINGLE");
              range=new JRadioButton("RANGE");
              all=new JRadioButton("ALL");
              search=new JComboBox(searchlist);
              group.add(single);
              group.add(range);
              group.add(all);
              single.setBounds(100,50,100,20);
              search.setBounds(200,50,100,20);
              range.setBounds(100,90,100,20);
              all.setBounds(100,130,100,20);
              select.setBounds(200,200,100,20);
              con.add(single);
              con.add(search);
              con.add(range);
              con.add(all);
              con.add(select);
              search.setEnabled(false);
              single.addItemListener(this);
              search.addActionListener(new MyActionListener());     
              range.addItemListener(this);
              all.addItemListener(this);
              select.addActionListener(this);
         public class MyActionListener implements ActionListener{
              public void actionPerformed(ActionEvent a){
                   JComboBox cb=(JComboBox)a.getSource();
                   if(a.getSource().equals(month))
                        monthkey=((cb.getSelectedIndex())+1);
                   if(a.getSource().equals(date)){
                        dateselection=(String)cb.getSelectedItem();
                   if(a.getSource().equals(year))
                        yearselection=(String)cb.getSelectedItem();
                   if(a.getSource().equals(search)){
                        searchcriteria=(String)cb.getSelectedItem();
         public void itemStateChanged(ItemEvent ie){
              if(ie.getItem()==single){
                   selection="single";     
                   search.setEnabled(true);
              else if (ie.getItem()==all){
                   selection="all";
                   search.setEnabled(false);
              else if (ie.getItem()==range){
                   search.setEnabled(false);
         public void actionPerformed(ActionEvent ae){          
              if(ae.getSource().equals(select))
                        if(selection.equals("single")){
                             singleScreen();
                        if(selection.equals("all"))
                             sw=new Swing1Win();
              if(ae.getSource().equals(next)){
                   if(monthkey<9)
                        smonthkey="0"+monthkey;
                   System.out.println(smonthkey+"/"+dateselection+"/"+yearselection+"it prints this");
                   allinvoicesdata=fr.read(searchcriteria);
                   if (searchcriteria.equals("By Date")){
                        System.out.println("it goes in this");
                        singleinvoice(smonthkey+"/"+dateselection+"/"+yearselection);
                   else if (searchcriteria.equals("By Invoiceno")){
                        invoiceno=invtext.getText();
                        singleinvoice(invoiceno);
                   if (flag == false){
                        System.out.println("flag is false");
                        singleScreen();
                   else{
                   System.out.println("its in here");
                   singlesearcharray=new String[data.size()];
                   data.copyInto(singlesearcharray);
                   sw=new Swing1Win(singlesearcharray);
         public void singleinvoice(String searchdata){
              keydata=allinvoicesdata.keys();
              while(keydata.hasMoreElements()){
                        s=(String)keydata.nextElement();
                        if(s.equals(searchdata)){
                             System.out.println(s);
                             flag=true;
                             break;
              if (flag==true){
                   System.out.println("vector found");
                   System.exit(0);
                   data= ((Vector)(allinvoicesdata.get(s)));
              else{
                   JOptionPane.showMessageDialog(jf,"Invalid entry of date : choose again");     
         public void singleScreen(){
              System.out.println("its at the start");
              con.removeAll();
              SwingUtilities.updateComponentTreeUI(con);
              con.setLayout(null);
              counter=0;
              panel2=new JPanel(gridbag);
              bydate=new JLabel("By Date : ");
              byinvno=new JLabel("By Invoice No : ");
              dateComboBox();
              invtext=new JTextField(6);
              gc.gridx=0;
              gc.gridy=0;
              gc.gridwidth=1;
              gridbag.setConstraints(month,gc);
              panel2.add(month);
              gc.gridx=1;
              gc.gridy=0;
              gridbag.setConstraints(date,gc);
              panel2.add(date);
              gc.gridx=2;
              gc.gridy=0;
              gc.gridwidth=1;
              gridbag.setConstraints(year,gc);
              panel2.add(year);
              bydate.setBounds(100,30,60,20);
              con.add(bydate);
              panel2.setBounds(170,30,200,30);
              con.add(panel2);
              byinvno.setBounds(100,70,100,20);
              invtext.setBounds(200,70,50,20);
              con.add(byinvno);
              con.add(invtext);
              next.setBounds(300,200,100,20);
              con.add(next);
              if (searchcriteria.equals("By Invoiceno")){
                   month.setEnabled(false);
                   date.setEnabled(false);
                   year.setEnabled(false);
              else if(searchcriteria.equals("By Date")){
                   byinvno.setEnabled(false);
                   invtext.setEnabled(false);
              monthkey=1;
              dateselection="01";
              yearselection="00";
              month.addActionListener(new MyActionListener());
              date.addActionListener(new MyActionListener());
              year.addActionListener(new MyActionListener());
              next.addActionListener(this);
              invtext.addKeyListener(new KeyAdapter(){
                   public void keyTyped(KeyEvent ke){
                        char c=ke.getKeyChar();
                        if ((c == KeyEvent.VK_BACK_SPACE) ||(c == KeyEvent.VK_DELETE)){
                             System.out.println(counter+"before");
                             counter--;               
                             System.out.println(counter+"after");
                        else
                             counter++;
                        if(counter>6){
                             System.out.println(counter);
                             counter--;
                             ke.consume();
                        else                    
                        if(!((Character.isDigit(c) || (c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)))){
                             getToolkit().beep();
                             counter--;     
                             JOptionPane.showMessageDialog(null,"please enter numerical value");
                             ke.consume();
              System.out.println("its at the end");
         public void dateComboBox(){          
              for (int counter=0,day=01;day<=31;counter++,day++)
                   if(day<=9)
                        datelist[counter]="0"+String.valueOf(day);
                   else
                        datelist[counter]=String.valueOf(day);
              for(int counter=0,yr=00;yr<=99;yr++,counter++)
                   if(yr<=9)
                        yearlist[counter]="0"+String.valueOf(yr);
                   else
                        yearlist[counter]=String.valueOf(yr);
              month=new JComboBox(monthlist);
              date=new JComboBox(datelist);
              year=new JComboBox(yearlist);
         public static void main(String[] args){
              MainMenu mm=new MainMenu();
         public class WindowHandler extends WindowAdapter{
              public void windowClosing(WindowEvent we){
                   jf.dispose();
                   System.exit(0);
    }     

    Hi,
    I had a similar problem with a message dialog. Don't know if it is a bug, I was in a hurry and had no time to search the bug database... I found a solution by using keyPressed() and keyReleased() instead of keyTyped():
       private boolean pressed = false;
       public void keyPressed(KeyEvent e) {
          pressed = true;
       public void keyReleased(KeyEvent e) {
          if (!pressed) {
             e.consume();
             return;
          // Here you can test whatever key you want
       //...I don't know if it will help you, but it worked for me.
    Regards.

  • Function error! pls help.

    Here is the code:
    CREATE OR REPLACE FUNCTION id_is_good
    (i_student_id IN NUMBER)
    RETURN BOOLEAN
    AS
    v_id_cnt NUMBER;
    BEGIN
    SELECT COUNT(*)
    INTO v_id_cnt
    FROM student
    WHERE student_id = i_student_id;
    RETURN 1 = v_id_cnt;
    EXCEPTION
    WHEN OTHERS
    THEN
    RETURN FALSE;
    END id_is_good;
    Error report:
    ORA-06550: line 5, column 20:
    PL/SQL: ORA-00904: "I_STUDENT_ID": invalid identifier
    ORA-06550: line 2, column 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 6, column 1:
    PLS-00372: In a procedure, RETURN statement cannot contain an expression
    ORA-06550: line 6, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 10, column 1:
    PLS-00372: In a procedure, RETURN statement cannot contain an expression
    ORA-06550: line 10, column 1:
    PL/SQL: Statement ignored
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    This function run troubleless however it can not run troubleless in my computer, I have database though, I mean my database is ok, and i use sql developer but i dont understand why this code cant run good?? pls help me.
    thanks

    RETURN BOOLEANPerhaps you should read Oracle Doc about returning boolean value in SQL.
    Check the following link ->
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::NO::P11_QUESTION_ID:6263249199595
    Your solution might be something like this if you want to return boolean ->
    CREATE OR REPLACE FUNCTION id_is_good(i_student_id IN NUMBER)
    RETURN BOOLEAN
    IS
      v_id_cnt NUMBER;
    BEGIN
      SELECT COUNT(*)
      INTO v_id_cnt
      FROM student
      WHERE student_id = i_student_id;
      IF v_id_cnt > 0 THEN
         RETURN TRUE;
      ELSE
        RETURN FALSE;
      END IF;
    EXCEPTION
    WHEN OTHERS THEN
      RETURN FALSE;
    END id_is_good;Or, if you want to return the value then ->
    CREATE OR REPLACE FUNCTION id_is_good(i_student_id IN NUMBER)
    RETURN NUMBER
    IS
      v_id_cnt NUMBER;
    BEGIN
      SELECT COUNT(*)
      INTO v_id_cnt
      FROM student
      WHERE student_id = i_student_id;
      RETURN v_id_cnt;
    EXCEPTION
    WHEN OTHERS THEN
      RETURN 0;
    END id_is_good;Hope this will help.
    Regards.
    Satyaki De.

  • HT3275 My time machine does not back up and giving me this error message: The backup disk image "/Volumes/Data-1/Amiel's MacBook Pro.sparsebundle" is already in use. Pls help.

    My time machine does not back up and giving me this error message: The backup disk image “/Volumes/Data-1/Amiel’s MacBook Pro.sparsebundle” is already in use. Pls help.

    Make sure that there are no other Macs backing up at the present time.
    Pull the power cord from the back of the Time Capsule
    Count to ten
    Plug the power cord back in
    This will "fix" things about 98% of the time. Post back if you are in the unlucky 2% category.

  • Need to update the xml clob-pls pls help!

    my xml is stored as blob, i can view,do string manipulation and churn out data etc...but now i have a request where i need to find some particualr node and modify its value.
    here is what i m doing now which works.
    select compressor2.blob_decompress2(xml_data) into l_blob
    from tablename where id=2008890;
    clob_data := utl2.blob2clob(l_blob);
    parser := xmlparser.newParser;
    xmlparser.parseClob(parser, clob_data);
    doc := xmlparser.getDocument(parser);
    nl := xmldom.getElementsByTagName(doc, '*');
    len := xmldom.getLength(nl);
    dbms_output.put_line('Length : ' || len);
    tag_name := 'Node Verson : ' || xmldom.getVersion(doc)|| '<br>';
    for counter in 0..len-1
    loop
    tag_name := '';
    node := xmldom.item(nl, counter);
    parent_node := xmldom.getParentNode(node);
    child_node := xmldom.getfirstchild(node);
    tag_name := 'Parent Name : ' || xmldom.getNodeName(parent_node) || '<br>';
    tag_name := tag_name || 'Node Name : ' || xmldom.getNodeName(node) || '<br>';
    IF xmldom.getNodeType(child_node) = xmldom.TEXT_NODE THEN
    tag_name := tag_name || 'Node Value : ' || xmldom.getNodeValue(child_node)|| '<br>';
    ELSE
    tag_name := tag_name || 'Node Value : Node has child.No Node value.' || '<br>';
    END IF;
    tag_name := tag_name || 'Node Type : '||xmldom.getNodeType(child_node) || '<br>';
    ele_name := xmldom.getDocumentElement(doc);
    child_nl := xmldom.getElementsByTagName(ele_name,'*');
    IF xmldom.isNull(doc) THEN
    htp.p('Document is null');
    ELSE
    htp.p(tag_name);
    END IF;
    end loop;
    b_blob := utl.clob2blob(tag_name);
    select compressor2.blob_compress2(b_blob) into b_blob2 from dual;
    insert into xupdate values (2008890,b_blob2);
    i still need to know how to update the xml clob... i want to know how to find the particular node and then modify the clob with the new value. rest i can update the table.
    pls pls help..on this.

    my oracle version.
    10.2.0.1.0
    i want to update here..
    <?xml version="1.0" encoding="utf-8"?>
    <TestData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
         <Status>CompletedNormally</TestCompletionStatus>
         <ComputerName>DUILT10</ComputerName>
         <StartTime>2008-03-19T15:12:23</StartTime>
    ---Some more noded----
    <Parameters>
              <RangeMeasured>
                   <Name>PDissBol-5[C]</Name>
                   <Min>1.22</Min>
                   <Max>1.36</Max>
                   <Units>W</Units>
              </RangeMeasured>
              <TextMeasured>
                   <Name>ComputerName</Name>
                   <Value>DUILT10</Value>
              </TextMeasured>
              <RangeMeasured>
                   <Name>TrackError25[C]To-5[C]</Name>
                   <Min>0.031</Min>
                   <Max>0.041</Max>
                   <Units>dB</Units>
              </RangeMeasured>
              <RangeMeasured>
                   <Name>Power-5[C]</Name>
                   <Min>1.988</Min>
                   <Max>1.061</Max>
                   <Units>dBm</Units>
              </RangeMeasured>
    ---some more noded---
    </Parameters>
    </TestData>
    the file is huge.
    what i need to chang==>
    I 1st need to find this PDissBol-5[C] within the <Parameters> Node and then change its <Min> and <Max>
    and then update the table.
    pls pls suggest.

  • Stored proc execution status, pls help

    hi,
    i need to know if there is a way to find out whether an sp has been executed successfully or not, with the status code being returned.
    i know about the dbms_output.getline() function but i don't know how to use it!
    pls help
    thank you

    Hi,
    do you mean something like that ?
    SQL> create or replace procedure getData(id in number)
      2  is
      3   status number;
      4  begin
      5   select count(1) into status from emp where empno = id;
      6   if status > 0 then
      7     dbms_output.put_line('Success');
      8   else
      9     dbms_output.put_line('Failed');
    10   end if;
    11  end;
    12  /
    &nbsp
    Procedure created.
    &nbsp
    SQL> set serveroutput on
    SQL> exec getData(1)
    Failed
    &nbsp
    PL/SQL procedure successfully completed.
    &nbsp
    SQL> exec getData(7369)
    Success
    &nbsp
    PL/SQL procedure successfully completed.
    &nbspRgds.

  • Download data to Excel- very urgent pls help

    Hi  Experts
    Following is my coding. i need to download and save the it_material table as Excel file.
    pls help me out
    REPORT zvio1001 LINE-SIZE 190
               LINE-COUNT 55
               MESSAGE-ID zz
               NO STANDARD PAGE HEADING.
    TABLES: mara,marce,makt,marc,mvke,zmpkg,t005t,cdhdr.
    DATA : BEGIN OF it_mara OCCURS 0,
             mandt LIKE mara-mandt,          "Client
             matnr LIKE mara-matnr,
             meins LIKE mara-meins,
             laeda LIKE mara-laeda,
             aenam LIKE mara-aenam,
           END OF it_mara.
    DATA : BEGIN OF it_marc OCCURS 0,
           matnr LIKE marc-matnr,
           werks LIKE marc-werks,
           END OF it_marc.
    DATA : BEGIN OF it_makt OCCURS 0,
           matnr LIKE makt-matnr,
           maktx LIKE makt-maktx,
           END OF it_makt.
    DATA : BEGIN OF it_zmpkg OCCURS 0,
           matnr LIKE makt-matnr,
           zppqt LIKE zmpkg-zppqt,
           zspqt LIKE zmpkg-zspqt,
           zpmqt_3 LIKE zmpkg-zpmqt_3,
           END OF it_zmpkg .
    DATA : BEGIN OF it_material OCCURS 0,
             mandt LIKE mara-mandt,          "Client
             werks LIKE marc-werks,
             matnr LIKE marc-matnr,
             maktx LIKE makt-maktx,
             meins LIKE mara-meins,
             zppqt LIKE zmpkg-zppqt,
             zspqt LIKE zmpkg-zspqt,
             zpmqt_3 LIKE zmpkg-zpmqt_3,
             laeda LIKE mara-laeda,
             aenam LIKE mara-aenam,
             date LIKE sy-datum,
             time LIKE sy-uzeit,
             user    LIKE sy-uname,
           END OF it_material.
    P a r a m e t e r s                                                 *
    Start of tabbed screens
    SELECTION-SCREEN BEGIN OF TABBED BLOCK list FOR 20 LINES.
    SELECTION-SCREEN TAB (30) gc_gen USER-COMMAND gen_tab
                                        DEFAULT SCREEN 1001.
    SELECTION-SCREEN TAB (30) gc_view  USER-COMMAND view_tab
                                        DEFAULT SCREEN 1002.
    SELECTION-SCREEN TAB (30) gc_outp  USER-COMMAND outp_tab
                                        DEFAULT SCREEN 1003.
    SELECTION-SCREEN END OF BLOCK list.
    SELECTION-SCREEN BEGIN OF SCREEN 1001 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK box01 WITH FRAME TITLE text-401.
    PARAMETERS : p_werks LIKE marc-werks OBLIGATORY.
    PARAMETERS : p_vkorg LIKE mvke-vkorg OBLIGATORY.
    SELECT-OPTIONS : s_matnr FOR mara-matnr.
    SELECT-OPTIONS : s_mtart FOR mara-mtart.
    SELECT-OPTIONS : s_mmsta FOR marc-mmsta.                           "A01
    SELECT-OPTIONS : s_dispo FOR marc-dispo.
    SELECT-OPTIONS : s_beskz FOR marc-beskz.
    SELECT-OPTIONS : s_lgpro FOR marc-lgpro.
    SELECT-OPTIONS : s_lgfsb FOR marc-lgfsb.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(31) text-014.
    PARAMETERS : p_repall RADIOBUTTON GROUP sel2 DEFAULT 'X'.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(31) text-011.
    PARAMETERS : p_change  RADIOBUTTON GROUP sel2.
    SELECTION-SCREEN COMMENT 36(1) text-013.
    PARAMETERS : p_chgdat LIKE sy-datum DEFAULT sy-datum.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(31) text-010.
    PARAMETERS : p_excdel AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END   OF BLOCK box01.
    SELECTION-SCREEN END OF SCREEN 1001.
    View Selection Screen
    SELECTION-SCREEN BEGIN OF SCREEN 1002 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK box05 WITH FRAME TITLE text-403.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(77) text-109.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(31) text-021.
    PARAMETERS: p_sales AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 38(20) text-022.
    PARAMETERS: p_mrp  AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(31) text-023.
    PARAMETERS: p_store AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 38(20) text-024.
    PARAMETERS: p_accnt AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(31) text-025.
    PARAMETERS: p_cost  AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 38(20) text-026.
    PARAMETERS: p_purch AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END   OF BLOCK box05.
    SELECTION-SCREEN END OF SCREEN 1002.
    SELECTION-SCREEN BEGIN OF SCREEN 1003 AS SUBSCREEN.
    extract format selection
    SELECTION-SCREEN BEGIN OF BLOCK box04 WITH FRAME TITLE text-402.
    PARAMETERS : p_vari LIKE ltdxt-variant OBLIGATORY.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(31) text-009.
    PARAMETERS: p_report RADIOBUTTON GROUP sel1 DEFAULT 'X'.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(31) text-016.
    PARAMETERS : p_repcoo RADIOBUTTON GROUP sel1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(31) text-017.
    PARAMETERS : p_reppak RADIOBUTTON GROUP sel1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(31) text-008.
    PARAMETERS: p_extun RADIOBUTTON GROUP sel1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(31) text-007.
    PARAMETERS: p_extpc RADIOBUTTON GROUP sel1.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS: p_pcfile LIKE rlgrap-filename
               DEFAULT 'c:\#ups\CLIENTIDCCYYMMDDHHMMSS.ITM'.
                DEFAULT 'd:\P0121205MMM_YYYYMMDD HHMMSS.XLS'.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(40) text-015.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END   OF BLOCK box04.
    SELECTION-SCREEN END OF SCREEN 1003.
    F i e l d   S y m b o l s                                           *
    FIELD-SYMBOLS: <f>.
    D a t a                                                             *
    common include for file layouts
    INCLUDE zvin1010.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-name = 'P_PCFILE'.
          screen-input = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
                     I N I T I A L I Z A T I O N                         *
    INITIALIZATION.
      gc_gen   = text-401.
      gc_outp  = text-402.
      gc_view  = text-403.
    SET up the file directory depending on the system id.
      GET PARAMETER ID 'WRK' FIELD p_werks.
      GET PARAMETER ID 'VKO' FIELD p_vkorg.
      CLEAR s_mtart.
      s_mtart-sign   = 'E'.
      s_mtart-option = 'EQ'.
      s_mtart-low    = 'ROH'.
      s_mtart-high   =  ''.
      APPEND s_mtart.
      CLEAR s_mtart.
      s_mtart-sign   = 'E'.
      s_mtart-option = 'EQ'.
      s_mtart-low    = 'MFPK'.
      s_mtart-high   =  ''.
      APPEND s_mtart.
      CLEAR s_mtart.
      s_mtart-sign   = 'E'.
      s_mtart-option = 'EQ'.
      s_mtart-low    = 'VERP'.
      s_mtart-high   =  ''.
      APPEND s_mtart.
    START-OF-SELECTION.
    check that the download is active
    PERFORM get_data.
    *&      Form  GET_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM get_data .
    SELECT   mandt matnr meins laeda aenam
    FROM mara
    INTO TABLE it_mara
    WHERE matnr IN s_matnr.
    IF NOT it_mara[] IS INITIAL.
    SELECT matnr werks
    FROM marc
    INTO TABLE it_marc
    FOR ALL ENTRIES IN it_mara
    WHERE matnr = it_mara-matnr
    AND werks = p_werks.
    SELECT matnr maktx
    FROM makt
    INTO TABLE it_makt
    FOR ALL ENTRIES IN it_marc
    WHERE matnr = it_marc-matnr
    AND spras = 'E'.
    SELECT matnr zppqt  zspqt zpmqt_3
       INTO TABLE    it_zmpkg
       FROM zmpkg
       FOR ALL ENTRIES IN it_marc
    WHERE matnr = it_marc-matnr
    AND  werks = p_werks.
    ENDIF.
    LOOP AT it_mara.
    READ TABLE it_marc WITH KEY matnr = it_mara-matnr.
    IF sy-subrc EQ 0.
    READ TABLE it_makt WITH KEY matnr = it_mara-matnr.
    IF sy-subrc EQ 0.
    READ TABLE it_zmpkg WITH KEY matnr = it_mara-matnr.
    IF sy-subrc EQ 0.
    it_material-mandt = it_mara-mandt.
    it_material-matnr = it_mara-matnr.
    it_material-maktx = it_makt-maktx.
    it_material-meins = it_mara-meins.
    it_material-laeda = it_mara-laeda.
    it_material-aenam = it_mara-aenam.
    it_material-werks = it_marc-werks.
    it_material-zppqt = it_zmpkg-zppqt.
    it_material-zspqt = it_zmpkg-zspqt.
    it_material-zpmqt_3 = it_zmpkg-zpmqt_3.
    it_material-date = sy-datum.
    it_material-time = sy-uzeit.
    it_material-user = sy-uname.
    APPEND it_material.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDLOOP.
    ENDFORM.                    " GET_DATA

    Hi Kumar,
         After building your it_material internal table, try using GUIO_DOWNLOAD to load the data into an excel sheet.
    check this sample code.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                = SELECT_FILE   " Filename
          FILETYPE                = 'ASC'
          APPEND                  = ' '
        TABLES
          DATA_TAB                = ITAB_STR_1
        EXCEPTIONS
          FILE_WRITE_ERROR        = 1
          NO_BATCH                = 2
          GUI_REFUSE_FILETRANSFER = 3
          INVALID_TYPE            = 4
          NO_AUTHORITY            = 5
          UNKNOWN_ERROR           = 6
          HEADER_NOT_ALLOWED      = 7
          SEPARATOR_NOT_ALLOWED   = 8
          FILESIZE_NOT_ALLOWED    = 9
          HEADER_TOO_LONG         = 10
          DP_ERROR_CREATE         = 11
          DP_ERROR_SEND           = 12
          DP_ERROR_WRITE          = 13
          UNKNOWN_DP_ERROR        = 14
          ACCESS_DENIED           = 15
          DP_OUT_OF_MEMORY        = 16
          DISK_FULL               = 17
          DP_TIMEOUT              = 18
          FILE_NOT_FOUND          = 19
          DATAPROVIDER_EXCEPTION  = 20
          CONTROL_FLUSH_ERROR     = 21
          OTHERS                  = 22.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        EXIT.
      ENDIF.
    Hope this is helpful to you. If you need further information, revert back.
    Reward all the helpful answers.
    Regards
    Nagaraj T

  • JTable pls help!

    Hi guys, i basically need to retrieve some data into a table from the database(mySql). but the data just cant be out. i need help from you all :).
    basically i have a form package, entity package, controller package, sqlAction package(where it calls things form the sql) and lastly dbController package. pls help me to see what have i miss out or done wrong, thanks a million!
    Form Package:
    package form;
    import javax.swing.*;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.JLabel;
    import javax.swing.JTextField;
    import sqlAction.EventLogAction;
    import controller.EventLogController;
    import entity.EventLog;
    private JTable getJTable_viewLog() {
              if (jTable_viewLog == null) {
                   jTable_viewLog = new JTable();
                   int row = 0;
                   int col = 0;
         String [] colName = {"Event ID", "Source","Event Description","Date Time", "IP"};
                    EventLog newEventLog = new EventLog();
                       EventLogController EventLogController = new EventLogController();
                  for (int i =0; i < row; i++) {
                                  for (int j = 0; j < col; j++) {
                                data[i][j] = newEventLog.getEID();
                                                    data[i][j] = newEventLog.getESource();
                                          data[i][j] = newEventLog.getEEvent();
                                          data[i][j] = newEventLog.getEDateTime();
                                          data[i][j] = newEventLog.getEIPAdd();
                             EventLogAction e = new EventLogAction();
                            e.getViewLog(newEventLog);
                   jTable_viewLog = new JTable(new DefaultTableModel(data,colName)){
                        * Prevent table from being edited.
                        private static final long serialVersionUID = 1L;
                        public boolean isCellEditable(int row, int col) { return false; }
                   jTable_viewLog.setBounds(new java.awt.Rectangle(27,30,450, 230));
              return jTable_viewLog;
              }Entity Package:
    package entity;
    public class EventLog {
         private String eID;
         private String eSource;
         private String eEvent;
         private String eDateTime;
         private String eIPAdd;
         public String getEID() {
              return eID;
         public void setEID(String eid) {
              eID = eid;
         public String getESource() {
              return eSource;
         public void setESource(String source) {
              eSource = source;
         public String getEEvent() {
              return eEvent;
         public void setEEvent(String event) {
              eEvent = event;
         public String getEDateTime() {
              return eDateTime;
         public void setEDateTime(String dateTime) {
              eDateTime = dateTime;
         public String getEIPAdd() {
              return eIPAdd;
         public void setEIPAdd(String add) {
              eIPAdd = add;
    }Controller Package:
    package controller;
    import sqlAction.EventLogAction;
    import entity.EventLog;
    public class ViewEventLogController {
    public void processGetViewLog(String eID,
                   String eSource,
                   String eEvent,
                   String eDateTime,
                   String eIPAdd)
              EventLog viewEve = new EventLog();
              EventLogAction va = new EventLogAction();
              viewEve.setEID(eID);
              viewEve.setESource(eSource);
              viewEve.setEEvent(eEvent);
              viewEve.setEDateTime(eDateTime);
              viewEve.setEIPAdd(eIPAdd);
              va.createEventPerform(viewEve);
    }sqlAction Package:
    package sqlAction;
    import dbController.DBController;
    import entity.EventLog;
    import java.sql.*;
    import java.util.*;
    public class EventLogAction {
         private String eID;
         private String eSource;
         private String eEvent;
         private String eDateTime;
         private String eIPAdd;
         private static EventLog newEventLog;
         public EventLogAction(){}
         public EventLogAction(String eID, String eSource, String eEvent, String eDateTime, String eIPAdd){           this.eID = eID;
              this.eSource = eSource;
              this.eEvent = eEvent;
              this.eDateTime = eDateTime;
              this.eIPAdd = eIPAdd;
    public EventLog getViewLog(EventLog viewEve){
              // Code to access db
              ResultSet rs = null;
              String dbQuery = "SELECT * FROM EventLog";
              DBController db = new DBController();
              System.out.println(dbQuery);
              db.setUp("cryptocrestSQL");
              rs = db.readRequest(dbQuery);
              try{
                   if (rs.next()){
                        String eID = rs.getString("eID");
                                                                    String eSource = rs.getString("eSource");
                        String eEvent = rs.getString("eEvent");
                        String eDateTime = rs.getString("eDateTime");
                        String eIPAdd = rs.getString("eIPAdd");;
                        EventLog el = new EventLog();
                        el.setEID(eID);
                        el.setESource(eSource);
                        el.setEEvent(eEvent);
                        el.setEDateTime(eDateTime);
                        el.setEIPAdd(eIPAdd);
              }catch (Exception e) {
                   e.printStackTrace();
              db.terminate();
              return newEventLog;
         public String getEID() {
              return eID;
         public void setEID(String eid) {
              eID = eid;
         public String getESource() {
              return eSource;
         public void setESource(String source) {
              eSource = source;
         public String getEEvent() {
              return eEvent;
         public void setEEvent(String event) {
              eEvent = event;
         public String getEDateTime() {
              return eDateTime;
         public void setEDateTime(String dateTime) {
              eDateTime = dateTime;
         public String getEIPAdd() {
              return eIPAdd;
         public void setEIPAdd(String add) {
              eIPAdd = add;
    }dbController Package:
    package dbController;
    * Program Name :     DBController.java
    * Description: DBController class to access the database.
    * Remember to set up the odbc using control panel.
    import java.sql.*;
    public class DBController {
         private Connection con;
         private ResultSet rs;
          * Method Name : setUp Input
          * Parameter : String (Data Source Name)
          * Purpose : Load the database driver and establish connection
          * Return : nil
         public void setUp(String dsn) {
              // load the database driver
              try {
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              } catch (Exception e) {
                   System.out.println("Load driver error");
              // after loading the driver, establish a connection
              try {
                   String s = "jdbc:odbc:" + dsn;
                   con = DriverManager.getConnection(s, "", "");
                   System.out.println("connection is " + s);
              } catch (Exception e) {
                   e.printStackTrace();
          * Method Name : getColumnNames
          * Purpose : Obtain the column names of the result set
          * Return : Array of String
         public String[] getColumnNames() {
              String[] columnNames = null;
              try {
                   // Get result set meta data
                   ResultSetMetaData rsmd = rs.getMetaData();
                   columnNames = new String[rsmd.getColumnCount()];
                   // Get the column names; column indices start from 1
                   for (int i = 0; i < columnNames.length; i++) {
                        columnNames[i] = rsmd.getColumnName(i + 1);
              } catch (SQLException e) {
                   System.out.println("Error in getColumnNames() in DBController");
                   e.printStackTrace();
              return columnNames;
          * Method Name : readRequest
          * Input Parameter : String (database query)
          * Purpose : Obtain the result set from the db query
          * Return : resultset (records from the query)
         public ResultSet readRequest(String dbQuery) {
              ResultSet rs = null;
              System.out.println("DB Query: " + dbQuery);
              try {
                   // create a statement object
                   Statement stmt = con.createStatement();
                   // execute an SQL query and get the result
                   rs = stmt.executeQuery(dbQuery);
                   this.rs = rs;
              } catch (Exception e) {
                   e.printStackTrace();
              return rs;
          * Method Name : updateRequest Input Parameter : String (database query) Purpose :
          * Execute udpate using the db query Return : int (count is 1 if successful)
         public int updateRequest(String dbQuery) {
              int count = 0;
              // System.out.println("DB: " + dbQuery);
              try {
                   // create a statement object
                   Statement stmt = con.createStatement();
                   // execute an SQL query and get the result
                   count = stmt.executeUpdate(dbQuery);
              } catch (Exception e) {
                   e.printStackTrace();
              return count;
          * Method Name : terminate
          * Input Parameter : nil
          * Purpose : Close db conection
          * Return :nil
         public void terminate() {
              // close connection
              try {
                   con.close();
                   System.out.println("Connection is closed");
              } catch (Exception e) {
                   e.printStackTrace();
    } // end of DBControllerEdited by: Titus-tan on Jul 9, 2008 1:33 AM

    First off, your code style sucks. Consistent indentation would be nice. Don't mix spaces and tabs.
    package form;
    import javax.swing.*;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.JLabel;
    import javax.swing.JTextField;At this point, you've already imported JLabel and JTextField, no need to do it again.
    jTable_viewLog.setBounds(new java.awt.Rectangle(27,30,450, 230));Don't use setBounds to set the size of a Swing component, it'll just get wiped out when the layout manager does its thing.
    Use setPreferredSize instead.
    As for your database class, why are you passing queries into it? It should know how to pull the data out of the database and keep its queries internal.
    Not only will it be a cleaner design, you significantly reduce the possibility of executing bad queries. Also, PreparedStatements are almost always preferred
    over normal Statements, especially when combined with parameterized queries. Go google "Bobby Tables" if you don't understand why.
    Now then, what is it doing and what did you expect it to be doing?

  • Need one abap program.....pls help

    Hi all,
    i have need one ABAP program , which can dispaly how many same number of charecter are there.
    ex : my input is  suresh.
    output is,,,
    2 - s
    1 - u
    1 - r
    just like that..
    pls help me..
    thanks in advance.
    indu

    Hello
    Try this:
    data: string(100),
          length type i.
    data: begin of itab occurs 0,
          chart,
          count type i,
          end of itab.
    string = 'suresh'.
    length = strlen( string ).
    do length times.
      length = length - 1.
      clear itab.
      itab-chart = string+length(1).
      itab-count = 1.
      collect itab.
    enddo.
    loop at itab.
      write: itab-chart, itab-count. new-line.
    endloop.

  • Pls help with a program

    I'm making a quiz, and i store the questions in a textfile. The user can choose from 3 quizes, either Plate Tectonics, Rivers or Rocks. I managed to call the questions from Java. Each quiz has a set of 10 questions. In the code below i only included the answers to the Plate Tectonics Quiz, which i stored in an array. What i'm having problem with is, that its not working correctly, since it is displaying, after answering all the questions correctly that i have answered 0 questions from 1 question. First of all it should say out of 10 questions because i have 10 questions, and its not really working because even if i answer them all corrctly it still says 0 out of 1 question. Can someone pls help me find the error? Thanks a lot.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.io.*;
    import java.util.Scanner;
    import java.util.Arrays;
    public class GeographyQuiz extends JFrame implements ActionListener {
      private static final int FRAME_WIDTH = 140;
      private static final int FRAME_HEIGHT = 160;
      private static final int FRAME_X_ORIGIN = 70;
      private static final int FRAME_Y_ORIGIN = 50;
       AnswerStore answerStore = new AnswerStore();
      public static void main (String[] args) {
        JFrame jFrame;
        jFrame = new JFrame();
        JOptionPane.showMessageDialog(jFrame, "This is a Geography Quiz");
        JOptionPane.showMessageDialog(null, "Good Luck");
        char choice;
        int i, choice1, Password;
        String yourChoice, passString;
        passString = JOptionPane.showInputDialog("Enter the Password");
        //Password = passString.nextInt();
        Password = Integer.parseInt(passString);
        if (Password == 123) {
         JOptionPane.showMessageDialog(null, "Valid. You typed the right password. Now choose from the following menu");
         GeographyQuiz frame = new GeographyQuiz();
          frame.setVisible(true);
        } else {
          JOptionPane.showMessageDialog(null, "Invalid Password. Try Again");
      public GeographyQuiz() {
        Container contentPane;
        JButton button1, button2, button3, button4, button5;
        setSize (FRAME_WIDTH, FRAME_HEIGHT);
        setTitle("Geography Quiz");
        setLocation(FRAME_X_ORIGIN, FRAME_Y_ORIGIN);
        contentPane = getContentPane();
        contentPane.setBackground(Color.pink);
        contentPane.setLayout(new FlowLayout());
        button1 = new JButton("Plate Tectonics");
        button2 = new JButton("Rivers");
        button3 = new JButton("Rocks");
        button4 = new JButton("Quit");
        contentPane.add(button1);
        contentPane.add(button2);
        contentPane.add(button3);
        contentPane.add(button4);
        button1.addActionListener(this);
        button1.setActionCommand("b1");
        button2.addActionListener(this);
        button2.setActionCommand("b2");
        button3.addActionListener(this);
        button3.setActionCommand("b3");
        button4.addActionListener(this);
        button4.setActionCommand("b4");
        setDefaultCloseOperation(EXIT_ON_CLOSE);
       public void actionPerformed(ActionEvent e) {
    String ac = e.getActionCommand();
            String[] questions = null;
             try {
            if (ac.equals("b1")) {
                questions = readFile("plate_tectonics.txt");
            } else if(ac.equals("b2")) {
                questions = readFile("rivers.txt");
            } else if(ac.equals("b3")) {
                questions = readFile("rocks.txt");
            } else if (ac.equals("b4")) {
                System.exit(0);
            askQuestions(questions);
         catch (java.io.FileNotFoundException f)
            JOptionPane.showMessageDialog(null, "File not found.");
        private String[] readFile(String path)throws FileNotFoundException {
            Scanner s = null;
            StringBuilder sb = new StringBuilder();
            String separator = "\n";
            try {
                s = new Scanner(new BufferedReader(new FileReader(path)));
                s.useDelimiter(",\\s*");
                while (s.hasNext()) {
                   JOptionPane.showInputDialog(null,s.nextLine());
            finally {
                if (s != null)
                    s.close();
            return sb.toString().split("\\s");
        private void askQuestions(String[] questions) {
            int count = 0;
            for(int j = 10; j < questions.length; j++) {
                 String input = JOptionPane.showInputDialog(null, questions[j]);
                 // Use reference to AnswerStore instance to access data in it.
                 if(answerStore.answer[j].equals(input))
                 count++;
            JOptionPane.showMessageDialog(null, "You answered " + count +
                                          " out of " + questions.length +
                                          " questions correctly.");
    class AnswerStore  {
    String[] answer = {
            "Hellenic", "constructive", "100km", "Italy", "Wegner",
            "constructive", "100km", "Italy", "destroyed", "Meditteranean"
    }Edited by: saytri on Dec 23, 2007 2:07 AM
    Edited by: saytri on Dec 23, 2007 2:29 AM

    stripped to bare bones, it works OK for me
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class GeographyQuiz extends JFrame implements ActionListener {
      AnswerStore answerStore = new AnswerStore();
      public static void main (String[] args) {
        JOptionPane.showMessageDialog(null, "This is a Geography Quiz\n\nGood Luck");
        char choice;
        int i, choice1, Password;
        String yourChoice;
        GeographyQuiz frame = new GeographyQuiz();
        frame.setVisible(true);
      public GeographyQuiz() {
        Container contentPane;
        JButton button1;
        setSize (140, 160);
        setTitle("Geography Quiz");
        setLocationRelativeTo(null);
        contentPane = getContentPane();
        contentPane.setBackground(Color.pink);
        contentPane.setLayout(new FlowLayout());
        button1 = new JButton("Plate Tectonics");
        contentPane.add(button1);
        button1.addActionListener(this);
        button1.setActionCommand("b1");
        setDefaultCloseOperation(EXIT_ON_CLOSE);
      public void actionPerformed(ActionEvent e) {
        String ac = e.getActionCommand();
        String[] questions = null;
        if (ac.equals("b1")) {
          questions = new String[]{"what is 1+1","what is 2+2"};
          askQuestions(questions);
      private void askQuestions(String[] questions) {
          int count = 0;
          for(int j = 0; j < questions.length; j++) {
            String input = JOptionPane.showInputDialog(null, questions[j]);
            if(answerStore.answer[j].equals(input)) count++;
          JOptionPane.showMessageDialog(null, "You answered " + count +
                                        " out of " + questions.length +
                                        " questions correctly.");
    class AnswerStore  {
    String[] answer = {"2", "4"};
    }either the problem is in the file, or the posted code is not what you're using

  • Pls help for Exception "Too Few Parameters : Expected 35"

    Hi,
    I am expericing with the exception
    "Too Few Parameters : Expected 35".
    What's wrong with it? The following is my code.
    try {                                                                                                                                                                                                                
    String DRIVER = ("sun.jdbc.odbc.JdbcOdbcDriver");               
    String URL = "jdbc:odbc:Industrial_One_DSN";
    String sql = "UPDATE BusinessRegistration " +
    "SET [Date] = ?, ISIC = ?, BizName = ?, BizAddress = ?, " +
    "OwnerName = ?, OwnerNRC = ?, Investment = ?, EstablishedYear = ?, " +
    "L_Male = ?, L_Female = ?, F_Male = ?, F_Female = ?, " +
    "OwnershipType = ?, Remarks = ?, IndustialZoneName = ?, Unit = ?, " +
    "Fuel = ?, FactoryType = ?, FactoryName = ?, Township = ? " +
    "MainProductName = ?, MainProductCountType = ?, " +
    "MainProductQuantity = ?, MainProductValue = ?, RMName = ?, " +
    "RMCountType = ?, RMQuantity = ?, RMValue = ?, EnergyName = ?, " +
    "MachinePower = ?, AmountGallon = ?, StateDiv = ?, BizSize = ?  " +
    "WHERE RegistrationID = ?";
    Class.forName(DRIVER);
    Connection con = DriverManager.getConnection(URL);
    PreparedStatement pstmt = con.prepareStatement(sql);
    int ilmale = Integer.parseInt(lmale);
    int ilfemale = Integer.parseInt(lfemale);
    int ifmale = Integer.parseInt(fmale);
    int iffemale = Integer.parseInt(ffemale);
    int impq = Integer.parseInt(mpq);
    int impv = Integer.parseInt(mpv);
    int irmq = Integer.parseInt(rmq);
    int irmv = Integer.parseInt(rmv);
    int iamountgallon = Integer.parseInt(amountgallon);
    pstmt.setString(1, date);
    pstmt.setString(2, isic);
    pstmt.setString(3, bizname);
    pstmt.setString(4, bizaddress);
    pstmt.setString(5, ownername);
    pstmt.setString(6, ownernrc);
    pstmt.setString(7, investment);
    pstmt.setString(8, eyear);
    pstmt.setInt(9, ilmale);
    pstmt.setInt(10, ilfemale);
    pstmt.setInt(11, ifmale);
    pstmt.setInt(12, iffemale);
    pstmt.setString(13, ownershiptype);
    pstmt.setString(14, remark);
    pstmt.setString(15, izn);
    pstmt.setString(16, unit);
    pstmt.setString(17, fuel);
    pstmt.setString(18, ft);
    pstmt.setString(19, fname);
    pstmt.setString(20, township);
    pstmt.setString(21, mpn);
    pstmt.setString(22, mpct);
    pstmt.setInt(23, impq);               
    pstmt.setInt(24, impv);
    pstmt.setString(25, rmname);
    pstmt.setString(26, rmct);
    pstmt.setInt(27, irmq);
    pstmt.setInt(28, irmv);
    pstmt.setString(29, ename);
    pstmt.setString(30, mpower);
    pstmt.setInt(31, iamountgallon);
    pstmt.setString(32, statediv);
    pstmt.setString(33, bizsize);
    pstmt.setInt(34, Integer.parseInt(rid));
    pstmt.executeUpdate();
    }I have got 35 fields in my db. But I wanna edit 34 fields only. I have no primary key in my table. Is't alright?
    pls help me.
    With thanks,
    WTDAHL

    I presume you are using SQL server, hence the [Date] in your SQL?
    I counted 34 question marks in your SQL statement, And 34 parameters supplied.
    Looks ok to me.
    You say you have no primary key? What is RegistrationId then?
    My suggestion for debugging: start smaller.
    Try updating it with only 5 fields, then 10 then 15 and build it up like that.
    Trying to debug 35 fields is a nightmare - you have to break it down to solve it.
    Good luck,
    evnafets

  • Column constant value pls help

    COL cnt noprint
    COLUMN  cnt NEW_VALUE rowcountI am using this for select query as below
    ROWNUM cnt, COUNT (*) OVER () cntbut issue is when null rows returned.... this rowcount is not initilized.
    while i am usng for trailer record
    SELECT '* Trailer record *' || '|' || &rowcount
      FROM DUALit is giving error as below
    FROM DUAL
    ERROR at line 2:
    ORA-00936: missing expression
    Pls help
    S

    Solomon Yakobson wrote:
    Post EXACT and COMPLETE snippet of SQL*Plus session showing what you did. I can't reproduce it:
    SQL> COLUMN  cnt NEW_VALUE rowcount
    SQL> SELECT COUNT (*) OVER () cnt
    2    FROM DUAL
    3  /Suppose if cnt gives no record then rowcount is null at that time rowcount is not initiliazed.
    >
    >
    >
    >
    SQL> SELECT '* Trailer record *' || '|' || &rowcount
    2 FROM DUAL
    3 /
    old 1: SELECT '* Trailer record *' || '|' || &rowcount
    new 1: SELECT '* Trailer record *' || '|' || Missing expression this was my error
    >
    '*TRAILERRECORD*'||'
    * Trailer record *|1>
    SQL>
    SY.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Encountered : A system error has occurred while locking, pls help

    Dear All..
    pls help..
    while executing some of our remote function module we encountered some locking error.. the message returned by SAP is :
    A system error has occurred while locking
    from message class : M3 #021
    the remote function module is running bapi_goodsmvt_create in background..
    the question is.. why this error occured and how to solve it ? and what is the root cause.. ?
    because the error is only happened once (until now) we cannot simulate to get the error again.. so it is hard to find out the root cause..
    thanks for the help..
    sasmente

    Hi,
    I am also having the same problem. I am running the BAPI_MATPHYSINV_CHANGECOUNT' to count the Articles.
    When I print the error on screen, some the data shown as counted. Some are not changed and some with the following error.
    System error while locking the data
    Furthermore I went to the BASIS and saw that when we run this particular program its showing the locks on MARC and several tables with the same System ID from which we run the program
    Can anyone come up ? Its getting too hard to resolve.

  • Disable a field programatically in the OAF Page...pls  help !!!!!!!!!!!!!!

    Hi ,
    My requirement is-
    I have a region in the page which has 4 fields.Based on a condition I need to disable these fields.
    For this I tried extending a VO and created a transient Boolean Attribute and kept a SPEL expression in Read Only property for these attributes so that if i set the value in the controller to true / false the fields will be enabled or disabled accordingly.
    I extended the controller and wrote the below code.But it is not working as expected.PLSSSSSSSSSSSSSSSSS hELP.
    HzPuiOrganizationProfileAMImpl aam = (HzPuiOrganizationProfileAMImpl)oapagecontext.getApplicationModule(oawebbean);
    oawebbean.
    //OAViewObject mreqVO = (OAViewObject) (HzPuiOrganizationProfileAMImpl)oapagecontext.getApplicationModule(oawebbean).findViewObject("xxHzPuiOrganizationProfilesVO");
    // xxHzPuiOrganizationProfilesVOImpl xvo = (xxHzPuiOrganizationProfilesVOImpl)oapagecontext.getApplicationModule(oawebbean).findViewObject("xxHzPuiOrganizationProfilesVO");;
    //xvo.getCurrentRow().getAttribute("DisableAttr");
    xxHzPuiOrganizationProfilesVOImpl xvo = (xxHzPuiOrganizationProfilesVOImpl)oapagecontext.getApplicationModule(oawebbean).findViewObject("HzPuiOrganizationProfilesVO");
    int i =xvo.getRowCount();
    // throw new OAException("test "+String.valueOf(i),OAException.ERROR); -- HERE I GET THE COUNT AS 1
    String rowReference = oapagecontext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    if(rowReference != null)
    xxHzPuiOrganizationProfilesVORowImpl xxvorowimpl = (xxHzPuiOrganizationProfilesVORowImpl)aam.findRowByRef(rowReference);
    xxvorowimpl.setDisableAttr(Boolean.FALSE); //setreadOnlyAttr(Boolean.TRUE);
    throw new OAException("hi",OAException.ERROR);
    RowSetIterator Iter = xvo.createRowSetIterator("DataIter");
    Iter.setRangeStart(0);
    Iter.setRangeSize(i);
    Row row = null;
    row = Iter.getRowAtRangeIndex(0);
    row.setAttribute("DisableAttr",Boolean.TRUE);
    //xvo.getCurrentRow().setAttribute("DisableAttr",Boolean.FALSE);
    pls help me in solving the issue.
    Thanks
    Ramya

    Hi,
    Sample Method:
    public void DeleteMeasurePeriods()
    int fetchedrowcount;
    RowSetIterator deleteIter;
    OADBTransaction tr = getOADBTransaction();
    PeriodsVORowImpl row=null;
    PeriodsVOImpl mpvo=getPeriodsVO1();
    fetchedrowcount=mpvo.getRowCount();
    deleteIter = mpvo.createRowSetIterator("deleteIter");
    deleteIter.setRangeStart(0);
    deleteIter.setRangeSize(fetchedrowcount);
    for(int i=0;i<fetchedrowcount;i++)
    row= (PeriodsVORowImpl)deleteIter.getRowAtRangeIndex(i);
    if()
    row.setAttribute("DisableAttr",Boolean.TRUE);
    else
    row.setAttribute("DisableAttr",Boolean.FALSE);
    deleteIter.closeRowSetIterator();
    Regards
    Meher Irk

Maybe you are looking for