Please help me with ABAP code

Hi Gurus,
Please help me with the code.
Algorithm: This is for master data extraction. I need to append some records to I_T_DATA before the loop on I_T_DATA begins.
ZTAB is a custom defined table with key KEY. STAB is standard table with key KEY.
1. Create an internal table I_T_STAB similar to STAB.
2. Loop at I_T_DATA
    Read record from ZTAB where KEY = I_T_DATA-KEY and { field1 <> I_T_DATA-field1 or field2 <> I_T_DATA-field2 <> field3 <> I_T_DATA-field3}
If success
     Delete record from I_T_DATA.
Else
     Continue loop.
Copy all records of STAB to I_T_STAB.
3. Delete records in I_T_STAB where I_T_STAB-KEY = ZTAB-KEY.
Now
4. Delete all records in I_T_DATA where I_T_DATA-KEY = I_T_STAB-KEY.
Now,
5. Append all the remaining records from step 3 in I_T_STAB to I_T_DATA.
Please help me with the code upto this part.
Now the actual code in exit starts.
Loop at I_T_DATA
Thanks,
Regards,
aarthi
[email protected]

You might get a quick answer if you were to post in the ABAP forum. 
Moderator, please move to ABAP forum.  Thanks.
Regards,
Rich Heilman

Similar Messages

  • Please help me with my code (has conversion from string to int)

    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    public class Test3 extends MIDlet implements CommandListener
    {   Form mForm;
        Command mCommandQuit;
        Command mCommandItem;
        TextField input,prime1,prime2,prime3,output;
        Display mDisplay;
        int i,j=0,k1,k2,p,q,b;
        //int [] current=new int [1000];
        String mstring,a="";
        String [] temp=new String [1000];
        public void startApp()
        {System.out.println("startApp");
         mForm=new Form("RSA Encryption");
         mCommandQuit=new Command("QUIT",Command.EXIT,0);
         mCommandItem=new Command("ENCRYPT",Command.ITEM,0);
         mForm.append("Enter text:\n");
         input=new TextField(null,"",100, TextField.ANY);
         mForm.append(input);
         mForm.append("Enter first prime number(p):\n");
         prime1=new TextField(null,"",100, TextField.ANY);
         mForm.append(prime1);
         mForm.append("Enter second prime number(q):\n");
         prime2=new TextField(null,"",100, TextField.ANY);
         mForm.append(prime2);
         mForm.append("Enter d:\n");
         prime3=new TextField(null,"",100, TextField.ANY);
         mForm.append(prime3);
         mForm.addCommand(mCommandQuit);
         mForm.addCommand(mCommandItem);
         mDisplay=Display.getDisplay(this);
         mDisplay.setCurrent(mForm);
         mForm.setCommandListener(this);
        public void pauseApp()
        {System.out.println("pauseApp");
        public void destroyApp(boolean unconditional)
        {System.out.println("destroyApp");
        public void commandAction(Command c, Displayable d)
        {System.out.println("commandAction");
         if(c==mCommandQuit)
            notifyDestroyed();
         else if(c==mCommandItem)
         {p = Integer.parseInt(prime1.getString());
             q = Integer.parseInt(prime2.getString());
             b = Integer.parseInt(prime3.getString());
             //breaking up of big string into ints
             mstring=input.getString();
             temp[0]="";
             for(i=1;i<mstring.length();i++)
                {if (mstring.charAt(i) == ' ')
                    {j++;
                     temp[j]="";
                 else
                    {temp[j]=temp[j]+mstring.charAt(i);
             mForm.append("\n\nThe array is:\n");
             for(i=0;i<temp.length && temp!=null;i++)
    {k1=Integer.parseInt(temp[i]); ***********************
    k2=k1;
    for(j=1;j<b;j++)
    {k1=k1*k2;
    k1=k1 %(p*q);
    k2=k1 %(p*q);
    a=a+new Character((char)k2).toString();
    output=new TextField(null,a,100, TextField.ANY);
    mForm.append(output);
    }hi
    this code basically takes an input of string like " 179 84 48 48 155 " (with spaces)
    then it creates smaller strings in an array like "179","84","48","48","155" without the spaces
    then it creates int values 179,84,48,48,155 and finally after some math functions it prints the corresponding letters.
    the problem is that it is not printing the letter because of some exceptions-->java.lang.NumberFormatException .it comes in the line where i have put stars
    could anybody please help me print the letters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    thanks for all ur help guys, but me and my team member solved it on our own. here is the new code:
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    public class Test3 extends MIDlet implements CommandListener
    {   Form mForm;
        Command mCommandQuit;
        Command mCommandItem;
        TextField input,prime1,prime2,prime3,output;
        Display mDisplay;
        int i,j=0,l,k1,k2,p,q,n,b;
        String mstring,a = "";
        String [] temp=new String [1000];
        public void startApp()
        {System.out.println("startApp");
         mForm=new Form("RSA Encryption");
         mCommandQuit=new Command("QUIT",Command.EXIT,0);
         mCommandItem=new Command("DECRYPT",Command.ITEM,0);
         mForm.append("Enter text:\n");
         input=new TextField(null,"",100, TextField.ANY);
         mForm.append(input);
         mForm.append("Enter first prime number(p):\n");
         prime1=new TextField(null,"",100, TextField.NUMERIC);
         mForm.append(prime1);
         mForm.append("Enter second prime number(q):\n");
         prime2=new TextField(null,"",100, TextField.NUMERIC);
         mForm.append(prime2);
         mForm.append("Enter d:\n");
         prime3=new TextField(null,"",100, TextField.NUMERIC);
         mForm.append(prime3);
         mForm.addCommand(mCommandQuit);
         mForm.addCommand(mCommandItem);
         mDisplay=Display.getDisplay(this);
         mDisplay.setCurrent(mForm);
         mForm.setCommandListener(this);
        public void pauseApp()
        {System.out.println("pauseApp");
        public void destroyApp(boolean unconditional)
        {System.out.println("destroyApp");
        public void commandAction(Command c, Displayable d)
        {System.out.println("commandAction");
         if(c==mCommandQuit)
            notifyDestroyed();
         else if(c==mCommandItem)
         {p = Integer.parseInt(prime1.getString());
             q = Integer.parseInt(prime2.getString());
             b = Integer.parseInt(prime3.getString());
             n=p*q;
             //breaking up of big string into ints
             mstring=input.getString();
             temp[0]="";
             for(i=1;i<mstring.length();i++)
                {if (mstring.charAt(i) == ' ')
                    {j++;
                     temp[j]="";
                 else
                    {temp[j]=temp[j]+mstring.charAt(i);
             l=j;
             mForm.append("\n\nThe result is:\n");
             for(i=0;i<l;i++)
                {k1=Integer.valueOf(temp).intValue();
    k2=k1;
    for(j=1;j<b;j++)
    {k2=k2*k1;
    k2=k2 %n;
    k1=k2 %n;
    a=a+new Character((char)k1).toString();
    output=new TextField(null,a,100, TextField.ANY);
    mForm.append(output);

  • Please help me with this code, can't figure it out!!!!! Please!!!!!!

    class Vehicles
    public String name="<unnamed>";
    Vehicles Ferrari1=new Vehicles();
    Vehicles Honda1=new Vehicles();
    Vehicles Toyota1=new Vehicles();
    Ferrari.nameFor="Ferrari";
    Honda.nameFor="Honda";
    Toyota.nameFor="Toyota";
    public void main(String[]args)
    System.out.println("Hello Folks!");
    System.out.println(Ferrari.name);
    System.out.println(Honda.name);
    System.out.println(Toyota.name);
    System.out.println("Bye Now!");
    It always says i am missing an indentifier in line 6-8 when i complie. Please help somebody!!!

    class Vehicles
    public String name = "unnamed";
    Vehicles Ferrari=new Vehicles();
    public void main(String[]args)
    System.out.println("Hello Folks!");
    Vehicles Ferrari=new Vehicles();
    System.out.println(Ferrari.name);
    System.out.println("Bye Now!");

  • Please help me with the code!!

    Dear All, I am going to simulate a TCP via UDP , and I have been asked for creating some specific methods , also additional helper methods are allowed but I can't avoid implementing any of the functions described below.
    I have bold the functions which are ambiguous to me.
    [click here to see the detail assignment explanation|http://www.net.t-labs.tu-berlin.de/teaching/ws0809/PD_labcourse/PDF/u5en.pdf|click here to see the detail assignment explanation]
    If you see anything wrong please post , thanks.
    &bull; rdt connect()
    This function sets all the parameters required for connecting to a server. Moreover, it opens a
    UDP socket.
    &bull; rdt listen()
    This function is the server-side counterpart of rdt connect(). It opens a UDP socket for
    incoming connections and sets all the required parameters.
    &bull; rdt send()
    This function takes an arbirary amount of data as input and writes it into a send buffer. It
    does not send anything to the network.
    &bull; rdt recv()
    This function returns the whole receive buffer. It does not really read data from the network,
    but only from the receive buffer.
    &bull; rdt select()
    This function does the whole work of moving data over the network. It behaves similar to the
    system call select(), i.e. it blocks until there is some data in the receive buffer. The received
    data can be subsequently read with rdt recv(). A flow diagram of the functionality of this
    function follows:
    &ndash; send all()
    This function sends all the data in the send buffer over the network to the receiver. If
    more than 500 bytes are present in the send buffer, more packets must be sent. The MSS
    (Maximum Segment Size) of an RDT packet is 534 bytes.
    *&ndash; select()*
    This is the well-known system call that waits until the receive buffer contains data.
    [ I don't know what to do with the buffer , and how to make it empty]
    &ndash; recv from()
    This is the well-known system all recv from() that reads data from the network.
    *&ndash; statemachine send()*
    This is a function that processes a newly received packet. In RDT 1.0 nothing is done here,
    becuase the sender does not expect any ACK packets from the receiver.
    &ndash; statemachine recv()
    This function processes incoming packets. In RDT 1.0 the header is removed and the
    payload copied to the receive buffer.
    &ndash; Payload
    rdt select() returns at this point if there&rsquo;s any data in the receive buffer. If not, it starts
    from the beginning.
    [ where the data should be returned?]
    This is my code:
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.net.DatagramPacket;
    import java.net.DatagramSocket;
    import java.net.InetAddress;
    import java.net.Socket;
    import java.net.SocketException;
    public class Ex5 {
        DatagramSocket socket , client_socket;
        DatagramPacket rcv_pkt;
        DatagramPacket send_pkt;
        byte[] sendData;
        byte[] receivedData;
        InetAddress ipaddr;
        int client_port;
        public void rdt_connect(String host , int client_port) throws IOException{
                this.client_port = client_port;
                client_socket = new DatagramSocket();
                ipaddr = InetAddress.getByName(host);
        public void rdt_listen(int port) throws SocketException{
            //byte[] buffer = new byte[1024];
            socket = new DatagramSocket(port);
            //DatagramPacket packet = new DatagramPacket(buffer, buffer.length );
        public DatagramPacket rdt_send() throws IOException{
            sendData = new byte[534];
            BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
            String inString = in.readLine();
            sendData = inString.getBytes();
            DatagramPacket send_packet = new DatagramPacket(sendData,sendData.length, ipaddr,client_port );
            return send_packet;
        public DatagramPacket rdt_recv(byte[] receivedData) throws IOException{
            //byte[] receivedData = new byte[1024];
            DatagramPacket received_packet = new DatagramPacket(receivedData, receivedData.length );
            //socket.receive(received_packet);
            return received_packet;
        public byte[] rdt_select() throws IOException{
            rcv_pkt = new DatagramPacket(receivedData,receivedData.length);
            while(!receivedData.equals(null)){
                return receivedData;
            send_all();
            return null;
        public void send_all() throws IOException{
            rcv_pkt = this.rdt_send();
            client_socket.send(rcv_pkt);
        public DatagramPacket select(){
            DatagramPacket local_rcv_pkt = null;
            while(receivedData != null){
                //local_rcv_pkt = rcv_pkt;
            return local_rcv_pkt;
        public void recv_from() throws IOException{
            rcv_pkt = select();
            socket.receive(rcv_pkt);
        public void statemachine_send(){
        public void statemachine_recv() throws IOException{
            String data = new String(rcv_pkt.getData());
            receivedData = data.getBytes();
            rcv_pkt = this.rdt_recv(receivedData);
    }

    public class Ex5 {
    DatagramSocket socket , client_socket;Surely you're not expected to implement the client and the server in the same class?
    while(!receivedData.equals(null)){
    return receivedData;
    }This is just nonsense.
    public DatagramPacket select(){See java.nio.channels.Selector.
    while(receivedData != null){
    //local_rcv_pkt = rcv_pkt;
    }More nonsense.
    I suggest if you don't understand the assignment you advise those who gave it to you, and/or review whatever supporting information you were supplied or have been taught.

  • PLEASE HELP ME WITH MY CODE

    i need alittle help i have this GUI that i created and i am trying to hook it up to a database in MS ACCESS and i am have so many problems trying to get my second table called billings to pull and show up in my GUI please take a look at my code and tell me what is wrong with it.
    now on my GUI its supposed to allow you to choose a company in the list box and after choosing a company, this allows you to get all the company's information like address and state and zip code and another list box is populated called consultants and you can choose a consultant and gethis or her billing information , like their hours billed from that company and their total hours billed
    please look at my code and tell me what is wrong, especially with the part about pulling information from the database.
    import java.sql.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Project extends Frame implements ItemListener, ActionListener
    //Declare database variables
    Connection conconsultants;
    Statement cmdconsultants;
    ResultSet rsconsultants;
    boolean blnSuccessfulOpen = false;
    //Declare components
    Choice lstNames = new Choice();
    TextField txtConsultant_Lname = new TextField(10);
    TextField txtConsultant_Fname = new TextField(10);
    TextField txtTitle = new TextField(9);
    TextField txtHours_Billed = new TextField(14);
    Button btnAdd = new Button("Add");
    Button btnEdit = new Button("Save");
    Button btnCancel = new Button("Cancel");
    Button btnDelete = new Button("Delete");
    Label lblMessage = new Label(" ");
    public static void main(String args[])
    //Declare an instance of this application
    Project thisApp = new Project();
    thisApp.createInterface();
    public void createInterface()
    //Load the database and set up the frame
    loadDatabase();
    if (blnSuccessfulOpen)
    //Set up frame
    setTitle("Update Test Database");
    addWindowListener(new WindowAdapter()
    public void windowClosing(WindowEvent event)
    stop();
    System.exit(0);
    setLayout(new BorderLayout());
    //Set up top panel
    Panel pnlTop = new Panel(new GridLayout(2, 2, 10, 10));
    pnlTop.add(new Label("Last Name"));
    lstNames.insert("Select a Name to Display", 0);
    lstNames.addItemListener(this);
    pnlTop.add(lstNames);
    pnlTop.add(new Label(" "));
    add(pnlTop, "North");
    //Set up center panel
    Panel pnlMiddle = new Panel(new GridLayout(5, 2, 10, 10));
    pnlMiddle.getInsets();
    pnlMiddle.add(new Label("Consultant_Lname"));
    pnlMiddle.add(txtConsultant_Lname);
    pnlMiddle.add(new Label("Consultant_Fname"));
    pnlMiddle.add(txtConsultant_Fname);
    pnlMiddle.add(new Label("Title"));
    pnlMiddle.add(txtTitle);
    pnlMiddle.add(new Label("Hours_Billed"));
    pnlMiddle.add(txtHours_Billed);
    setTextToNotEditable();
    Panel pnlLeftButtons = new Panel(new GridLayout(0, 2, 10, 10));
    Panel pnlRightButtons = new Panel(new GridLayout(0, 2, 10, 10));
    pnlLeftButtons.add(btnAdd);
    btnAdd.addActionListener(this);
    pnlLeftButtons.add(btnEdit);
    btnEdit.addActionListener(this);
    pnlRightButtons.add(btnDelete);
    btnDelete.addActionListener(this);
    pnlRightButtons.add(btnCancel);
    btnCancel.addActionListener(this);
    btnCancel.setEnabled(false);
    pnlMiddle.add(pnlLeftButtons);
    pnlMiddle.add(pnlRightButtons);
    add(pnlMiddle, "Center");
    //Set up bottom panel
    add(lblMessage, "South");
    lblMessage.setForeground(Color.red);
    //Display the frame
    setSize(400, 300);
    setVisible(true);
    else
    stop(); //Close any open connection
    System.exit(-1); //Exit with error status
    public Insets insets()
    //Set frame insets
    return new Insets(40, 15, 15, 15);
    public void loadDatabase()
    try
    //Load the Sun drivers
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    catch (ClassNotFoundException err)
    try
    //Load the Microsoft drivers
    Class.forName("com.ms.jdbc.odbc.JdbcOdbcDriver");
    catch (ClassNotFoundException error)
    System.err.println("Drivers did not load properly");
    try
    //Connect to the database
    conconsultants = DriverManager.getConnection("jdbc:odbc:Test");
    //Create a ResultSet
    cmdconsultants = conconsultants.createStatement();
    rsconsultants = cmdconsultants.executeQuery(
    "Select * from consultants; ");
    loadNames(rsconsultants);
    blnSuccessfulOpen = true;
    catch(SQLException error)
    System.err.println("Error: " + error.toString());
    public void loadNames(ResultSet rsconsultants)
    //Fill last name list box
    try
    while(rsconsultants.next())
    lstNames.add(rsconsultants.getString("Consultant_Lname"));
    catch (SQLException error)
    System.err.println("Error in Display Record." + "Error: " + error.toString());
    public void itemStateChanged(ItemEvent event)
    //Retrieve and display the selected record
    String strConsultant_Lname = lstNames.getSelectedItem();
    lblMessage.setText(""); //Delete instructions
    try
    rsconsultants = cmdconsultants.executeQuery(
    "SELECT c.Consultant_ID"+
    "c.Consultant_Lname"+
    "c.Consultant_Fname"+
    "c.Title"+
    "l.Client_ID"+
    "l.Client_Name"+
    "l.Address"+
    "l.City"+
    "l.State"+
    "l.Zip"+
    "b.Hours_Billed"+
    "b.Billing_Rate"+
    "b.Client_ID"+
    "b.Consultant_ID"+
    "FROM Consultants c, Clients l, Billing b"+
    "WHERE c.Consultant_ID = b.Consultant_ID"+
    "l.Client_ID = b.Client_ID"+
    "GROUP BY c.Consultant_ID");
    //"SELECT * FROM Consultants INNER JOIN Billing ON Consultants.Consultant_ID = Billing.Consultant_ID");
    //FROM Consultants INNER JOIN Billing ON Consultants.Consultant_ID = Billing.Consultant_ID;");
    //"Select * from consultants where [Consultant_Lname] = '" + strConsultant_Lname + "';");
    txtConsultant_Lname.setText(strConsultant_Lname);
    displayRecord(rsconsultants);
    setTextToEditable();
    catch(SQLException error)
    lblMessage.setText("Error in result set. " + "Error: " + error.toString());
    public void displayRecord(ResultSet rsconsultants)
    //Display the current record
    try
    if(rsconsultants.next())
    txtConsultant_Fname.setText(rsconsultants.getString("Consultant_Fname"));
    txtTitle.setText(rsconsultants.getString("Title"));
    txtHours_Billed.setText(rsconsultants.getString("Hours_Billed"));
    lblMessage.setText("");
    else
    lblMessage.setText("Record not found");
    clearTextFields();
    catch (SQLException error)
    lblMessage.setText("Error: " + error.toString());
    public void actionPerformed(ActionEvent event)
    //Test the command buttons
    Object objSource = event.getSource();
    if(objSource == btnAdd && event.getActionCommand () == "Add")
    Add();
    else if (objSource == btnAdd)
    Save();
    else if(objSource == btnEdit)
    Edit();
    else if(objSource == btnDelete)
    Delete();
    else if(objSource == btnCancel)
    Cancel();
    public void setTextToNotEditable()
    //Lock the text fields
    txtConsultant_Lname.setEditable(false);
    txtConsultant_Fname.setEditable(false);
    txtTitle.setEditable(false);
    txtHours_Billed.setEditable(false);
    public void setTextToEditable()
    //Unlock the text fields
    txtConsultant_Lname.setEditable(true);
    txtConsultant_Fname.setEditable(true);
    txtTitle.setEditable(true);
    txtHours_Billed.setEditable(true);
    public void clearTextFields()
    //Clear the text fields
    txtConsultant_Lname.setText("");
    txtConsultant_Fname.setText("");
    txtTitle.setText("");
    txtHours_Billed.setText("");
    public void Add()
    //Add a new record
    lblMessage.setText(" "); //Clear previous message
    setTextToEditable(); //Unlock the text fields
    clearTextFields(); //Clear text field contents
    txtConsultant_Lname.requestFocus ();
    //Set up the OK and Cancel buttons
    btnAdd.setLabel("OK");
    btnCancel.setEnabled(true);
    //Disable the Delete and Edit buttons
    btnDelete.setEnabled(false);
    btnEdit.setEnabled(false);
    public void Save()
    //Save the new record
    // Activated when the Add button has an "OK" label
    if (txtConsultant_Lname.getText().length ()== 0 || txtTitle.getText().length() == 0)
    lblMessage.setText("The Consultant's Last Name or Title is blank");
    else
    try
    cmdconsultants.executeUpdate("Insert Into consultants "
    + "([Consultant_Lname], [Consultant_Fname], Title, [Hours_Billed]) "
    + "Values('"
    + txtConsultant_Lname.getText() + "', '"
    + txtConsultant_Fname.getText() + "', '"
    + txtTitle.getText() + "', '"
    + txtHours_Billed.getText() + "')");
    //Add to name list
    lstNames.add(txtConsultant_Lname.getText());
    //Reset buttons
    Cancel();
    catch(SQLException error)
    lblMessage.setText("Error: " + error.toString());
    public void Delete()
    //Delete the current record
    int intIndex = lstNames.getSelectedIndex();
    String strConsultant_Lname = lstNames.getSelectedItem();
    if(intIndex == 0) //Make sure a record is selected
    //Position 0 holds a text message
    lblMessage.setText("Please select the record to be deleted");
    else
    //Delete the record from the database
    try
    cmdconsultants.executeUpdate(
    "Delete from consultants where [Consultant_Lname] = '" + strConsultant_Lname + "';");
    clearTextFields(); //Delete from screen
    lstNames.remove(intIndex); //Delete from list
    lblMessage.setText("Record deleted"); //Display message
    catch(SQLException error)
    lblMessage.setText("Error during Delete."
    + "Error: " + error.toString());
    public void Cancel()
    //Enable the Delete and Edit buttons
    btnDelete.setEnabled(true);
    btnEdit.setEnabled(true);
    //Disable the Cancel button
    btnCancel.setEnabled(false);
    //Change caption of button
    btnAdd.setLabel("Add");
    //Clear the text fields and status bar
    clearTextFields();
    lblMessage.setText("");
    public void Edit()
    //Save the modified record
    int intIndex = lstNames.getSelectedIndex();
    if(intIndex == 0) //Make sure a record is selected
    //Position 0 holds a text message
    lblMessage.setText("Please select the record to change");
    else
    String strConsultant_Lname = lstNames.getSelectedItem();
    try
    cmdconsultants.executeUpdate("Update consultants "
    + "Set [Consultant_Lname] = '" + txtConsultant_Lname.getText() + "', "
    + "[Consultant_Fname] = '" + txtConsultant_Fname.getText() + "', "
    + "Title = '" + txtTitle.getText() + "', "
    + "[Hours_Billed] = '" + txtHours_Billed.getText() + "' "
    + "Where [Consultant_Lname] = '" + strConsultant_Lname + "';");
    if (!strConsultant_Lname.equals(txtConsultant_Lname.getText()))
    //Last name changed; change the list
    lstNames.remove(intIndex); //Remove the old entry
    lstNames.add(txtConsultant_Lname.getText()); //Add the new entry
    catch(SQLException error)
    lblMessage.setText("Error during Edit. " + "Error: " + error.toString());
    public void stop()
    //Terminate the connection
    try
    if (conconsultants != null)
    conconsultants.close();
    catch(SQLException error)
    lblMessage.setText("Unable to disconnect");

    I don't think that your DB URL is correct

  • Please help me with this code

    hi to all experts ,
    my requirement is print a barcode..The first part is an alv with two editable fields when user checks the checkbox and changes the second coloumn that no of prints are to be printed ....everything is fine but the problem is if suppose first 3 checkboxes are checked and qty to print is 3 for each .So the total no of prints should be 9 which im able to see in the print preview ......but the problem is when after seeing the print preview when we are back to the alv screen and uncheck one checkbox so now the pages should be 6 but it is still 9 what could be the problem here is my code since i cannot post full im sending in parts.......any help will greatly apprieciated ..........................thanks
    TYPE-POOLS: slis.
    *TYPES DECLARATIONS
    TYPES:BEGIN OF ty_output,
    cbox(1)  TYPE c,"selection checkbox
    menge1 TYPE char16,"QUANTITY TO PRINT
    mblnr  TYPE mkpf-mblnr,"MATERIAL DOCUMENT NUMBER
    bwart  TYPE mseg-bwart,"MOVEMENT TYPE
    btext  TYPE t156t-btext,"MOVEMENT TYPE DESCRIPTION
    matnr  TYPE mseg-matnr,"MATERIAL NUMBER
    maktx  TYPE makt-maktx,"MATERIAL DESCRIPTION
    menge2 TYPE mseg-menge,"QUANTITY
    meins  TYPE mseg-meins,"BASE UNIT OF MEASUREMENT
    werks TYPE mseg-werks,"PLANT
    lgort TYPE mseg-lgort,"STORAGE LOCATION
    ebeln TYPE mseg-ebeln,"PO DOCUMENT NUMBER
    lifnr TYPE mseg-lifnr,"VENDOR
    bldat TYPE mkpf-bldat,"DOCUMENT DATE
    budat TYPE mkpf-budat,"POSTING DATE
    usnam TYPE mkpf-usnam,"USER ID
    xblnr TYPE mkpf-xblnr,"MATERIAL SLIP
    END OF   ty_output.
    TYPES : BEGIN OF ty_data,
    menge TYPE mseg-menge,"QUANTITY
    mblnr TYPE mkpf-mblnr,"MATERIAL DOCUMENT NUMBER
    bwart TYPE mseg-bwart,"MOVEMENT TYPE
    matnr TYPE mseg-matnr,"MATERIAL NUMBER
    meins TYPE mseg-meins,"BASE UNIT OF MEASUREMENT
    werks TYPE mseg-werks,"PLANT
    lgort TYPE mseg-lgort,"STORAGE LOCATION
    ebeln TYPE mseg-ebeln,"PO DOCUMENT NUMBER
    lifnr TYPE mseg-lifnr,"VENDOR
    bldat TYPE mkpf-bldat,"DOCUMENT DATE
    budat TYPE mkpf-budat,"POSTING DATE
    usnam TYPE mkpf-usnam,"USER ID
    xblnr TYPE mkpf-xblnr,"MATERIAL SLIP
            END   OF ty_data.
    TYPES: BEGIN OF ty_btext,
       btext TYPE t156t-btext,
       bwart TYPE t156-bwart,
           END   OF ty_btext.
    TYPES : BEGIN OF ty_maktx,
              maktx TYPE makt-maktx,
              matnr TYPE makt-matnr,
            END OF  ty_maktx.
    TYPES: BEGIN OF ty_mard,
             matnr TYPE mard-matnr,
             lgpbe TYPE mard-lgpbe,
          END OF ty_mard.
    *INTERNAL TABLES
    DATA: it_output  TYPE  STANDARD TABLE OF ty_output,
          it_data     TYPE STANDARD TABLE OF ty_data,
          it_btext    TYPE STANDARD TABLE OF ty_btext,
          it_maktx    TYPE STANDARD TABLE OF ty_maktx,
          it_fieldcat TYPE STANDARD TABLE OF slis_fieldcat_alv,
          it_events   TYPE STANDARD TABLE OF slis_alv_event,
          it_header   TYPE  slis_t_listheader,
          it_smart    TYPE STANDARD TABLE OF zmm_im_001_struc,
          it_mard     TYPE STANDARD TABLE OF ty_mard.
    *WORK AREAS
    DATA: wa_output   TYPE  ty_output,
          wa_data     TYPE  ty_data,
          wa_btext    TYPE  ty_btext,
          wa_maktx    TYPE  ty_maktx,
          wa_fieldcat TYPE  slis_fieldcat_alv,
          wa_events   TYPE  slis_alv_event,
          wa_header   TYPE  slis_listheader,
          wa_smart    LIKE LINE OF it_smart,
          wa_layout   TYPE  slis_layout_alv,
          wa_mard     TYPE  ty_mard.
    *FLAGS AND CONSTANTS
    DATA: fl_sel TYPE flag.
    DATA: fl_del TYPE flag,
          gv_count TYPE i.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:
      so_mblnr FOR  mkpf-mblnr,
      so_bwart FOR  mseg-bwart,"MOVEMENT TYPE
      so_bldat FOR  mkpf-bldat,"DOCUMENT DATE
      so_budat FOR  mkpf-budat,"POSTING DATE
      so_matnr FOR  mseg-matnr,"MATERIAL ID
    so_meins FOR  mseg-meins,"BASE UNIT OF MEASUREMENT
      so_werks FOR  mseg-werks,"PLANT
      so_lgort FOR  mseg-lgort,"STORAGE LOCATION
      so_lifnr FOR  mseg-lifnr,"VENDOR
      so_xblnr FOR  mkpf-xblnr,"MATERIAL SLIP
      so_ebeln FOR  mseg-ebeln,"PURCHASE DOC
      so_usnam FOR  mkpf-usnam.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2
       WITH FRAME TITLE text-002.
    PARAMETERS : 1x3 RADIOBUTTON GROUP
                  grp1 DEFAULT 'X',
                 2x4 RADIOBUTTON GROUP
                 grp1.
    SELECTION-SCREEN END OF BLOCK b2.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT 1(82) text-007.
    *SELECTION-SCREEN COMMENT 89(4) text-008.   " First part of your comment
    *SELECTION-SCREEN END OF LINE.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_mblnr-low.
    *GETTING F4 HELP FOR THE
    >FIELD MBLNR( MATERIAL DOCUMENT NUMBER)
      PERFORM get_f4val .
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_mblnr-high.
    GETTING F4 HELP FOR THE
    FIELD MBLNR( MATERIAL DOCUMENT NUMBER)
      PERFORM get_f4val .
    AT SELECTION-SCREEN.
      PERFORM valid_bwart.
      PERFORM valid_selscreen.
    if no records are found displaying an error message
      IF sy-dbcnt EQ 0.
        MESSAGE e003(zmimr012).
      ENDIF.
    START-OF-SELECTION.
    PERFORM get_data.
      PERFORM populate_data.
      PERFORM get_fcat.
      PERFORM get_events.
      PERFORM populate_events.
      PERFORM get_layout.
      PERFORM display_alv.
    Refresh : it_output,
             it_data,
             it_smart.
    *&      Form  GET_DATA
    FORM get_data .
      SELECT  b~menge
              a~mblnr
              b~bwart
              b~matnr
              b~meins
              b~werks
              b~lgort
              b~ebeln
              b~lifnr
              a~bldat
              a~budat
              a~usnam
              a~xblnr
      INTO CORRESPONDING
        FIELDS OF TABLE it_data
      FROM    mkpf AS a
      INNER JOIN  mseg AS b ON
            amblnr = bmblnr
        AND amjahr = bmjahr
      WHERE  a~mblnr  IN so_mblnr
      AND    b~bwart  IN so_bwart
      AND    b~bwart  IN ('101', '105')
      AND    a~bldat  IN so_bldat
      AND    a~budat  IN so_budat
      AND    b~matnr  IN so_matnr
      AND    b~matnr  NE space
      AND    b~werks  IN so_werks
      AND    b~lgort  IN so_lgort
      AND    b~ebeln  IN so_ebeln
      AND    b~lifnr  IN so_lifnr
      AND    a~xblnr  IN so_xblnr
      AND    a~usnam  IN so_usnam.
        SELECT btext
               bwart
                FROM t156t
                INTO TABLE it_btext
                FOR ALL ENTRIES IN it_data
                WHERE spras EQ 'EN'
                  AND bwart   = it_data-bwart
                  AND sobkz   = ''
                  AND kzbew   = 'B'
                  AND kzzug   = ''
                  AND kzvbr   = ''.
        SELECT maktx
               matnr
             FROM makt INTO
             TABLE it_maktx
             FOR ALL ENTRIES IN it_data
             WHERE matnr EQ it_data-matnr
             AND  spras EQ 'E'.
        SELECT matnr
               lgpbe
               FROM mard INTO
               TABLE it_mard
               FOR ALL ENTRIES IN it_data
          WHERE matnr EQ it_data-matnr
           AND  werks EQ it_data-werks
           AND  lgort EQ it_data-lgort.
    ENDIF.
    ENDFORM.                    " GET_DATA
    *&      Form  GET_F4VAL
    FORM get_f4val .
      TYPES : BEGIN OF ly_mblnr,
                mblnr TYPE mkpf-mblnr,
              END OF  ly_mblnr.
      DATA: lc_mblnr   TYPE dfies-fieldname
               VALUE 'MBLNR',
             lc_s_mblnr TYPE help_info-dynprofld
                        VALUE 'SO_MBLNR-LOW',
             lc_dynnr
              TYPE sy-dynnr VALUE '1000',
             lc_repid   TYPE sy-repid.
      DATA: lt_mblnr TYPE STANDARD
               TABLE OF ly_mblnr,
            lv_mblnr TYPE ly_mblnr,
            lt_return TYPE STANDARD TABLE OF
              ddshretval WITH HEADER LINE.
      CLEAR:lt_mblnr[],lv_mblnr,lt_return[],lt_return.
      SELECT mblnr FROM mkpf
        INTO TABLE lt_mblnr.
      SORT lt_mblnr.
      DELETE ADJACENT DUPLICATES FROM lt_mblnr.
      lc_repid = sy-repid.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = lc_mblnr
          value_org       = 'S'
          dynpprog        = lc_repid
          dynpnr          = lc_dynnr
          dynprofield     = lc_s_mblnr
        TABLES
          value_tab       = lt_mblnr
          return_tab      = lt_return
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
      IF sy-subrc <> 0.
      ELSE.
        lc_mblnr = lt_return-fieldval.
      ENDIF.
    ENDFORM.                                                    " GET_F4VAL
    Edited by: mozam khan on Feb 28, 2009 4:39 AM

    *&      Form  PF_STATUS
    FORM pf_status_set USING
            ex_tab TYPE  slis_t_extab .
      SET PF-STATUS 'ZMIMR012_GUI' EXCLUDING ex_tab.
    ENDFORM. " PF_STATUS
    *&      Form  user_command
          text
    FORM user_command USING r_ucomm TYPE sy-ucomm
                        rs_selfield TYPE slis_selfield  .
      DATA: p_ref1 TYPE REF TO cl_gui_alv_grid.
      CASE r_ucomm .
        WHEN 'EXEC' .
          CLEAR p_ref1.
          IF p_ref1 IS INITIAL.
            CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
              IMPORTING
                e_grid = p_ref1.
          ENDIF.
          IF p_ref1 IS NOT INITIAL.
            CALL METHOD p_ref1->check_changed_data.
          ENDIF.
          LOOP AT it_output INTO wa_output WHERE cbox EQ 'X'.
            READ TABLE it_mard INTO wa_mard WITH KEY matnr = wa_output-matnr.
            IF sy-subrc EQ 0.
              wa_smart-lgpbe = wa_mard-lgpbe.
            ENDIF.
            wa_smart-matnr =  wa_output-matnr.
            wa_smart-maktx =  wa_output-maktx.
            wa_smart-meins =  wa_output-meins.
            wa_smart-bldat =  wa_output-bldat.
            wa_smart-no_cop = wa_output-menge1.
            APPEND wa_smart TO it_smart.
            CLEAR: wa_smart,wa_output.
          ENDLOOP.
    CALL METHOD p_ref1->REFRESH_TABLE_DISPLAY.
         CHECK fl_del NE 'X'.
          IF 1x3 = 'X'.
            PERFORM print_smartform1x3.
          ELSE.
            PERFORM print_smartform2x4.
          ENDIF.
       WHEN 'SEL_ALL'.
         fl_sel = 'X'." setting up the flag for all selection.
         PERFORM sel_rec.
         rs_selfield-refresh = 'X'.
       WHEN  'DES_ALL'.
         fl_del = 'X'.
         PERFORM del_sel.
         rs_selfield-refresh = 'X'.
      ENDCASE.
    ENDFORM.                    " user_command
    " top_of_page
    *&      Form  display_alv
    FORM display_alv .
      DATA: l_repid TYPE sy-repid.
      l_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                = l_repid
         i_callback_pf_status_set          = 'PF-STATUS_SET'
         i_callback_user_command           = 'USER_COMMAND'
        I_CALLBACK_TOP_OF_PAGE            = 'top_of_page'
         i_callback_html_top_of_page       = 'HTML_TOP_OF_PAGE'
        I_CALLBACK_HTML_END_OF_LIST       = ' '
        I_STRUCTURE_NAME                  =
        I_BACKGROUND_ID                   = ' '
        I_GRID_TITLE                      =
        I_GRID_SETTINGS                   =
          is_layout                         = wa_layout
          it_fieldcat                       = it_fieldcat
        IT_EXCLUDING                      =
        IT_SPECIAL_GROUPS                 =
        IT_SORT                           =
        IT_FILTER                         =
        IS_SEL_HIDE                       =
        I_DEFAULT                         = 'X'
        I_SAVE                            = ' '
        IS_VARIANT                        =
          it_events                         = it_events
        IT_EVENT_EXIT                     =
        IS_PRINT                          =
        IS_REPREP_ID                      =
        I_SCREEN_START_COLUMN             = 0
        I_SCREEN_START_LINE               = 0
        I_SCREEN_END_COLUMN               = 0
        I_SCREEN_END_LINE                 = 0
        I_HTML_HEIGHT_TOP                 = 0
        I_HTML_HEIGHT_END                 = 0
        IT_ALV_GRAPHICS                   =
        IT_HYPERLINK                      =
        IT_ADD_FIELDCAT                   =
        IT_EXCEPT_QINFO                   =
        IR_SALV_FULLSCREEN_ADAPTER        =
      IMPORTING
        E_EXIT_CAUSED_BY_CALLER           =
        ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = it_output
       EXCEPTIONS
         program_error                     = 1
         OTHERS                            = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " display_alv
    *&      Form  get_layout
    FORM get_layout .
      wa_layout-box_fieldname         =  'CBOX' .
      wa_layout-box_tabname           =  'IT_OUTPUT'.
      wa_layout-colwidth_optimize     =  'X'.
    ENDFORM.                    " get_layout
    " print_smartform_1x3
    *&      Form  valid_bwart
          text
    -->  p1        text
    <--  p2        text
    FORM valid_bwart .
      TYPES:BEGIN OF ly_bwart,
              bwart TYPE mseg-bwart,
            END OF ly_bwart.
      DATA:it_bwart TYPE TABLE OF ly_bwart WITH  HEADER LINE.
      IF so_bwart[] IS NOT INITIAL.
        SELECT  bwart FROM mseg INTO TABLE it_bwart
                  FOR ALL ENTRIES IN so_bwart[]
                WHERE bwart <= so_bwart-high AND bwart => so_bwart-low.
        LOOP AT it_bwart.
          IF it_bwart-bwart NE '101' OR it_bwart-bwart NE '105' .
            CONTINUE.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " valid_bwart
    *&      Form  print_smartform2x4
          text
         -->P_WA_SMART  text
         -->P_IT_SMART  text
    FORM print_smartform1x3.
      DATA : fm_name TYPE rs38l_fnam,
             control_parameters TYPE ssfctrlop,
             wa_job_output_info TYPE ssfcrescl,
             ssfcompin TYPE ssfcompin,
             ssfcompop TYPE  ssfcompop.
      ssfcompin-dialog = 'X'.
      CALL FUNCTION 'SSF_OPEN'
      EXPORTING
        ARCHIVE_PARAMETERS       =
        USER_SETTINGS            = 'X'
        MAIL_SENDER              =
        MAIL_RECIPIENT           =
        MAIL_APPL_OBJ            =
        OUTPUT_OPTIONS           =
         control_parameters       = control_parameters
      IMPORTING
        JOB_OUTPUT_OPTIONS       =
       EXCEPTIONS
         formatting_error         = 1
         internal_error           = 2
         send_error               = 3
         user_canceled            = 4
         OTHERS                   = 5
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = 'ZMM_IM_001'
          variant            = ' '
          direct_call        = ' '
        IMPORTING
          fm_name            = fm_name
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      control_parameters-no_open = 'X'.
      control_parameters-no_close = 'X'.
      LOOP AT it_smart INTO wa_smart.
        IF wa_smart-no_cop IS NOT INITIAL.
          MOVE wa_smart-no_cop TO gv_count.
        ENDIF.
        DO  gv_count TIMES.
          CALL FUNCTION fm_name
            EXPORTING
          ARCHIVE_INDEX              =
          ARCHIVE_INDEX_TAB          =
          ARCHIVE_PARAMETERS         =
              control_parameters         = control_parameters
          MAIL_APPL_OBJ              =
          MAIL_RECIPIENT             =
          MAIL_SENDER                =
              output_options             = ssfcompop
          USER_SETTINGS              = 'X'
              wa_display                 = wa_smart
        IMPORTING
          DOCUMENT_OUTPUT_INFO       =
          JOB_OUTPUT_INFO            =
          JOB_OUTPUT_OPTIONS         =
           EXCEPTIONS
             formatting_error           = 1
             internal_error             = 2
             send_error                 = 3
             user_canceled              = 4
             OTHERS                     = 5
          IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
        ENDDO.
        CLEAR gv_count.
        CLEAR   :   wa_smart.
      ENDLOOP.
      CALL FUNCTION 'SSF_CLOSE'
        IMPORTING
          job_output_info  = wa_job_output_info
        EXCEPTIONS
          formatting_error = 1
          internal_error   = 2
          send_error       = 3
          OTHERS           = 4.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " print_smartform2x4
    *&      Form  print_smartform2x4
          text
    -->  p1        text
    <--  p2        text
    FORM print_smartform2x4 .
      DATA : fm_name TYPE rs38l_fnam,
             control_parameters TYPE ssfctrlop,
             wa_job_output_info TYPE ssfcrescl,
             ssfcompin TYPE ssfcompin,
             ssfcompop TYPE ssfcompop.
      ssfcompin-dialog = 'X'.
      CALL FUNCTION 'SSF_OPEN'
       EXPORTING
        ARCHIVE_PARAMETERS       =
        USER_SETTINGS            = 'X'
        MAIL_SENDER              =
        MAIL_RECIPIENT           =
        MAIL_APPL_OBJ            =
        OUTPUT_OPTIONS           =
          control_parameters       = control_parameters
      IMPORTING
        JOB_OUTPUT_OPTIONS       =
       EXCEPTIONS
         formatting_error         = 1
         internal_error           = 2
         send_error               = 3
         user_canceled            = 4
         OTHERS                   = 5
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = 'ZMM_IM_002'
          variant            = ' '
          direct_call        = ' '
        IMPORTING
          fm_name            = fm_name
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      control_parameters-no_open = 'X'.
      control_parameters-no_close = 'X'.
      LOOP AT it_smart INTO wa_smart.
        IF wa_smart-no_cop IS NOT INITIAL.
          MOVE wa_smart-no_cop TO gv_count.
        ENDIF.
        DO  gv_count TIMES.
          CALL FUNCTION fm_name
            EXPORTING
          ARCHIVE_INDEX              =
          ARCHIVE_INDEX_TAB          =
          ARCHIVE_PARAMETERS         =
              control_parameters         = control_parameters
          MAIL_APPL_OBJ              =
          MAIL_RECIPIENT             =
          MAIL_SENDER                =
           OUTPUT_OPTIONS             = ssfcompop
          USER_SETTINGS              = 'X'
              wa_display                 = wa_smart
        IMPORTING
          DOCUMENT_OUTPUT_INFO       =
          JOB_OUTPUT_INFO            =
          JOB_OUTPUT_OPTIONS         =
           EXCEPTIONS
             formatting_error           = 1
             internal_error             = 2
             send_error                 = 3
             user_canceled              = 4
             OTHERS                     = 5
          IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
        ENDDO.
        CLEAR: gv_count.
      ENDLOOP.
      CALL FUNCTION 'SSF_CLOSE'
        IMPORTING
          job_output_info  = wa_job_output_info
        EXCEPTIONS
          formatting_error = 1
          internal_error   = 2
          send_error       = 3
          OTHERS           = 4.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " print_smartform2x4
    *&      Form  valid_selscreen
          text
    -->  p1        text
    <--  p2        text
    FORM valid_selscreen .
      SELECT  b~menge
              a~mblnr
              b~bwart
              b~matnr
              b~meins
              b~werks
              b~lgort
              b~ebeln
              b~lifnr
              a~bldat
              a~budat
              a~usnam
              a~xblnr
      INTO CORRESPONDING
        FIELDS OF TABLE it_data
      FROM    mkpf AS a
      INNER JOIN  mseg AS b ON
            amblnr = bmblnr
        AND amjahr = bmjahr
      WHERE  a~mblnr  IN so_mblnr
      AND    b~bwart  IN so_bwart
      AND    b~bwart  IN ('101', '105')
      AND    a~bldat  IN so_bldat
      AND    a~budat  IN so_budat
      AND    b~matnr  IN so_matnr
      AND    b~matnr  NE space
      AND    b~werks  IN so_werks
      AND    b~lgort  IN so_lgort
      AND    b~ebeln  IN so_ebeln
      AND    b~lifnr  IN so_lifnr
      AND    a~xblnr  IN so_xblnr
      AND    a~usnam  IN so_usnam.
    ENDFORM.                    " valid_selscreen
    *&      Form  sel_rec
          text
    -->  p1        text
    <--  p2        text
    FORM sel_rec .
      DATA: lv_tabix TYPE sy-tabix.
      LOOP AT  it_output INTO wa_output.
        lv_tabix = sy-tabix.
        wa_output-cbox = 'X'.
        MODIFY it_output FROM wa_output TRANSPORTING cbox.
        CLEAR: wa_output.
      ENDLOOP.
    ENDFORM.                    " sel_rec

  • PLEASE HELP ME WITH THIS CODE I NEED A NAV BAR ASAP!!!!

    The code is below I just want a simple navigation bar that when I click on biography it takes me to the biography page and so on...I even tried the "href" nothing works I try it in live view and it doesnt work I try it out of live view and it still doesnt work Im using DW CS5 This page was made using a DW template but I changed it around to fit my liking
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>WebIntersect &Bull;Find ElizabethVictoria</title>
    <style type="text/css">
    <!--
    body {
    background: #000;
    margin: 0;
    padding: 0;
    color: #FCCFDD;
    background-color: #000;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 100%;
    line-height: 1.4;
    /* ~~ Element/tag selectors ~~ */
    ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */
    padding: 0;
    margin: 0;
    h1, h2, h3, h4, h5, h6, p {
    margin-top: 0;  /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */
    padding-right: 15px;
    padding-left: 15px; /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */
    color: #FCCFDD;
    font-weight: bold;
    text-align: center;
    a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */
    border: none;
    color: #000;
    /* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */
    a:link {
    color:#808080;
    text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */
    a:visited {
    color: #FCCFDD;
    text-decoration: underline;
    a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */
    text-decoration: none;
    color: #FCCFDD;
    /* ~~ this container surrounds all other divs giving them their percentage-based width ~~ */
    .container {
    width: 80%;
    max-width: 1260px;/* a max-width may be desirable to keep this layout from getting too wide on a large monitor. This keeps line length more readable. IE6 does not respect this declaration. */
    min-width: 780px;/* a min-width may be desirable to keep this layout from getting too narrow. This keeps line length more readable in the side columns. IE6 does not respect this declaration. */
    background: #000;
    margin: 0 auto; /* the auto value on the sides, coupled with the width, centers the layout. It is not needed if you set the .container's width to 100%. */
    /* ~~ the header is not given a width. It will extend the full width of your layout. It contains an image placeholder that should be replaced with your own linked logo ~~ */
    .header {
    background: #000;
    color: #FCCFDD;
    .sidebar1 {
    float: left;
    width: 20%;
    padding-bottom: 10px;
    background-color: #000;
    background-image: url(images/Untitled-6.gif);
    background-repeat: no-repeat;
    .content {
    padding: 10px 0;
    width: 60%;
    float: left;
    .sidebar2 {
    float: left;
    width: 20%;
    padding: 10px 0;
    background-color: #000;
    background-image: url(images/Untitled-6.gif);
    /* ~~ This grouped selector gives the lists in the .content area space ~~ */
    .content ul, .content ol {
    padding: 0 15px 15px 40px; /* this padding mirrors the right padding in the headings and paragraph rule above. Padding was placed on the bottom for space between other elements on the lists and on the left to create the indention. These may be adjusted as you wish. */
    /* ~~ The navigation list styles (can be removed if you choose to use a premade flyout menu like Spry) ~~ */
    ul.nav {
    list-style: none; /* this removes the list marker */
    border-top: 1px solid #666; /* this creates the top border for the links - all others are placed using a bottom border on the LI */
    margin-bottom: 15px; /* this creates the space between the navigation on the content below */
    ul.nav li {
    border-bottom: 1px solid #666; /* this creates the button separation */
    ul.nav a, ul.nav a:visited { /* grouping these selectors makes sure that your links retain their button look even after being visited */
    padding: 5px 5px 5px 15px;
    display: block; /* this gives the link block properties causing it to fill the whole LI containing it. This causes the entire area to react to a mouse click. */
    text-decoration: none;
    background: #8090AB;
    color: #000;
    ul.nav a:hover, ul.nav a:active, ul.nav a:focus { /* this changes the background and text color for both mouse and keyboard navigators */
    background: #6F7D94;
    color: #FFF;

    Where is your html code? or better yet a link to your site in question.

  • Please help me with this code. Newbie here!

    Hi all,
    Below is a sample from the project that I am doing now. Would someone be so kind as to tell me how come the internal frame doesn't appear and the compiler keeps returning an error pointing to "setContentPane(mainDeskTop);"?
    Thanks in advance.
    package myprojects.xmlquery;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class XMLQuery extends Frame {
    public XMLQuery() {
    super("XMLQuery"); //Don't know what is this statement for?
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    dispose();
    System.exit(0);
    JDesktopPane mainDeskTop;
    mainDeskTop = new JDesktopPane(); //a specialized layered pane
    JInternalFrame frame = new JInternalFrame("test",true,true,true,true);
    frame.setSize(100,100);
    frame.setLocation(0,0);
    frame.setVisible(true); //set frame visible
    mainDeskTop.add(frame);
    try {
    frame.setSelected(true);
    } catch (java.beans.PropertyVetoException e) {}
    setContentPane(mainDeskTop);
    public static void main(String args[]) {
    System.out.println("Starting XMLQuery...");
    XMLQuery mainFrame = new XMLQuery();
    mainFrame.setSize(400, 400);
    mainFrame.setTitle("XMLQuery");
    mainFrame.setVisible(true);

    Extend JFrame instead of Frame.
    Denis

  • I brought a iTunes card and the the code on the back is not there it has faded away can u please help me with this problem

    i brought a iTunes card and the the code on the back is not there it has faded away can u please help me with this problem

    Hi Daniel ...
    Try here > iTunes Store: Invalid, inactive, or illegible codes

  • Help with abap code in Transformation

    Hi Experts,
    we have a scenario where we load delta data from an DSO into a Cube.
    The records in the DSO looks like below.
    Location as (L)
    WorkOrder as (W)
    Startdate(DDMMYYYY)/time (HH:MM:SS) as (S)
    Finishdate/time as (F)
    L1
    W1
    21/04/2009/10:00:00
    21/04/2009/12:00:00
    L1
    W2
    21/04/2009/14:00:00
    21/04/2009/23:00:00
    || L1 ||W3||  21/04/2009/16:00:00 ||21/04/2009/20:00:00 || 
    Total time ( April 2009 ) for above Location L1 should be calculated as a difference between W1 and W2 since W3 is a overlapping record. So the result would be 13 Hrs. Work Orders are summarised, so we dont need work order info in the output.
    Can you experts help me with the code to implement??
    Thanks,
    DV

    For each location, for example L1, move the records to an internal table itab.
    sort itab by startdate.
    read table itab index 1. 
    You will get the first value.
    sort itab by finishdate descending.
    read table itab index 1.
    you will get the second value.
    Calculate the difference and populate it to the internal table.
    finally modify the source package.
    I have just given the logic.  I hope you can build upon this.
    I hope it helps.
    Thanks.

  • Please help me with the following two questions, very urgent

    Hi All,
    Please help me with some scenerios about what are the common problems when modifying a standard script such a standard Invoice script and how can we overcome them.
    What are the common problems encountered when working with SAP SMARTFORMS and how to overcome them?
    Please help me with these questions, its very urgent.
    Thanks in advance.
    MD.

    hi
    hope it will help you.
    reward if ehlp.
    How to create a New smartfrom, it is having step by step procedure
    http://sap.niraj.tripod.com/id67.html
    step by step good ex link is....
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    Here is the procedure
    1. Create a new smartforms
    Transaction code SMARTFORMS
    Create new smartforms call ZSMART
    2. Define looping process for internal table
    Pages and windows
    First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
    Here, you can specify your title and page numbering
    &SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
    Main windows -> TABLE -> DATA
    In the Loop section, tick Internal table and fill in
    ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
    3. Define table in smartforms
    Global settings :
    Form interface
    Variable name Type assignment Reference type
    ITAB1 TYPE Table Structure
    Global definitions
    Variable name Type assignment Reference type
    ITAB2 TYPE Table Structure
    4. To display the data in the form
    Make used of the Table Painter and declare the Line Type in Tabstrips Table
    e.g. HD_GEN for printing header details,
    IT_GEN for printing data details.
    You have to specify the Line Type in your Text elements in the Tabstrips Output options.
    Tick the New Line and specify the Line Type for outputting the data.
    Declare your output fields in Text elements
    Tabstrips - Output Options
    For different fonts use this Style : IDWTCERTSTYLE
    For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
    5. Calling SMARTFORMS from your ABAP program
    REPORT ZSMARTFORM.
    Calling SMARTFORMS from your ABAP program.
    Collecting all the table data in your program, and pass once to SMARTFORMS
    SMARTFORMS
    Declare your table type in :-
    Global Settings -> Form Interface
    Global Definintions -> Global Data
    Main Window -> Table -> DATA
    Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
    http://sapr3.tripod.com
    TABLES: MKPF.
    DATA: FM_NAME TYPE RS38L_FNAM.
    DATA: BEGIN OF INT_MKPF OCCURS 0.
    INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF.
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
    MOVE-CORRESPONDING MKPF TO INT_MKPF.
    APPEND INT_MKPF.
    ENDSELECT.
    At the end of your program.
    Passing data to SMARTFORMS
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'ZSMARTFORM'
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    FM_NAME = FM_NAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    if sy-subrc <> 0.
    WRITE: / 'ERROR 1'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function FM_NAME
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    CONTROL_PARAMETERS =
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    OUTPUT_OPTIONS =
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    TABLES
    GS_MKPF = INT_MKPF
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5.
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    Smartform
    you can check this link here you can see the steps and you can do it the same by looking at it..
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    SMARTFORMS STEPS.
    1. In Tcode se11 Create a structure(struct) same like the Internal table that you are going to use in your report.
    2. Create Table type(t_struct) of stracture in se11.
    3. In your program declare Internal table(Itab) type table of structure(struct).
    4. Define work area(wa) like line of internal table.
    5. Open Tcode Smartforms
    6. In form Global setting , forminterface Import parameter define Internal table(Itab) like table type of stracture(t_struct).
    7. In form Global setting , Global definitions , in Global data define Work area(wa) like type stracture(struct).
    8. In form pages and window, create Page node by default Page1 is available.
    9. In page node you can create numbers of secondary window. But in form there is only one Main window.
    10. By right click on page you can create windows or Go to Edit, Node, Create.
    11. After creating the window right click on window create table for displaying the data that you are passing through internal table.
    12. In the table Data parameter, loop internal internal table (Itab) into work area(wa).
    13. In table there are three areas Header, Main Area, Footer.
    14. Right click on the Main area create table line by default line type1 is there select it.
    15. Divide line into cells according to your need then for each cell create Text node.
    16. In text node general attribute. Write down fields of your work area(wa) or write any thing you want to display.
    17. Save form and activate it.
    18. Then go to Environment, function module name, there you get the name of function module copy it.
    19. In your program call the function module that you have copied from your form.
    20. In your program in exporting parameter of function pass the internal table(itab).
    SAP Smart Forms is introduced in SAP Basis Release 4.6C as the tool for creating and maintaining forms.
    SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort. Thus, a power user without any programming knowledge can
    configure forms with data from an SAP System for the relevant business processes.
    To print a form, you need a program for data retrieval and a Smart Form that contains the entire from logic. As data retrieval and form logic are separated, you must only adapt the Smart Form if changes to the form logic are necessary. The application program passes the data via a function module interface to the Smart Form. When activating the Smart Form, the system automatically generates a function module. At runtime, the system processes this function module.
    You can insert static and dynamic tables. This includes line feeds in individual table cells, triggering events for table headings and subtotals, and sorting data before output.
    You can check individual nodes as well as the entire form and find any existing errors in the tree structure. The data flow analysis checks whether all fields (variables) have a defined value at the moment they are displayed.
    SAP Smart Forms allow you to include graphics, which you can display either as part of the form or as background graphics. You use background graphics to copy the layout of an existing (scanned) form or to lend forms a company-specific look. During printout, you can suppress the background graphic, if desired.
    SAP Smart Forms also support postage optimizing.
    Also read SAP Note No. 168368 - Smart Forms: New form tool in Release 4.6C
    What Transaction to start SAP Smart Forms?
    Execute transaction SMARTFORMS to start SAP Smart Forms.
    Key Benefits of SAP Smart Forms:
    SAP Smart Forms allows you to reduce considerably the implementation costs of mySAP.com solutions since forms can be adjusted in minimum time.
    You design a form using the graphical Form Painter and the graphical Table Painter. The form logic is represented by a hierarchy structure (tree structure) that consists of individual nodes, such as nodes for global settings, nodes for texts, nodes for output tables, or nodes for graphics.
    To make changes, use Drag & Drop, Copy & Paste, and select different attributes.
    These actions do not include writing of coding lines or using a Script language.
    Using your form description maintained in the Form Builder, Smart Forms generates a function module that encapsulates layout, content and form logic. So you do not need a group of function modules to print a form, but only one.
    For Web publishing, the system provides a generated XML output of the processed form.
    Smart Forms provides a data stream called XML for Smart Forms (XSF) to allow the use of 3rd party printing tools. XSF passes form content from R/3 to an external product without passing any layout information about the Smart Form.
    SmartForms System Fields
    Within a form you can use the field string SFSY with its system fields. During form processing the system replaces these fields with the corresponding values. The field values come from the SAP System or are results of the processing.
    System fields of Smart Forms
    &SFSY-DATE&
    Displays the date. You determine the display format in the user master record.
    &SFSY-TIME&
    Displays the time of day in the form HH:MM:SS.
    &SFSY-PAGE&
    Inserts the number of the current print page into the text. You determine the format of the page number (for example, Arabic, numeric) in the page node.
    &SFSY-FORMPAGES&
    Displays the total number of pages for the currently processed form. This allows you to include texts such as'Page x of y' into your output.
    &SFSY-JOBPAGES&
    Contains the total page number of all forms in the currently processed print request.
    &SFSY-WINDOWNAME&
    Contains the name of the current window (string in the Window field)
    &SFSY-PAGENAME&
    Contains the name of the current page (string in the Page field)
    &SFSY-PAGEBREAK&
    Is set to 'X' after a page break (either automatic [Page 7] or command-controlled [Page 46])
    &SFSY-MAINEND&
    Is set as soon as processing of the main window on the current page ends
    &SFSY-EXCEPTION&
    Contains the name of the raised exception. You must trigger your own exceptions, which you defined in the form interface, using the user_exception macro (syntax: user_exception <exception name >).
    Example Forms Available in Standard SAP R/3
    SF_EXAMPLE_01
    Simple example; invoice with table output of flight booking for one customer
    SF_EXAMPLE_02
    Similar to SF_EXAMPLE_01 but with subtotals
    SF_EXAMPLE_03
    Similar to SF_EXAMPLE_02, whereby several customers are selected in the application program; the form is called for each customer and all form outputs are included in an output request
    Advantages of SAP Smart Forms
    SAP Smart Forms have the following advantages:
    1. The adaption of forms is supported to a large extent by graphic tools for layout and logic, so that no programming knowledge is necessary (at least 90% of all adjustments). Therefore, power user forms can also make configurations for your business processes with data from an SAP system. Consultants are only required in special cases.
    2. Displaying table structures (dynamic framing of texts)
    3. Output of background graphics, for form design in particular the use of templates which were scanned.
    4. Colored output of texts
    5. User-friendly and integrated Form Painter for the graphical design of forms
    6. Graphical Table Painter for drawing tables
    7. Reusing Font and paragraph formats in forms (Smart Styles)
    8. Data interface in XML format (XML for Smart Forms, in short XSF)
    9. Form translation is supported by standard translation tools
    10. Flexible reuse of text modules
    11. HTML output of forms (Basis release 6.10)
    12. Interactive Web forms with input fields, pushbuttons, radio buttons, etc. (Basis-Release 6.10)

  • Please help me with the homework given to me by my teacher

    hello,i am new in java programming please help me with the home work given to me by my teacher at school, help me to build an interface that can work with this code.i can build an interface but i dont just understand this code.
    //references:
    //http://forums.techguy.org/development/570048-need-write-java-program-convert.html
    import java.util.Map;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.BufferedReader;
    import java.io.FileReader;
    public class Translate
      public static void main(String [] args) throws IOException
        if (args.length != 2)
          System.err.println("usage: Translate wordmapfile textfile");
          System.exit(1);
        try
          HashMap words = ReadHashMapFromFile(args[0]);
          System.out.println(ProcessFile(words, args[1]));
    catch (Exception e)
          e.printStackTrace();
      // static helper methods
       * Reads a file into a HashMap. The file should contain lines of the format
       *    "key\tvalue\n"
       * @returns a hashmap of the given file
      @SuppressWarnings("unchecked")
      private static HashMap ReadHashMapFromFile(String filename) throws FileNotFoundException, IOException
        BufferedReader in = null;
        HashMap map = null;
        try
          in = new BufferedReader(new FileReader(filename));
          String line;
          map = new HashMap();
          while ((line = in.readLine()) != null)
            String[] fields = line.split("\\t", 2);
            if (fields.length != 2) continue; //just ignore "invalid" lines
            map.put(fields[0], fields[1]);
    finally
          if(in!=null) in.close(); //may throw IOException
        return(map); //returning a reference to local variable is safe in java (unlike C/C++)
       * Process the given file
       * @returns String contains the whole file.
      private static String ProcessFile(Map words, String filename) throws FileNotFoundException, IOException {
        BufferedReader in = null;
        StringBuffer out = null;
        try {
          in = new BufferedReader(new FileReader(filename));
          out = new StringBuffer();
          String line = null;
          while( (line=in.readLine()) != null ) {
            out.append(SearchAndReplaceWordsInText(words, line)+"\n");
        } finally {
          if(in!=null) in.close(); //may throw IOException
        return out.toString();
       * Replaces all occurrences in text of each key in words with it's value.
       * @returns String
      private static String SearchAndReplaceWordsInText(Map words, String text) {
        Iterator it = words.keySet().iterator();
        while( it.hasNext() ) {
          String key = (String)it.next();
          text = text.replaceAll("\\b"+key+"\\b", (String)words.get(key));
        return text;
       * @returns: s with the first letter capitalized
      String capitalize(String s)
        return s.substring(0,0).toUpperCase() + s.substring(1);
    }... here's the head of my pirate_words_map.txt
    hello     ahoy
    hi     yo-ho-ho
    pardon me     avast
    excuse me     arrr
    yes     aye
    my     me
    friend     me bucko
    sir     matey
    madam     proud beauty
    miss     comely wench
    stranger     scurvy dog
    officer     foul blaggart
    where     whar
    is     be
    are     be
    am     be
    the     th'
    you     ye
    your     yer
    tell     be tellin'

    Heres your answer. Run it in on your pc.
    public class Annoy
    public static void main(String[] args)
       System.out.println("I am a triple poster.");
       System.out.println("I can not understand why I can not understand the help I have receved to date on the java forums.");
    }

  • Please help me with the digital signature validation problem?

    Please help me with the digital signature validation problem?

    Hi
    Execute the program in the Debuggin mode.
    In the Debugger Window
    Select Breakpoint -> Break point at -> Breakpoint at source code Menu Item and enter the details of the program/include/line no..
    Activate the System Debugger On from the Settings Menu.
    Hope this would help you.
    Murthy
    Edited by: Kalyanam Seetha Rama Murthy on Jul 18, 2008 7:20 AM

  • Hi Everyone...Please help me with this query...!

    Please Help me with this doubt as I am unable to understand the logic...behind this code. It's a begineer level code but I need to understand the logic so that I am able to grasp knowledge. Thank you all for being supportive. Please help me.
    //Assume class Demo is inherited from class SuperDemo...in other words class Demo extends SuperDemo
    //Volume is a method declared in SuperDemo which returns an integer value
    //weight is an integer vairable declared in the subclass which is Demo
    class Example
         public static void main(String qw[])
              Demo ob1=new Demo(3,5,7,9);
    //Calling Constructor of Demo which takes in 4 int parameters
              SuperDemo ob2=new SuperDemo();
              int vol;
              vol=ob1.volume();
              System.out.println("Volume of ob1 is " + vol);
              System.out.println("Weight of ob1 is " + ob1.weight);
              System.out.println();
              ob2=ob1;
    }Can someone please make me understand --- how is this possible and why !
    If the above statement is valid then why not this one "System.out.println(ob2.weight);"
    Thanks Thanks Thanks!

    u see the line wherein I am referencing the objectof
    a subclass to the superclass...right? then why we
    can't do System.out.println(ob2.weight)?You need to distinguish two things:
    - the type of the object, which determines with the
    object can do
    - the type of the reference to the object, which
    determines what you see that you can do
    Both don't necessarily have to match. When you use a
    SuperDemo reference (obj2) to access a Demo instance
    (obj1), for all you know, the instance behind obj2 is
    of type SuperDemo. That it's in reality of type Demo
    is unknown to you. And usually, you don't care -
    that's what polymorphism is about.
    So you have a reference obj2 of type SuperDemo.
    SuperDemo objects don't have weight, so you don't see
    it - even though it is there.So from ur explanation wat I understand is - Even though u reference a subclass object to a superclass, u will only be able to access the members which are declared in the superclass thru the same...right
    ?

  • Please help me with simple program

    Can someone please write a simple program for me that opens up a webpage in the center of the screen , with a set size, and then asks the user where they would like to click on the screen. Then once the person clicks it asks how many times they would like to click there, and then once they enter the # the program opens up the webpage (in the center at the same spot as before, with the same set size) and automatically clicks on the predesignated spot , and then closes all open internet windows, and keeps doing it for however many times the person chose. PLEASE HELP ME WITH THIS!!! If you could, please post the source code here. Thank you so much to whoever helps me!!!!!!!

    If it's not to learn, then what is the purpose of
    this project?well, if it's not HW and its not for learning java, then why the hell would anyone like to have a program that may open a webpage and then repeatedly click on predefined place...
    let me see...
    now if he had asked for program that fakes IP as well, then i would suggest that he tryes to generate unique clicks, but now... i'm not sure... maybe just voting in some polls or smthing... though, i would not create a program that clicks on the link or form element, but rather just reload url with given parameters for N times...

Maybe you are looking for

  • Help with getting button color.

    I'm trying to make a little paint program. i want to be able to click on a color button and then assign the color of that button to a variable Color brushColor. funny thing is, when i compile this, it tells me that C:\java\javaprograms\TryPainting.ja

  • GUI_DOWNLOAD - Column Width

    Hi all, I have a requirement to use gui download but im having problem in its column width, i want the excel to have a column width same as the title of the column, is this possible (to have different column width in the output excel file) Thanks.

  • NAC AGENT - DISCOVERY HOST IP ADDRESS with AD

    Hi, We have deployed a Cisco NAC Agent in our network with GPO update... The deployment model is L3 OOB / Real IP Gateway. The issue is that, we need to put the IP address in each host manually to start communicating with Cisco NAC Manager. Is there

  • Import statements cannot be resolved

    I couldnt able to import the following statements, import javax.ejb.EntityBean; import javax.ejb.CreateException; import weblogic.ejb.GenericEntityBean; import weblogic.ejbgen.;* Do we need to set any properties.. I have set the classpath,path .. but

  • How can i istall the photocd plugin of photoshop CS3 to photoshop cs4 under windows7?

    How can i istall the photocd plugin of photoshop CS3 to photoshop cs4 under windows7? i had no problem to install under windows XP, but i do not know how and where to install the windows profiles and i am not sure, if i habe just ro move the .8bi fil