GregorianCalendar Issue

Hi,
In the process of finding the difference between two dates, I am encountering a problem where one of the dates when converted to GregorianCalendar always prints a -ve value. Would you have any hints as to why would that would be?
     String fmt = "MM-dd-yyyy HH:mm:ss";
     SimpleDateFormat df = new SimpleDateFormat(fmt);
     Date expires = null;
try
expires = df.parse(endTime);
catch (ParseException pe)
pe.printStackTrace();
GregorianCalendar gexpires = new GregorianCalendar();
gexpires.setTime(expires);
GregorianCalendar rightNow = new GregorianCalendar();
long exp_millies = gexpires.getTimeInMillis();
long now_millies = rightNow.getTimeInMillis();
exp_millis is always -ve, even though I am parsing the future date from an xml string.
Just wondering where I am going wrong!! Thanks
M

What's the string you're passing for the date?
Zero is Jan. 1, 1970, 00:00:00.000 GMT. Any dates prior to that are negative.

Similar Messages

  • Issue with GregorianCalendar class

    Hi I'm having issues with the GregorianCalender class. I am trying to enable daylight savings time but it doesn't seem to be working properly for. As a test I have taken the difference of time (in milliseconds) between a date where daylight savings causes a shift in time (April 4, 2004 for example). The two sample dates I have chosen are April 5, 2004 and April 4, 2004, ideally the time difference should be 23 hrs (since one hour is lost due to daylight savings) but I am getting 24hrs. I have a sample program in C++ which gives me the correct answer so I know the result am I getting here is wrong. Anybody have any suggestions?
    String[] ids = TimeZone.getAvailableIDs(-8 * 60 * 60 * 1000);
         if (ids.length == 0)
         System.exit(0);
         // create a Pacific Standard Time time zone
         SimpleTimeZone pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids[0]);
         // set up rules for daylight savings time
         pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 60 * 60 * 1000, true);
         pdt.setEndRule(Calendar.OCTOBER, 31, Calendar.SUNDAY, 60 * 60 * 1000, false);
         pdt.setDSTSavings( 60*60*1000 );
         GregorianCalendar cal = new GregorianCalendar(2004, 4, 4);
         GregorianCalendar cal1 = new GregorianCalendar(2007, 4, 5);
         cal1.setTimeZone ( pdt );
         cal.setTimeZone( pdt );
    //This values is incorrect
         long diff = cal1.getTimeInMillis() - cal.getTimeInMillis();     
    //I have also tried the following
    String[] ids = TimeZone.getAvailableIDs(-8 * 60 * 60 * 1000);
         if (ids.length == 0)
         System.exit(0);
         // create a Pacific Standard Time time zone
         SimpleTimeZone pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids[0]);
         // set up rules for daylight savings time
         pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 60 * 60 * 1000, true);
         pdt.setEndRule(Calendar.OCTOBER, 31, Calendar.SUNDAY, 60 * 60 * 1000, false);
         pdt.setDSTSavings( 60*60*1000 );
         GregorianCalendar cal = new GregorianCalendar(pdt);
         GregorianCalendar cal1 = new GregorianCalendar(pdt);
         cal1.set(2004, 4, 5 );
         cal.set( 2004, 4, 4 );
    //This values is incorrect
         long diff = cal1.getTimeInMillis() - cal.getTimeInMillis();     
    Thanks

    There may be any of several issues:
    Daylight savings time moves from year to year. Maybe last year, it was not on the same week number.
    Daylight savings time officially occurs at 2am. Java date's default to midnight if explicitly initialized. So, try calculating from after 2-3 am, depending on which way time was shifted.- Saish
    "My karma ran over your dogma." - Anon

  • Issue with a resultSet.wasNull() method

    Hello all
    I'm having a small issue with a resultset, basically i wanna test if it returns a null value but it does not seems to work.
    Its a simple application that pulls football matches data out of a database base on the provided data.
    This is my code, i would like to first say that, connectivity works fine, database existing, tables existing, if correct data's are inserted the application fetches the data with no problem.
    public void getMatch(GregorianCalendar cal){
    java.sql.Date sqlDate= new java.sql.Date(cal.getTimeInMillis());
    try{
    String resultMatch="SELECT resultMatch FROM matches WHERE date=?";
    PreparedStatement pre=connection.prepareStatement(resultMatch);
    pre.setDate(1,sqlDate);
    ResultSet resMatch=pre.executeQuery();
    if(resMatch.wasNull()){
    System.out.println("No data found");
    } else {
    System.out.println("Show all datas");
    }//rest of code
    } catch(SQLException e){
    }//rest of code
    the problem arises now, if i enter a data that its in the DB, its fine, all data's are pulled out and printed (via while(resMatch.next()........))
    If i enter a non existing data....nothing comes out, not even an exception.
    Any advice?
    Thx

    enrico wrote:
    This is my code, i would like to first say that, connectivity works fine, database existing, tables existing, if correct data's are inserted the application fetches the data with no problem.The code posted does not do that.
    >
    public void getMatch(GregorianCalendar cal){
    java.sql.Date sqlDate= new java.sql.Date(cal.getTimeInMillis());
    try{
         String resultMatch="SELECT resultMatch FROM matches WHERE date=?";
         PreparedStatement pre=connection.prepareStatement(resultMatch);
    pre.setDate(1,sqlDate);
         ResultSet resMatch=pre.executeQuery();
    if(resMatch.wasNull()){There is no way that the above code returns 'data' from the database.
    A result set represents a collection of zero or more rows.
    One must first retrieve a row before doing anything with it.
    The above code does not call next() so it absolutely does not retrieve any rows.
    The JDBC tutorial might help.
    http://download.oracle.com/javase/tutorial/jdbc/basics/

  • Mapping issue - transformdate mapping function - urgent

    all,
    payload has date as "000000000" the mapping function transformdate is changing to 0002XXXXX.
    y is this so?
    we are on sp 18 of xi 3.0.
    Did anyone face this issue
    Please respond.
    reg

    dont worry
    it is because in the datetrans function advanced properties, you have selected the option of a <b>Calendar is linient</b> and in any case the result, <b>it is a bug</b>
    <i>When a Calendar is lenient, it accepts a wider range of field values than it produces. For example, a lenient GregorianCalendar interprets MONTH == JANUARY, DAY_OF_MONTH == 32 as February 1. A non-lenient GregorianCalendar throws an exception when given out-of-range field settings. When calendars recompute field values for return by get(), they normalize them. For example, a GregorianCalendar always produces DAY_OF_MONTH  values between 1 and the length of the month.</i>
    Message was edited by:
            Shabarish Vijayakumar

  • SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first

    Hello, I was trying to send mails via GMail's smtp server (smtp.gmail.com) but the following exception occurred. I used port 25 (used 467 also, didnt work). Would anybody tell what the following exception mean. Thanx.
    com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command firstHere's my code:
    import javax.mail.*;
    import javax.mail.event.TransportListener;
    import javax.mail.event.TransportEvent;
    import javax.mail.internet.*;
    import java.util.Properties;
    import javax.activation.*;
    class MailSender {
         private String mailHost="smtp.gmail.com";
         private String body;
         private String myFile="F:\\DRacing.avi";
         private Properties props;
         private Session mailSession;
         private MimeMessage message;
         private InternetAddress sender;
         private Multipart mailBody;
         private MimeBodyPart mainBody;
         private MimeBodyPart mimeAttach;
         private DataSource fds;
         MailSender()
              //Creating a Session
              props=new Properties();
                        props.put("mail.transport.protocol", "smtp");
              props.put("mail.smtp.host", mailHost);
              props.put("mail.smtp.port", "25");
              props.put("mail.smtp.auth", "true");
              mailSession=Session.getDefaultInstance(props, new MyAuthenticator());
              //Constructing and Sending a Message
              try
                   //Starting a new Message
                   message=new MimeMessage(mailSession);
                   mailBody=new MimeMultipart();
                   //Setting the Sender and Recipients
                   sender=new InternetAddress("[email protected]", "Kayes");
                   message.setFrom(sender);
                   InternetAddress[] toList={new InternetAddress("[email protected]")};
                   message.setRecipients(Message.RecipientType.TO, toList);
                   //Setting the Subject and Headers
                   message.setSubject("My first JavaMail program");
                   //Setting the Message body
                   body="Hello!";
                   mainBody=new MimeBodyPart();
                   mainBody.setDataHandler(new DataHandler(body, "text/plain"));
                   mailBody.addBodyPart(mainBody);
                   //Adding a single attachment
                   fds=new FileDataSource(myFile);
                   mimeAttach=new MimeBodyPart();
                   mimeAttach.setDataHandler(new DataHandler(fds));
                   mimeAttach.setFileName(fds.getName());
                   mailBody.addBodyPart(mimeAttach);
                   message.setContent(mailBody);
                                  Transport.send(message);
              catch(java.io.UnsupportedEncodingException e)
                   System.out.println(e);
              catch(MessagingException e)
                   System.out.println(e);
              catch(IllegalStateException e)
                   System.out.println(e);
    public class TestMail01
         public static void main(String args[])
              new MailSender();
    class MyAuthenticator extends Authenticator
         MyAuthenticator()
              super();
         protected PasswordAuthentication getPasswordAuthentication()
              return new PasswordAuthentication("dider7", "MY_PASSWORD");
    }

    This is an application that sends a message but there is a problem the domain could not be resolved
    * Notifier.java
    * Created on March 23, 2006, 11:22 AM
    * To change this template, choose Tools | Options and locate the template under
    * the Source Creation and Management node. Right-click the template and choose
    * Open. You can then make changes to the template in the Source Editor.
    * @author Trainee
    import java.util.*;
    import java.sql.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.io.*;
    import java.net.InetAddress;
    import java.util.Properties;
    import java.util.Date;
    public class Notifier //throws MessagingException
    public static void main(String args[]) //throws Exception
    //SystemTray.getDefaultSystemTray().addTrayIcon(new TrayIcon(new ImageIcon("imagefilename")));
    // starts time getter
    NotifierThread NThread = new NotifierThread();
    Thread t = new Thread(NThread);
    t.start();
    //email module
    //EmailThread emailThread = new EmailThread();
    //emailThread.sendMessage();
    /*SimpleSender simple = new SimpleSender();
    simple.senderClassKo();*/
    //String[] arrayKo = { "[email protected]","def","xyz" };
    //String[] arrayKo = { "[email protected]","def","xyz" };
    //String recipients = "[email protected]";
    /*EmailThread EThread = new EmailThread();
    try
    // ( String recipients[ ], String subject, String message , String from)
    EThread.postMail( "[email protected]" , "NOTIFY", "ContractOverdue" , "[email protected]");
    System.out.println("ethread");
    catch(MessagingException me)
    me.printStackTrace();
    //DBConnection dbc = new DBConnection();
    //dbc.DBConnect();
    String host = "smtp.gmail.com";
    String from = "[email protected]";
    //String to = "[email protected]";
    String to = "[email protected]";
    // Get system properties
    Properties props = System.getProperties();
    // Setup mail server
    props.put("mail.smtp.host", host);
    props.put("mail.smtp.starttls.enable", "true");
    props.put("mail.smtp.auth", "true");
    // Get session
    Authenticator auth = new MyAuthenticator();
    Session session = Session.getDefaultInstance(props, auth);
    // Define message
    MimeMessage message = new MimeMessage(session);
    message.setFrom(new InternetAddress(from));
    message.addRecipient(Message.RecipientType.TO,
    new InternetAddress(to));
    message.setSubject("Hello JavaMail");
    message.setText("Welcome to JavaMail");
    // Send message
    //com.sun.mail.smtp.SMTPSSLTransport.send(message);
    Transport.send(message);*/
    class DBConnection
    static String[] email2 = new String[10];
    static int ctr = 0;
    static String ctrlno = "";
    public void DBConnect()
    Connection connection = null;
    Statement statement = null;
    ResultSet rs = null;
    try
    Class.forName("org.postgresql.Driver");
    connection = DriverManager.getConnection("jdbc:postgresql:cms", "postgres", "password");
    statement = connection.createStatement();
    String ctrlno2 = "ctrlno1";
    String sql = "SELECT (expiredate - CURRENT_DATE) as no_days, cms_trans_contract.ctrlno, cms_trans_contract_notify.notifyid, ofc_employee.email, notify1, notify2, notify3 from" +
    " cms_trans_contract, cms_trans_contract_notify, ofc_employee where" +
    " cms_trans_contract.ctrlno = cms_trans_contract_notify.ctrlno and cms_trans_contract_notify.notifyid = ofc_employee.idnum";
    //where ctrlno = " + "'"+ctrlno2+"'";
    //"select expiredate from cms_trans_contract";
    //wherer ctrlno = " + "'"+ctrlno2+"'";
    //SELECT (CURRENT_DATE - expiredate) as no_days from cms_trans_contract
    sql += "where startdate between '";
    sql += request.getParameter("commenceStartDate") + "' and '"
    sql += request.getParameter("commenceEndDate") + "'";
    sql += "and expiredate between '";
    sql += request.getParameter("expireStartDate") + "' and '"
    sql += request.getParameter("expireEndDate") + "'";
    rs = statement.executeQuery(sql);
    //System.out.println("rs: " + rs.next());
    while (rs.next())
    //System.out.println("Record Found");
    String firstname = "";
    String lastname = "";
    String notifyid = "";
    String email = "";
    int notify1;
    int notify2;
    int notify3;
    //Date expiredate;
    int subtracted_date;
    //firstname = (rs.getString(1));
    subtracted_date = (rs.getInt(1));
    ctrlno = (rs.getString(2));
    notifyid = (rs.getString(3));
    //email = (rs.getString(4));
    email2[ctr] = (rs.getString(4));
    notify1 = (rs.getInt(5));
    notify2 = (rs.getInt(6));
    notify3 = (rs.getInt(7));
    //lastname = (rs.getString(2));
    //out.println(contract.getCtrlno());
    //System.out.println("FIRSTNAME: " + firstname);
    //System.out.println("LASTNAME: " + lastname);
    //System.out.println("Expiredate: " + expiredate);
    //System.out.println("Ctrlno: " + ctrlno);
    System.out.println("SUB: " + subtracted_date);
    //System.out.println("sql: " + sql);
    if((((subtracted_date == notify1) || (subtracted_date == notify2)) || (subtracted_date == notify3)) && (subtracted_date > 0))
    System.out.println("CtrlnoGET: " + ctrlno);
    System.out.println("NotifyID: " + notifyid);
    //System.out.println("email " + email);
    System.out.println("EmailCTR: " + ctr +": " + email2[ctr]);
    System.out.println("notify1: " + notify1);
    System.out.println("notify2: " + notify2);
    System.out.println("notify3: " + notify3);
    EmailThread emailThread = new EmailThread();
    emailThread.sendMessage(DBConnection.email2, DBConnection.ctrlno);
    //ctr++;
    ctr++;
    if (rs.next() == false)
    System.out.println("No records found");
    catch (Exception ex)
    ex.printStackTrace();
    System.out.println("Error getting connections");
    finally
    try
    if (rs != null)
    rs.close();
    if (statement != null)
    statement.close();
    if (connection != null)
    connection.close();
    catch (Exception ex)
    ex.printStackTrace();
    System.out.println("Error closing connections");
    // time getter module
    class NotifierThread implements Runnable
    public void run()
    while (true)
    Calendar cal = new GregorianCalendar();
    int hour12 = cal.get(Calendar.HOUR); // Range 0..11
    //int hour24 = cal.get(Calendar.HOUR_OF_DAY); // Range 0..23
    int min = cal.get(Calendar.MINUTE); // Range 0..59
    int sec = cal.get(Calendar.SECOND); // Range 0..59
    //int ms = cal.get(Calendar.MILLISECOND); // Range 0..999
    int ampm = cal.get(Calendar.AM_PM); // Range 0=AM, 1=PM
    String am_pm = "";
    if(ampm == 0)
    am_pm = "AM";
    else
    am_pm = "PM";
    System.out.println("Time " + hour12 + ":" + min + ":" + sec + " " + am_pm);
    if(sec == 10)
    System.out.println("YIPEE");
    //EmailThread emailThread = new EmailThread();
    //emailThread.sendMessage(DBConnection.email2);
    DBConnection dbc = new DBConnection();
    dbc.DBConnect();
    try
    Thread.sleep(1000);
    catch(Exception e)
    e.printStackTrace();
    class SimpleSender
    * Main method to send a message given on the command line.
    /*public void senderClassKo()
    try
    //String smtpServer="mail.kiksbalayon.com";
    String smtpServer="localhost";
    String to="[email protected]";
    String from="[email protected]";
    String subject="hello";
    String body="sa wakas ng send din";
    send(smtpServer, to, from, subject, body);
    catch (Exception ex)
    //System.out.println("Usage: java com.lotontech.mail.SimpleSender"
    //+" smtpServer toAddress fromAddress subjectText bodyText");
    System.exit(0);
    /*public static void send(String smtpServer, String to, String from, String subject, String body)
    try
    Properties props = System.getProperties();
    // -- Attaching to default Session, or we could start a new one --
    props.put("mail.smtp.host", smtpServer);
    Session session = Session.getDefaultInstance(props, null);
    // -- Create a new message --
    Message msg = new MimeMessage(session);
    // -- Set the FROM and TO fields --
    msg.setFrom(new InternetAddress(from));
    msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to, false));
    // -- We could include CC recipients too --
    // if (cc != null)
    // msg.setRecipients(Message.RecipientType.CC
    // ,InternetAddress.parse(cc, false));
    // -- Set the subject and body text --
    msg.setSubject(subject);
    msg.setText(body);
    // -- Set some other header information --
    //msg.setHeader("X-Mailer", "LOTONtechEmail");
    msg.setSentDate(new Date());
    // -- Send the message --
    Transport.send(msg);
    System.out.println("Message sent OK.");
    catch (Exception ex)
    ex.printStackTrace();
    //Authentication module
    class MyAuthenticator extends Authenticator
    MyAuthenticator()
    super();
    //protected PasswordAuthentication getPasswordAuthentication()
    public PasswordAuthentication getPasswordAuthentication()
    return new PasswordAuthentication("johann108", "password");
    // email module
    class EmailThread //throws MessagingException
    public void sendMessage(String toEmail[], String ctrlno) //throws MessagingException
    try
    String host = "localhost";
    //String host = "mail.philweb.com";
    //String from = "[email protected]";
    String from = "[email protected]";
    //String[] to = toEmail;
    //"[email protected]";
    // Get system properties
    Properties props = System.getProperties();
    // Setup mail server
    props.put("mail.smtp.starttls.enable","true");
    props.put("mail.smtp.host", host);
    props.put("mail.smtp.auth", "true");
    // Get session
    Authenticator auth = new MyAuthenticator();
    Session session = Session.getDefaultInstance(props, auth);
    boolean debug = true;
    session.setDebug(debug);
    // Define message
    MimeMessage message = new MimeMessage(session);
    message.setFrom(new InternetAddress(from));
    InternetAddress[] to = new InternetAddress[DBConnection.ctr];
    for (int i = 0; i < DBConnection.ctr; i++)
    to[i] = new InternetAddress(toEmail);
    //System.out.println("EMAILTO:" + to[i]);
    message.setRecipients(Message.RecipientType.TO, to);
    //message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
    message.setSubject("Contract Expiry");
    message.setText(
    "Contract is about to expire\n" +
    " ContractNumber is " + DBConnection.ctrlno
    // Send message
    Transport.send(message);
    catch(Exception me)
    me.printStackTrace();
    System.out.println("Error in Sending Message");

  • Issue with Scanning Files...

    So I have a program that scans a file and does a bunch of stuff with it...I won't go into details too much, as it's not relevant.
    Basically, if the file didn't exist, it would return an error message. If the file existed, but the input inside the file wasn't formatted properly, it would return a different error message for each possible issue. I've done all that. But now I have a file that I know is in the workspace, properly formatted, but when i call it in the console, it claims I have an invalid file name. That is, the error that I get if the file doesn't exist. I think it's an issue buried deep into my code, and it's driving me crazy.
    import java.util.*;
    import java.text.*;
    import java.io.*;
    public class AssignmentFive_3 {
         private static void Todaysdate() {
              SimpleDateFormat BartDateFormat =
                   new SimpleDateFormat("MM/dd/yy");
              Date today = new Date();
              System.out.println(BartDateFormat.format(today));
         public static void main(String[] args) {
              Todaysdate();
              Scanner sc1 = new Scanner(System.in);
              System.out.print("Please Enter a file name to be read: ");
              String filename = sc1.next();
              filename = ""+filename+".txt";
              int filelines=0;
              try {Scanner sc2 = new Scanner(new File (filename));
         while (sc2.hasNextLine()) {filelines++;
         String info = sc2.next();
         String name = sc2.next();
         String lname = sc2.next();
         String wage = sc2.next();
         String dependents = sc2.next();
         String deduct = sc2.next();
         String day1 = sc2.next();
         String day2 = sc2.next();
         String day3 = sc2.next();
         String day4 = sc2.next();
         String day5 = sc2.next();     
         Boolean error = false;
         Date date2 = new Date();
         String newDate = new String();
         try {SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd/yy");
         Date date1 = simpleDateFormat.parse(info);
         Calendar calendar = new GregorianCalendar();
         calendar.setTime(date1);
         calendar.add(Calendar.DAY_OF_MONTH,5);
         date2 = calendar.getTime();
         newDate = simpleDateFormat.format(date2);
         } catch (ParseException F) {System.out.println("Reformat your date and try again."); error = true;}
         int one = name.indexOf('0');
         int two = name.indexOf('1');
         int three = name.indexOf('2');
         int four = name.indexOf('3');
         int five = name.indexOf('4');
         int six = name.indexOf('5');
         int seven = name.indexOf('6');
         int eight = name.indexOf('7');
         int nine = name.indexOf('8');
         int zero = name.indexOf('9');
         int one1 = lname.indexOf('0');
         int two2 = lname.indexOf('1');
         int three3 = lname.indexOf('2');
         int four4 = lname.indexOf('3');
         int five5 = lname.indexOf('4');
         int six6 = lname.indexOf('5');
         int seven7 = lname.indexOf('6');
         int eight8 = lname.indexOf('7');
         int nine9 = lname.indexOf('8');
         int zero0 = lname.indexOf('9');
         if (one > 0 || two > 0 || three > 0 || four > 0 || five > 0 || six > 0 || seven > 0 || eight > 0 || nine > 0 || zero > 0 || one1 > 0 || two2 > 0 || three3 > 0 || four4 > 0 || five5 > 0 || six6 > 0 || seven7 > 0 || eight8 > 0 || nine9 > 0 || zero0 > 0)
         {System.out.println("Aliens might have integers in their name...but we don't employ aliens! Fix your name."); error = true;}
         double hours1 = new Double(day1).intValue();
         double hours2 = new Double(day2).intValue();
         double hours3 = new Double(day3).intValue();
         double hours4 = new Double(day4).intValue();
         double hours5 = new Double(day5).intValue();
         double money = new Double(wage).intValue();
         double depend = new Double(dependents).intValue();
         double deducts = new Double(deduct).intValue();
         if (money < 7) {System.out.println("Don't be ridiculous! We wouldn't dare pay less than minimum wage. Fix your wage."); error = true;}
         if (money > 100) {System.out.println("Who do you think you are? Thor? Short of you being a mythical norse god, we don't pay that much per hour. Fix your wage"); error = true;}
         if (depend < 0) {System.out.println("It's wonderful you're so independent...but I doubt you're THAT independent. Fix your dependents."); error = true;}
         if (deducts < 0) {System.out.println("You really might want to think about your retirement...at least don't take money OUT of it. Fix your pre-tax retirement deduction."); error = true;}
         if (hours1 < 0) {System.out.println("Maybe you're lazy, but give yourself a bit more credit! Fix your hours for day one."); error = true;}
         if (hours2 < 0) {System.out.println("Maybe you're lazy, but give yourself a bit more credit! Fix your hours for day two."); error = true;}
         if (hours3 < 0) {System.out.println("Maybe you're lazy, but give yourself a bit more credit! Fix your hours for day three."); error = true;}
         if (hours4 < 0) {System.out.println("Maybe you're lazy, but give yourself a bit more credit! Fix your hours for day four."); error = true;}
         if (hours5 < 0) {System.out.println("Maybe you're lazy, but give yourself a bit more credit! Fix your hours for day five."); error = true;}
         if (hours1 > 12) {System.out.println("This company won't look kindly on sneaking into the office after-hours. Even if it is to work. Fix your hours for day one."); error = true;}
         if (hours2 > 12) {System.out.println("This company won't look kindly on sneaking into the office after-hours. Even if it is to work. Fix your hours for day two."); error = true;}
         if (hours3 > 12) {System.out.println("This company won't look kindly on sneaking into the office after-hours. Even if it is to work. Fix your hours for day three."); error = true;}
         if (hours4 > 12) {System.out.println("This company won't look kindly on sneaking into the office after-hours. Even if it is to work. Fix your hours for day four."); error = true;}
         if (hours5 > 12) {System.out.println("This company won't look kindly on sneaking into the office after-hours. Even if it is to work. Fix your hours for day five."); error = true;}
         double hours = (hours1 + hours2 + hours3 + hours4 + hours5);
         double pay1 = ((hours) * (money));
         double overhours = (hours-40);
         while (overhours < 0) {overhours = 0;}
         double overpay = (overhours*(money*.5));
         double grosspay = (pay1 + overpay);
         double pay = (grosspay) - (100 + (50*depend));
         double taxincome = (pay - deducts);
         while (taxincome < 0) {taxincome = 0;}
         double taxcharge = (((.18 - (.02*depend))*taxincome));
         while (taxcharge < 0) {taxcharge = 0;}
         double paycheck = (taxincome - taxcharge);
         while (paycheck < 0) {paycheck = 0;}
         DecimalFormat format = new DecimalFormat("0.00");
         String paycheckprint = (format.format(paycheck) + " ");          
         int numby = 0;
         if (error = false) {
              while (filelines > numby)
         System.out.println("Pay to the order of " +name+ " " +lname+ ": " +paycheckprint+ "");
         System.out.println("Memo: employee #" + numby + " for the period " +info+ " through " +newDate+ "");
         numby++;
              } catch (Exception E) {System.out.println("Invalid file. Try again.");}     
    }

    morgalr wrote:
    flounder wrote:
    morgalr wrote:
    without thinking.Which is in my experience is the biggest problem with uni students, they just don't think.I think you have to put more into that category than just uni students--beginners and casual users in general, but as far as uni students, I've found grad students are by far worse than any of the undergrads. To get a degree in CS at the uni I went to (ages ago) each student had to do a block of "consulting", basically fielding any and all questions in the computer lab, for an entire semester. Undergrades you cold reason with, but "most" or the grad stufents that came, already knew "No under grad could ever help them." It was humorous to see these guys' project dying on the most simple errors and they couldn't get it through their head what it was. I saw one guy fish through his core dump for 2+ weeks to verify exactly what one of the student consultants told him after looking at his code for 30 seconds: he refused to beleive that was the problem, would not ever consider it to try and then changed labs after he found it was just that simple.Amen to that.
    IMHO, there should be two default units in any CS degree- Problem Solving 101 and How To Debug 101. Not only would it solve half the problems on here (and in life) before they come up, it makes you less dependent on any one language.
    I'm the first to admit that I have been guilty of, and will probably be guilty of in the future, bad debugging and/or problem solving practices. But I'll learn through experience to approach them better. If I'd been taught those at university, then I'd be a much more powerful programmer than I currently am.

  • Editable JComboBox in JTable focus issue

    Please look at the sample code below.
    I am using a JComboBox as the editor for a column in the table. When a cell in that column is edited and the user presses enter, the cell is no longer in edit mode. However, the focus is now set on the next component in the scrollpane (which is a textfield).
    If I don't add the textfield and the the table is the only component in the scroll pane, then focus correctly remains on the selected cell.
    When the user exits edit mode, I'd like the table to have focus and for the cell to remain selected. How can I achieve this?
    thanks,
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    import javax.swing.plaf.basic.*;
    import java.awt.Component;
    import javax.swing.JComboBox;
    import java.util.EventObject;
    import java.awt.event.*;
    import javax.swing.event.*;
    public class TableComboBoxTest extends JFrame {
         protected JTable table;
         public TableComboBoxTest() {
              Container pane = getContentPane();
              pane.setLayout(new BorderLayout());
              MyTableModel model = new MyTableModel();
              table = new JTable(model);
              table.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
              table.setSurrendersFocusOnKeystroke(true);
              TableColumnModel tcm = table.getColumnModel();
              TableColumn tc = tcm.getColumn(MyTableModel.GENDER);
              tc.setCellEditor(new MyGenderEditor(new JComboBox()));
              tc.setCellRenderer(new MyGenderRenderer());
              JScrollPane jsp = new JScrollPane(table);
              pane.add(jsp, BorderLayout.CENTER);          
              pane.add(new JTextField("focus goes here"), BorderLayout.SOUTH);
         public static void main(String[] args) {
              TableComboBoxTest frame = new TableComboBoxTest();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setSize(500, 300);
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
         public class MyTableModel extends AbstractTableModel {
              public final static int FIRST_NAME = 0;
              public final static int LAST_NAME = 1;
              public final static int DATE_OF_BIRTH = 2;
              public final static int ACCOUNT_BALANCE = 3;
              public final static int GENDER = 4;
              public final static boolean GENDER_MALE = true;
              public final static boolean GENDER_FEMALE = false;
              public final String[] columnNames = {
                   "First Name", "Last Name", "Date of Birth", "Account Balance", "Gender"
              public Object[][] values = {
                        "Clay", "Ashworth",
                        new GregorianCalendar(1962, Calendar.FEBRUARY, 20).getTime(),
                        new Float(12345.67), "three"
                        "Jacob", "Ashworth",
                        new GregorianCalendar(1987, Calendar.JANUARY, 6).getTime(),
                        new Float(23456.78), "three1"
                        "Jordan", "Ashworth",
                        new GregorianCalendar(1989, Calendar.AUGUST, 31).getTime(),
                        new Float(34567.89), "three2"
                        "Evelyn", "Kirk",
                        new GregorianCalendar(1945, Calendar.JANUARY, 16).getTime(),
                        new Float(-456.70), "One"
                        "Belle", "Spyres",
                        new GregorianCalendar(1907, Calendar.AUGUST, 2).getTime(),
                        new Float(567.00), "two"
              public int getRowCount() {
                   return values.length;
              public int getColumnCount() {
                   return values[0].length;
              public Object getValueAt(int row, int column) {
                   return values[row][column];
              public void setValueAt(Object aValue, int r, int c) {
                   values[r][c] = aValue;
              public String getColumnName(int column) {
                   return columnNames[column];
              public boolean isCellEditable(int r, int c) {
                   return c == GENDER;
         public class MyComboUI extends BasicComboBoxUI {
              public JList getList()
                   return listBox;
         public class MyGenderRenderer extends DefaultTableCellRenderer{
              public MyGenderRenderer() {
                   super();
              public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
                        boolean hasFocus, int row, int column) {
                   JComboBox box = new JComboBox();
                   box.addItem(value);
                   return box;
         public class MyGenderEditor extends DefaultCellEditor  { // implements CaretListener {
              protected EventListenerList listenerList = new EventListenerList();
              protected ChangeEvent changeEvent = new ChangeEvent(this);
              private JTextField comboBoxEditorTField;
              Object newValue;
              JComboBox _cbox;
              public MyGenderEditor(JComboBox cbox) {
                   super(cbox);
                   _cbox = cbox;
                   comboBoxEditorTField = (JTextField)_cbox.getEditor().getEditorComponent();
                   _cbox.addItem("three");
                   _cbox.addItem("three1");
                   _cbox.addItem("three2");
                   _cbox.addItem("One");
                   _cbox.addItem("two");
                   _cbox.setEditable(true);
                   _cbox.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent event) {
                             System.out.println("\nactionPerformed ");
                             fireEditingStopped();
              public void addCellEditorListener(CellEditorListener listener) {
                   listenerList.add(CellEditorListener.class, listener);
              public void removeCellEditorListener(CellEditorListener listener) {
                   listenerList.remove(CellEditorListener.class, listener);
              protected void fireEditingStopped() {
                   System.out.println("fireEditingStopped called ");
                   CellEditorListener listener;
                   Object[] listeners = listenerList.getListenerList();
                   for (int i = 0; i < listeners.length; i++) {
                        if (listeners[i] instanceof CellEditorListener) {
                             System.out.println("calling editingStopped on listener....................");                    
                             listener = (CellEditorListener) listeners;
                             listener.editingStopped(changeEvent);
              protected void fireEditingCanceled() {
                   System.out.println("fireEditingCanceled called ");
                   CellEditorListener listener;
                   Object[] listeners = listenerList.getListenerList();
                   for (int i = 0; i < listeners.length; i++) {
                        if (listeners[i] instanceof CellEditorListener) {
                             listener = (CellEditorListener) listeners[i];
                             listener.editingCanceled(changeEvent);
              public void cancelCellEditing() {
                   System.out.println("cancelCellEditing called ");
                   fireEditingCanceled();
              public void addNewItemToComboBox() {
                   System.out.println("\naddNewItemToComboBox called ");
                   // tc - start
                   String text = comboBoxEditorTField.getText();
                   System.out.println("text = "+text);                    
                   int index = -1;
                   for (int i = 0; i < _cbox.getItemCount(); i++)
                        String item = ((String)_cbox.getItemAt(i));
                        System.out.println("item in cbox = "+item);
                        if (item.equals(text))
                             System.out.println("selecting item now...");                              
                             index = i;
                             _cbox.setSelectedIndex(index);
                             break;
                   if (index == -1)
                        _cbox.addItem(text);
                        int count = _cbox.getItemCount();
                        _cbox.setSelectedIndex(count -1);
              public boolean stopCellEditing() {
                   System.out.println("stopCellEditing called ");
                   fireEditingStopped();
                   _cbox.transferFocus();
                   return true;
              public boolean isCellEditable(EventObject event) {
                   return true;     
              public boolean shouldSelectCell(EventObject event) {
                   return true;
              public Object getCellEditorValue() {
                   System.out.println("- getCellEditorValue called returning val: "+_cbox.getSelectedItem());
                   return _cbox.getSelectedItem();
              public Component getTableCellEditorComponent(JTable table, Object value,
                        boolean isSelected, int row, int column) {
                   System.out.println("\ngetTableCellEditorComponent "+value);
                   String text = (String)value;               
                   for (int i = 0; i < _cbox.getItemCount(); i++)
                        String item = ((String)_cbox.getItemAt(i));
                        System.out.println("item in box "+item);
                        if (item.equals(text))
                             System.out.println("selecting item now...");     
                             _cbox.setSelectedIndex(i);
                             break;
                   return _cbox;

    I was using java 1.5.0_06 in my application and I had this problem
    When I upgraded to java 1.6.0_01, I no longer had this issue.
    This seems to be a bug in 1.5 version of Java that has been fixed in 1.6
    thanks,

  • New DVR Issues (First Run, Channel Switching, etc.)

    I've spent the last 30 minutes trying to find answers through the search with no luck, so sorry if I missed something.
    I recently switched to FIOS from RCN cable in New York.  I've gone through trying to setup my DVR and am running into issues and was hoping for some answers.
    1.  I setup two programs to record at 8PM, I was watching another channel at the time and only half paying attention.  Around 8:02 I noticed a message had popped up asking if I would like to switch channels to start recording.  I was expecting it to force it to switch like my old DVR, but in this case it didn't switch and I missed the first two minutes of one of the shows.  I typically leave my DVR on all day and just turn off the TV, this dual show handling will cause issues with that if I forget to turn off the DVR.  Is there a setting I can change that will force the DVR to choose one of the recording channels?
    2.  I setup all my recordings for "First Run" because I only want to see the new episodes.  One show I setup was The Daily Show on comedy central, which is shown weeknights at 11pm and repeated 3-4 times throughout the day.  My scheduled recordings is showing all these as planned recordings even though only the 11pm show is really "new".  Most of the shows I've setup are once a week so they aren't a problem, but this seems like it will quickly fill my DVR.  Any fixes?
    Thanks for the help.
    Solved!
    Go to Solution.

    I came from RCN about a year ago.  Fios is different in several ways, not all of them desirable.  Here are several ways to get--and fix--unwanted recordings from a series recording setup.
    Some general principles. 
    Saving changes.  When you originally create a series with options, or if you go back to edit the options for an existing series, You MUST save the Series Options changes.  Pretty much everywhere else in the user interface, when you change an option, the change takes effect immediately--but not in Series Options.  Look at the Series Options window.  Look at the far right side.  There is a vertical "Save" bar, which you must navigate to and click OK on to actually save your changes.  Exiting the Series Options window without having first saved your changes loses all your attempted changes--immediately.
    Default Series Options.  This is accessed  from [Menu]--DVR--Settings--Default Series Options.  This will bring up the series options that will automatically be applied to the creation of a NEW series. The options for every previously created series will not be affected by a subsequent modification of the Default Series Options.  You should set these options to the way you would like them to be for the majority of series recordings that you are likely to create.  Be sure to SAVE your changes.  This is what you will get when you select "Create Series Recording" from the Guide.  When creating a new series recording where you think that you may want options different from the default, select "Create Series with Options" instead.  Series Options can always be changed for any individual series set up later--but not for all series at once.
    Non-series recordings.  With Fios you have no directly available options for these.  With RCN and most other DVRs, you can change the start and end times for individual episodes, including individual episodes that are also in a series.  With Fios, your workarounds are to create a series with options for a single program, then delete the series later;  change the series options if the program is already in a series, then undo the changes you made to the series options later; or schedule recordings of the preceding and/or following shows as needed.
    And now, to the unwanted repeats. 
    First, make sure your series options for the specific series in question--and not just the series default options--include "First Run Only".  If not, fix that and SAVE.  Then check you results by viewing the current options using the Series Manager app under the DVR menu.
    Second, and most annoying, the Guide can have repeat programs on your channel tagged as "New".  It happens.  Set the series option "Air Time" to "Selected Time".  To make this work correctly, you must have set up the original series recording after selecting the program in the Guide at the exact time of a first run showing (11pm, in your case), and not on a repeat entry in the Guide.  Then, even it The Daily Show is tagged as New for repeat showings, these will be ignored. 
    Third, another channel may air reruns of the program in your series recording, and the first showing of a rerun episode on the other channel may be tagged as "New".  These can be ignored in your series if you set the series option "Channel" to "Selected Channel".  Related to this, if there is both an SD and HD channel broadcasting you series program, you will record them both if the series option "Duplicates" is set to "Yes".  However, when the Channel option is set to "Selected Channel", the Duplicates Option is always effectively "No", regardless of what shows up on the options screen.  
    As for you missing two minutes,  I have sereral instances in which two programs start recording at the same time.  To the best of my recollection, whenever the warning message has appeared, ignoring it has not caused a loss of recording time.  You might have an older software version.  Newest is v.1.8.  Look at Menu--Settings--System Info.  Or, I might not have noticed the loss of minutes.  I regularly see up to a minute of previous programming at the start of a recording, or a few missing seconds at the beginning or end of a recording.  There are a lot of possibilities for that, but the DVR clock being incorrect is not one of them.  With RCN, the DVR clocks occasionally drifted off by as much as a minute and a half.

  • Pension issue Mid Month Leaving

    Dear All,
    As per rule sustem should deduct mid month joining/leaving/absences or transfer scenarios, the Pension/PF Basis will be correspondingly prorated. But our system is not doing this. In RT table i have found 3FC Pension Basis for Er c 01/2010                    0.00           6,500.00.
    Employee leaving date is 14.04.2010. system is picking pension amout as 541. Last year it was coming right.
    Please suggest.
    Ashwani

    Dear Jayanti,
    We required prorata basis pension in case of left employees and system is not doing this. This is the issue. As per our PF experts Pension amount should come on prorata basis for left employees in case they left mid of month.System is doing prorata basis last year but from this year it is deducting 541. I am giving two RT cases of different years.
    RT table for year 2010. DOL 26.04.2010
    /111 EPF Basis              01/2010                    0.00           8,750.00 
    /139 VPF Basis              01/2010                    0.00           8,750.00 
    /3F1 Ee PF contribution     01/2010                    0.00           1,050.00 
    /3F3 Er PF contribution     01/2010                    0.00             509.00 
    /3F5 Ee Mon PF contribution 01/2010                    0.00           1,050.00 
    /3F6 Ee Ann PF contribution 01/2010                    0.00          12,600.00 
    /3F9 PF adm chrgs * 1,00,00 01/2010                    0.00              96.25 
    /3FA PF basis for Ee contri 01/2010                    0.00           8,750.00 
    /3FB PF Basis for Er Contri 01/2010                    0.00           8,750.00 
    /3FJ VPF basis for Ee contr 01/2010                    0.00           8,750.00 
    /3FL PF Basis for Er Contri 01/2010                    0.00           6,500.00 
    /3F4 Er Pension contributio 01/2010                    0.00             541.00
    /3FC Pension Basis for Er c 01/2010                    0.00           6,500.00
    /3FB PF Basis for Er Contri 01/2010                    0.00           8,750.00
    /3FC Pension Basis for Er c 01/2010                    0.00           6,500.00
    /3FJ VPF basis for Ee contr 01/2010                    0.00           8,750.00
    /3FL PF Basis for Er Contri 01/2010                    0.00           6,500.00
    /3R3 Metro HRA Basis Amount 01/2010                    0.00           8,750.00
    1BAS Basic Salary           01/2010                    0.00           8,750.00
    RT table for year 2009. DOL 27.10.2009
                                                                                    /111 EPF Basis              07/2009                    0.00           9,016.13
    /139 VPF Basis              07/2009                    0.00           9,016.13
    /3F1 Ee PF contribution     07/2009                    0.00           1,082.00
    /3F3 Er PF contribution     07/2009                    0.00             628.00
    /3F5 Ee Mon PF contribution 07/2009                    0.00           1,082.00
    /3F6 Ee Ann PF contribution 07/2009                    0.00           8,822.00
    /3F9 PF adm chrgs * 1,00,00 07/2009                    0.00              99.18
    /3FA PF basis for Ee contri 07/2009                    0.00           9,016.00
    /3FB PF Basis for Er Contri 07/2009                    0.00           9,016.00
    /3FJ VPF basis for Ee contr 07/2009                    0.00           9,016.00
    /3FL PF Basis for Er Contri 07/2009                    0.00           5,452.00
    /3FB PF Basis for Er Contri 07/2009                    0.00           9,016.00 
    /3FC Pension Basis for Er c 07/2009                    0.00           5,452.00 
    /3FJ VPF basis for Ee contr 07/2009                    0.00           9,016.00 
    /3FL PF Basis for Er Contri 07/2009                    0.00           5,452.00 
    /3R4 Non-metro HRA Basis Am 07/2009                    0.00           9,016.13 
    1BAS Basic Salary           07/2009                    0.00           9,016.13 
    Now please suggest what to do. where is the problem  ? If have also checked EXIT_HINCALC0_002 but nothing written in it.
    With Regards
    Ashwani

  • Open PO Analysis - BW report issue

    Hello Friends
    I constructed a query in BW in order to show Open Purchase Orders. We have custom DSO populated with standard
    datasource 2lis_02_itm (Purcahse Order Item). In this DSO we mapped the field ELIKZ to the infoobject 0COMP_DEL
    (Delivery completed).
    We loaded the data from ECC system for all POs and found the following issue for Stock Transport Purchase orders (DocType = UB).
    We have a PO with 4 line items. For line items 10 and 20, Goods issued, Goods received and both the flags "Delivery
    complete" and "Final delivery" checked. For line items 30 and 40, only delivery indicator note is issued for zero
    quantity and Delivery complete flag is checked (Final delivery flag is not checked) in ECC system. For this PO, the
    delivery completion indicator is not properly updated in the DSO for line items 30 and 40. The data looks like the
    following:
    DOC_NUM     DOC_ITEM       DOCTYPE     COMP_DEL
    650000001       10     UB        X
    650000001       20     UB        X
    650000001       30     UB
    650000001       40     UB      
    When we run the Open PO analysis report on BW side this PO is appearing in the report but the same is closed in ECC
    system.
    Any help is appreciated in this regard.
    Thanks and Regards
    sampath

    Hi Priya and Reddy
       Thanks for your response.
                         Yes the indicator is checked in EKPO table for items 30 and 40 and delta is running regularly for more than 1 year and no issues with other POs. This is happening only for few POs of type Stock Transport (UB).
                        I already checked the changes in ME23N and the Delivery completed indicator was changed and it reflected in EKPO table. Further, i checked the PSA records for this PO and i am getting the records with the Delivery completed flag but when i update from PSA to DSO the delivery completed indicator is not updating properly.
                       In PSA, for item 30 i have the following entries. Record number 42 is capturing the value X for ELIKZ but after that i am getting two more records 43 and 44 with process key 10 and without X for ELIKZ. I think this is causing the problem.
    Record No.    Doc.No.                    Item              Processkey         Rocancel     Elikz
        41               6500000001            30                    11                            X           ---    
        42               6500000001            30                    11                            ---           X
        43               6500000001            30                    10                            X           ---
        44               6500000001            30                    10                            ---         ---
    (Here --- means blank)        
    Thanks and Regards
    sampath

  • HP LaserJet Enterprise 600 M602 driver issue

    Hello,
    I've got issue with 600-series printers. We use the latest UPD drivrer ver. 61.175.1.18849 and print from XenApp 6.5. The error occurs every time when users try to print jpg files from XenApp session. It only happens with 600 series printers and UPD.
    Also I've tried to assign native 600-series driver ver. 6.3.9600.16384 and it works good. But with that driver system says that it's color printer and it brokes our printing reports. These reports are very important for us. So we can't use printer and that driver as well.
    Printer installed on Windows Server 2012 R2. All clients are Windows 7 x64. XenApp Servers are Server 2008R2.
    Is it possible to get fixed UPD driver or correct native driver for Server 2012 R2?
    Regards,
    Anatoly

    I am sorry, but to get your issue more exposure I would suggest posting it in the commercial forums since this is a commercial printer. You can do this at Printers - LaserJet.
    Click on New Post.
    I hope this helps.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • Windows 7 displays error message when exiting +cursor issue

    Two issues here. CS5 Phoshop on Wind 7 64 bit.
    Physical processor count: 8
    Processor speed: 3073 MHz
    Built-in memory: 12279 MB
    Free memory: 9577 MB
    Memory available to Photoshop: 10934 MB
    Memory used by Photoshop: 80 %
    Image tile size: 128K
    First issue is since the latest automatic Adobe update (why fix what isn't broken?) Every time I now exit Photoshop I get the message "Adobe QT Server has stoped working" and occasionally it happens when I exit bridge. Indesign is also behaving badly. I can no longer start a previous document from file manager without ID crashing out.
    The other is the cursors in Clone and erase lose their edge (become invisable) for no reason - well not quite. Noise Ninja crashed Photoshop when I tried to use it. I reinstalled it and all is well. The cursor issue seems to be intermittant but came back (for no reason) after I reinstalled NN. I can't seem to change the cursor, no matter what I do. The problem is now seriously affecting how I work. Almost enough to go back to Win XP which ran CS5 Photoshop flawlessly.
    Any help will be gratefully accepted.
    Doug

    function(){return A.apply(null,[this].concat($A(arguments)))}
    doug87510 wrote:
    The recent problem is the entire outline of the cursor (including the crosshair in the middle) was missing at any size of cursor. All I had was exactly what I'd get if I used a real spraygun.
    Well, that issue is simply a matter of hitting the Caps Lock key.  When Caps Lock is on, you'll see the cursor outline, and when it is off you'll see a crosshair.  That's a feature, not a bug.
    Glad to hear the 11.1 drivers are out.  I will download them and try them now myself.
    Regarding "Adobe QT" crashing...  QT brings to mind QuickTime, though that is Apple, not Adobe.  Do you have Apple QuickTime installed?
    Regarding memory usage, with 12 GB of installed RAM, you should be able to set Photoshop to use 90% or more in Edit - Preferences - Performance.
    -Noel

  • Issue in Creation of Periodicals for Contracts in CRM7.0

    Hello,
    I have a requirement to create Contracts in CRM7.0 system.
    And I am doing this using the BAPI *BAPI_BUSPROCESSND_CREATEMULTI*
    Good part is Contract Order gets created, but onlywith Header Details.
    The issues i am facing --
    1. I need to know what kind/type of data must be passed to the interface parameters, the F1 Help/Documentation is vague.
    2. I am passing data in the INPUT FIELDS structure with the Object ID, Handle Number, Reference GUID and Fieldname,
        here what does 'Logical Key' field indicate? What should be passed here.
        What does 'REFERENCE KIND' field indicate, i have been passng 'A' for everything (to be frank i dont know whats its significance is!!).
    3. With so much, My Order gets created but with less than half details, i.e. the Objects not getting created are -  Partner, Product, terms/appointments, Status, LongTexts......
    Any help/inputs would be appreciated.
    Hope my problem is stated clearly ...
    --Regards
    Dedeepya

    Hi Anu,
    i found my solution by debugging with existing data or while creating it in CRMD_ORDER.
    Ensure that you are passing a correct entry in INPUT_FIELDS structure.
    As i haven't worked on rebates i woudlnt be able to help you, I suggest you debug to arrive at a solution.
    You can preset your break-points at :-
    1. FM - CRM_ORDER_MAINTAIN
    2. CRM_ORDER_MAINTAIN_MULTI_OW -- Debug through the complete FM.
    3. CRM_ORDER_PREPARE_MULTI_OW -- The data is set in this function module.
    Regards
    Dedeepya C

  • Issue in creation of plant related data at receiving server using BD10

    Hi all,
    This is regarding Material master creation using B10.I am using MATMAS05 message type for sending data from one system to another.Data is sent and received successfully.When i go in mm03 i can see all the views created successfully accept views related to PLANT.Please guide to resolve the issue.
    When i entered into Log-
    1)"The field MBEW-BKLAS is defined as a required field; it does not contain an entry".
    2)"No material master data exists for material AB_08.04.09(30) in plant 4001".
    My segemnt is as follows-
    ZMATMAS05                      matmas05
           E1MARAM                        Master material general data (MARA)
               Z1KLART                        KLART----
    My extention
               E1MARA1                        Additional Fields for E1MARAM
               E1MAKTM                        Master material short texts (MAKT)
               E1MARCM                        Master material C segment (MARC)
                   Z1AUSPM                        E1AUSPMDistribution of Classification:----
    My extention
                   E1MARC1                        Additional Fields for E1MARCM
                   E1MARDM                        Master material warehouse/batch segment (MARD)
                   E1MFHMM                        Master material production resource/tool (MFHM)
                   E1MPGDM                        Master material product group
                   E1MPOPM                        Master material forecast parameter
                   E1MPRWM                        Master material forecast value
                   E1MVEGM                        Master material total consumption
                   E1MVEUM                        Master material unplanned consumption
                   E1MKALM                        Master material production version
               E1MARMM                        Master material units of measure (MARM)
               E1MBEWM                        Master material material valuation (MBEW)
               E1MLGNM                        Master material material data per warehouse number (MLGN)
               E1MVKEM                        Master material sales data (MVKE)
               E1MLANM                        Master material tax classification (MLAN)
               E1MTXHM                        Master material long text header
               E1CUCFG                        CU: Configuration data
           E1UPSLINK                      Reference from Object to Superior UPS
    Thanks.
    Edited by: sanu debu on Apr 27, 2009 7:10 PM

    CREATE CONTROLFILE SET DATABASE "NEWDB" NORESETLOGS ARCHIVELOGAlso when you are setting a new database, the option should be RESETLOGS and not NORESETLOGS.
    'D:\APP\ADMINISTRATOR\ORADATA\NEWDB\ONLINELOG\O1_MF_2_7FK0XKB8_.LOG
    D:\APP\ADMINISTRATOR\ORADATA\NEWDB\DATAFILE\O1_MF_SYSTEM_7FK0SKN0_.DBFWhy underscore(_) at the end of the datafile name. Any specific reason ?

  • Issue in Creation of new Value Field in CO-PA

    Hi,
    I have a query in CO-PA Value Field Linking.
    In my Development Client,
    1. Created a New Value Field (No Transport Request Generated)
    2. Linked to the above to new Conditon type created in SD. (Tranport request was generated) i.e. in Flow of Actual Values->Transfer of Billing Documents->Assign Value Fields
    However then i try creating a new Value Field in my Production Client it throws a message 'You have no authorization to change Fields".
    Is this an issue with authorization or i need to transport the Value field too from Development to Production client.
    Please Advise.
    Thanks in Advance,
    Safi

    Thanks Phaneendra for the response.
    The creation of Value field did not create any tranportation request. Will this too be transported if i transport the Operating Concern.
    Please Advise.
    Thanks,
    Safi

Maybe you are looking for

  • Tint on display.

    Hi, I have a problem with my iPod video, 30gb, white. The display is tinted yellow on the left side, and is normal (bright white) on the right side. Have not dropped or damaged it. Any suggestions? Thanks, Shannon iPod video / 5G 30GB White    

  • SAP Netweaver 7.01 ABAP Trial Version errors occured during installation

    Hi There, I happened to uninstall NSP and been unsuccesfully to reinstall back. The summary only asked me to look at the log file, which I barely understand what it means. (Jan 2, 2009 3:44:42 PM), Install, com.installshield.product.actions.Files, er

  • Cant boot from OSX CD

    Hi all, I have been trying everything to boot a G4 mirrored front to boot from the CD that it came with. I have tried the new keybord all kind of keys pressed. I had the same problem on 2 new G5's apple care tech's had me type something into terminal

  • Windows 7 wont allow me to install itunes

    why wont windows allow me to install itunes successfully?

  • Albums not showing in iPhone sync list

    Ok, so with the new iTunes we're being forced along the path of using Apple's method of listing by Artist or Album by default and then having playlists for anything inbetween. Fine. The new interface is geared towards that way of working on devices a