Retrieving acceptable date format

I'm developing a script using SAP GUI Scripting API,
There are some fields on user's screen which must be filled with a date.
For some users, these fields accepts date in MM.DD.YYYY format, while for some others the accepted format is DD.MM.YYYY.
My question is: How can I know which date format is accepted by a GuiComponent in order to make the correct input?
Could not find any method or property in any component that could give me a clue.
(I'm having troubles with decimal values too, once I cannot determine if the separator is a dot or a comma, but I suppose solving the date problem may lead to solving this one too.)
Thanks in advance.

Hi Ycarus,
there are as always several solutions. One of these might look like this:
For example, is the date entered as follows:: 01.03.2011
on error resume next
session.findById("wnd[0]/usr/. . .").text = "31.12.9999"
if error.number > 0 or error.number < 0 then 
  session.findById("wnd[0]/usr/. . .").text = "03.01.2011"
else
session.findById("wnd[0]/usr/. . .").text = "01.03.2011"
end if
on error goto 0
To find out whether a comma or a decimal point to be used as a separator, you could take a similar approach.
Regards,
ScriptMan
Edited by: ScriptMan on Mar 28, 2011 11:10 AM

Similar Messages

  • BT HELP PAGE NOT ACCEPTING DATE FORMAT

    I AM USING THE  HELP EMAIL CONTACT OPTION AND THE DATE FORMAT IS BEING REJECTED
    I HAVE TRIED THREE TIMES WITH THE SAME RESULT
    IS THERE AN ERROR ON THIS PAGE?
    CAN IT BE CHECKED PLEASE
    THANK YOU
    TEXT AS ENTERED  
    TEST ERROR O4/11/11
    CANNOT CARRY OUT SPEEDS AS ERROR MESSAGE
    NO FIBRE TO THIS  PREMISES ( FTTP)  HAVE NOT BEEN FOUND AT THIS ADDRESS
    4/11/11 HEALTH CHECK  NO WIRELESS SIGNAL DETECTED
    CONFLICTING DATA ON TESTING
    NOT EXACTLY SURE
    TESTED OK 26/10/11  BETA TEST SUCCESSFUL  04/11/11 AFTER WEAK SIGNAL ERROR AS ABOVE
    BWEP
    Solved!
    Go to Solution.

    Thank you for this
    I have retried and by removing dates from text which inevitably  dilutes the  data ie dates of the problems 
    It will only accept the one date in the section  When was the problem first noted
    The  accepted format ws as originally posted ie 04/11/11
    BWEP

  • Quicken 2007 date format problem in Mavericks

    Objective: Get date format in dd/mm/yyyy format in Quicken 2007 (Lion compatible version).
    Current OS: Mavericks 10.9.4
    Hardware: Retina MacBook Pro & iMac 27" 3.2Ghz
    Problem:
    On my rMBP with Mavericks 10.9.4, I’m able to get Quicken 2007 data in dd/mm/yyyy format, as desired.
    On my new iMac (late 2013) with 10.9.4, Quicken recognises the System date formats dd/mm/yyyy (setting up a new register shows System date format) but the registers and data are all in m/d/yy.
    Quicken prefs are set to Canadian, so date formats should automatically be in dd/mm/yyyy, but aren't.
    The Quicken data file is identical on both Macs. The original file goes back to 1991, and has been through all Mac OS iterations since then.
    Pre-Lion, I remember that the workaround was to set the Language & Region to something (English / US, don’t remember which) and then change date formats. Anyway, the dd/mm/yyyy stuck, through Lion and Mavericks on my rMBP, but is causing a problem in the iMac.
    My guess is that Quicken is unable to / blocked out from accessing System date formats in Mavericks 10.9.4.
    Wondering if there’s some way to make Quicken access the Mavericks System date format, and stick to it?
    Possible approach: If some expert in these forums knows how Mavericks works under the hood, how it allows other apps access to System Prefs like date formats etc., perhaps a script or Terminal command could force Quicken 2007 to recognise and accept date formats from System Prefs (Language & Regional settings).
    I'd really appreciate the help; needless to say, the Quicken data is vital to my work.

    Hi Marlon,
    The OS Local definitions. Different countries have different date formats for their location. Check the date format of the OS CultureInfo settings.
    Regards,
    Vítor Vieira

  • Problem with the Date format and sending it to R/3

    Hi all,
    I have an Adaptive RFC application which fetches the data from the R/3 and displays the Employee's Personal Data.
    I am using a ZFM which is customised as per the requirement from the Standard BAPI_EMPLOYEE_GETDATA.
    Now the Problem i am facing is Date is default and Optional Parameter in RFC.
    If i execute the RFC in R/3 without Date it is not filling the Internal Tables. And if i pass the Date it is filling the Internal Table and fetches the Records.
    So in WD application i am inputing Employee FirstName, LastName or the Employee ID.
    User can give any of the above input or combination of FirstName and LastName Or only the Employee ID.
    Now the Main Problem is of Date which is of type Date.
    I have also tried the SimpleDateFormat Class, but i am not able to achieve the result.
    I have also seen the Links and threads on SDN, but unable to solve the problem.
    So pls help me out asap.
    Thanks & Regards,
    Dhruv Shah

    Hi ,
    By default , RFC accept date format of SQL date (yyyy-mm-dd) . If you are using a date picker from WD, it directly set the date in SQL date format. Incase if you are trying to pass date to RFC in some other way you have to convert that into SQL date format before passing.
    if you are passing String date of format dd-mm-yyyy , you try this method to convert that to SQL date and pass to your RFC.
    public java.sql.Date sqlDateConvert( String date)  {
        //@@begin sqlDateConvert()
         java.sql.Date dateObj=null;
         try{     
              StringTokenizer tempStringTokenizer = new StringTokenizer(""+date,"-");          int dd=Integer.parseInt(tempStringTokenizer.nextToken().trim());
                                    int mm=Integer.parseInt(tempStringTokenizer.nextToken().trim());
              mm=mm-1;
              int yyyy=Integer.parseInt(tempStringTokenizer.nextToken().trim());
              Calendar cal =Calendar.getInstance();   
              cal.set(yyyy,mm,dd);                         
              dateObj = new java.sql.Date( cal.getTime().getTime());
         }catch(Exception e)
              return dateObj;
    Hope this will help you.

  • To accept all date formats for variables

    Hi,
    I am getting a vadidation message on refresh of a query on entering European date format in the selection criteria "Please enter value in permitted format for variable XXXX"
    I need date to accept all date formats for variables to execute query.
    Currently US date format has been accomodated, On entering European date format i get the above validation message.
    Please suggest how do i supress this validation message or any other thoughts on the same.
    If anyone experienced the same before or applied any notes plz send the SAP Note number for the same. I am currently on BW 3.5.
    Message was edited by:
            tyson m

    tyson,
    why dont you control the date display through the user creation / user details option - then your date entries should sort themselves out.
    Arun

  • TextField that accepts dates in DD-MM-YYYY format

    I need to create a texfield that accepts dates in DD-MM-YYYY. Also, if the input does not correspond to a date, I want to trap focus in the control....
    Thanks,
    V

    Oops, sorry for the previous post, it is not the code i am using...
    Here it is:
    import com.id.swing.mask.JMaskField;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.text.ParseException;
    import javax.swing.JComponent;
    import java.awt.Toolkit;
    import javax.swing.JOptionPane;
    import java.text.SimpleDateFormat;
    import java.sql.Date;
    import java.util.Locale;
    import java.awt.event.FocusListener;
    import java.awt.event.FocusEvent;
    public class IdDateMask extends JMaskField implements FocusListener {
    protected SimpleDateFormat m_sdfDbPattern;
    protected SimpleDateFormat m_sdfUserPattern;
    protected String m_userDatePattern = "ddMMyy";
    protected String m_mask = "{[0-1]}#/{[0-3]}#/##";
    protected boolean m_canBeNull;
    public IdDateMask(String mask, String userPattern) {
    super(mask);
    super.setLocale(new Locale(System.getProperty("id.pyrites.user.language"),
    System.getProperty("id.pyrites.user.country")));
    m_userDatePattern = userPattern;//ie ddMMyy
    m_canBeNull = true;
    initialize();
    protected void initialize(){
    setForeground(new Color(51, 0, 255));
    setDisabledTextColor(new Color(0, 0, 0));
    setColumns(8);
    setPreferredSize(new Dimension(84,20));
    setMinimumSize(new Dimension(27,20));
    setMaximumSize(new Dimension(128,20));
    m_sdfDbPattern = new SimpleDateFormat("yyyy-MM-dd", getLocale());
    m_sdfUserPattern = new SimpleDateFormat(m_userDatePattern, getLocale());
    m_sdfUserPattern.setLenient(false);
    public void focusGained(FocusEvent e) {
    this.setBackground(new Color(255,204,204));
    public void focusLost(FocusEvent e) {
    isValidDate();
    this.setBackground(Color.WHITE);
    public boolean canBeNull() {
    return m_canBeNull;
    public void setCanBeNull(boolean value) {
    m_canBeNull = value;
    public boolean isValidDate() {
    boolean retVal = false;
    try {
    String theStr = super.getText();//ie: 310802
    if(!canBeNull()) {
    if (theStr.equals("")) throw(new Exception());
    else m_sdfUserPattern.parse(theStr);//ParseException can be thrown here
    } else {
    if(!theStr.equals("")) System.out.println(m_sdfUserPattern.parse(theStr));//ParseException can be thrown here
    return true;
    } catch (ParseException ex) {
    System.out.println("IdDateMask - verifyDate() - ERROR: " + ex.getMessage());
    Toolkit.getDefaultToolkit().beep();
    try {
    JOptionPane.showMessageDialog(IdDateMask.this,
    java.util.ResourceBundle.getBundle("com/id/pyrites/client/resources/Bundle", getLocale()).getString("MSG_DATE_notValid") + m_userDatePattern,
    java.util.ResourceBundle.getBundle("com/id/pyrites/client/resources/Bundle", getLocale()).getString("MSG_DATE_notValidDlgTitle"),
    JOptionPane.ERROR_MESSAGE);
    } catch(Exception e) {
    System.out.println("IdDateMask - verifyDate() - I18N - ERROR: " + e.getMessage());
    JOptionPane.showMessageDialog(IdDateMask.this,
    "MSG_DATE_notValid" + m_userDatePattern,
    "MSG_DATE_notValidDlgTitle",
    JOptionPane.ERROR_MESSAGE);
    // super.setText("");
    // this.requestFocus();
    return false;
    } catch (Exception ex) {
    System.out.println("IdDateMask - verifyDate() - ERROR: " + ex.getMessage());
    Toolkit.getDefaultToolkit().beep();
    try {
    JOptionPane.showMessageDialog(IdDateMask.this,
    java.util.ResourceBundle.getBundle("com/id/pyrites/client/resources/Bundle", getLocale()).getString("MSG_DATE_notNull"),
    java.util.ResourceBundle.getBundle("com/id/pyrites/client/resources/Bundle", getLocale()).getString("MSG_DATE_notNullDlgTitle"),
    JOptionPane.ERROR_MESSAGE);
    } catch(Exception e) {
    System.out.println("IdDateMask - verifyDate() - I18N - ERROR: " + e.getMessage());
    JOptionPane.showMessageDialog(IdDateMask.this,
    "MSG_DATE_notNull",
    "MSG_DATE_notNullDlgTitle",
    JOptionPane.ERROR_MESSAGE);
    // super.setText("");
    // this.requestFocus();
    return false;
    public void setToday() {
    setValue((new Date(System.currentTimeMillis())).toString());
    public void setText(String value) {
    setValue(value);
    public void setValue(String value) {
    if(!(value == null) && (!value.equals(""))) {
    //We receive the yyyy-MM-dd format...
    //The format of the displayed date is m_userDatePattern
    //So, we have to transform YYYY-MM-dd into for example ddMMYY
    //Let's do it.
    try {
    //If the field is empty, a ParseException is thrown
    String valueToDisplay = m_sdfUserPattern.format(m_sdfDbPattern.parse(value));
    super.setText(valueToDisplay);
    //Next we have to localize it according to medium format
    } catch (ParseException ex) {
    System.out.println("IdDateMask - setValue("+ value +") - ERROR: " + ex.getMessage());
    Toolkit.getDefaultToolkit().beep();
    try {
    JOptionPane.showMessageDialog(IdDateMask.this,
    java.util.ResourceBundle.getBundle("com/id/pyrites/client/resources/Bundle", getLocale()).getString("MSG_DATE_notValidInput") + value,
    java.util.ResourceBundle.getBundle("com/id/pyrites/client/resources/Bundle", getLocale()).getString("MSG_DATE_notValidInputDlgTitle"),
    JOptionPane.ERROR_MESSAGE);
    } catch(Exception e) {
    System.out.println("IdDateMask - setValue("+ value +") - I18N - ERROR: " + e.getMessage());
    JOptionPane.showMessageDialog(IdDateMask.this,
    "MSG_DATE_notValidInput" + value,
    "MSG_DATE_notValidInputDlgTitle",
    JOptionPane.ERROR_MESSAGE);
    } else {
    super.setText("");
    public String getText() {
    return getValue();
    public String getValue() {
    //Return date with format yyyy-MM-dd
    //But i have a String of format m_userDatePattern
    try {
    if(canBeNull() && (super.getText().equals(""))) return "";
    else {
    String outputDateStr = m_sdfDbPattern.format(m_sdfUserPattern.parse(super.getText()));
    return outputDateStr;
    } catch (ParseException ex) {
    System.out.println("IdDateMask - getValue() - ERROR: " + ex.getMessage());
    Toolkit.getDefaultToolkit().beep();
    try {
    JOptionPane.showMessageDialog(IdDateMask.this,
    java.util.ResourceBundle.getBundle("com/id/pyrites/client/resources/Bundle", getLocale()).getString("MSG_DATE_notValid") + m_userDatePattern,
    java.util.ResourceBundle.getBundle("com/id/pyrites/client/resources/Bundle", getLocale()).getString("MSG_DATE_notValidDlgTitle"),
    JOptionPane.ERROR_MESSAGE);
    } catch(Exception e) {
    System.out.println("IdDateMask - getValue() - I18N - ERROR: " + e.getMessage());
    JOptionPane.showMessageDialog(IdDateMask.this,
    "MSG_DATE_notValid" + m_userDatePattern,
    "MSG_DATE_notValidDlgTitle",
    JOptionPane.ERROR_MESSAGE);
    return "";
    public void setEnabled(boolean value) {
    super.setEnabled(value);
    //color section
    public void setBackgroundText(Color c) {
    setBackground(c);
    public void setForegroundText(Color c) {
    setForeground(c);

  • Connecting webservice and retrieve the data in json format.

    Hi,
    I need to connect to web service using java and retrieve the data in the format of JSON.
    I'm pretty new to this kind of technology, so kindly inform me about the class which are to be used.
    Thanks in advance

    There isn't one class that will solve your problems. You need to use many classes, and it's not a trivial task.

  • Which data format accepts MDM server

    Hi All,
                   Which data format accepts MDM server. Suppose when we discuss about XI, It  has own language XML, like that MDM have any own language?
                    And Where the XI helps to MDM consolidation?
    Thanks,
    Satish.

    Hi Satish,
    You can import XML (with or without schema), Excel or Access files into MDM or link directly to other databases (SQL or ODBC).
    You will most likely need XI if you want to automate import processes into MDM. XI has to put the files to be imported into a specified directory so that MDM can pick it up. Also, XI is helpful for some data conversions that MDM can't do.
    Hope this helps,
    Christiane

  • Accepting date in JTextField and converting to date format

    I'm trying to convert JTextField value to date format but I can't. I need to send date value to a date field of database. Could anyone help me convert JTextField value to Date value?
    Thanks

    Date SimpleDateFormat.parse(String) ?

  • How to retrieve multiple data from table and represent it in jsp page

    Hi
    The below JavaScript code is used to add row in the table when I want to add multiple row data into table for single entry no field.
      <html>  function addRow()
                i++;
                var newRow = document.all("tblGrid").insertRow();
                var oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='srno"+i+"' type='text' id='srno"+i+"' size=10>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='itmcd"+i+"' type='text' id='itmcd"+i+"' size='10'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='itmnm"+i+"' type='text' id='itmnm"+i+"' size='15'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='indentqty"+i+"' type='text' id='indentqty"+i+"' size='10'>";
                oCell = newRow.insertCell();
                    oCell.innerHTML = "<input name='uom"+i+"' type='text' id='uom"+i+"' size='10'><input type='hidden' name='mcode"+i+"'id='mcode"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='packqty"+i+"' type='text' id='packqty"+i+"' size='10'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='packuom"+i+"' type='text' id='packuom"+i+"' size='10'><input type='hidden' name='pack"+i+"' id='pack"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='rate"+i+"' type='text' id='rate"+i+"' size='10'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='dor"+i+"' type='text' id='dor"+i+"' size='0' onClick='"+putdate(this.name)+"'>";           
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='bccode"+i+"' type='text' id='bccode"+i+"' size='10'></td><input type='hidden' name='bcc"+i+"' id='bcc"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='cccode"+i+"' type='text' id='cccode"+i+"' size='10'></td><input type='hidden' name='ccc"+i+"' id='ccc"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='remark2"+i+"' type='text' id='remark2"+i+"' size='20'>";           
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input type='button' value='Delete' onclick='removeRow(this);' />";
               // oCell = newRow.insertCell();
               // oCell.innerHTML = "<input type='button' value='Clear' onclick='clearRow(this);' />";
            }<html>  Then this data are send to the next Servlet for adding into two table.
    My header portion data are added into one table which added only one row in table. while footer section data are added into the no of rows in another table dependent on No. of
    Rows added into jsp page.
    Here is an code for that logic.
    <html>
    ArrayList<String> mucode = new ArrayList<String>();
                                ArrayList<Integer> serials = new ArrayList<Integer>();
                                ArrayList<Integer> apxrate = new ArrayList<Integer>();
                                ArrayList<Integer> srname = new ArrayList<Integer>();
                                ArrayList<String> itcode = new ArrayList<String>();
                                ArrayList<String> itname = new ArrayList<String>();
                                ArrayList<Integer> iqnty = new ArrayList<Integer>();
                                ArrayList<String> iuom = new ArrayList<String>();
                                ArrayList<Integer> pqnty = new ArrayList<Integer>();
                                ArrayList<String> puom1 = new ArrayList<String>();
                               ArrayList<Integer> arate = new ArrayList<Integer>();
                                ArrayList<String> rdate = new ArrayList<String>();
                                ArrayList<String> bcs = new ArrayList<String>();
                                ArrayList<String> ccs = new ArrayList<String>();
                                ArrayList<String> remarkss = new ArrayList<String>();
                                //ArrayList<Integer> qtyrecs = new ArrayList<Integer>();
                                //ArrayList<String> dors = new ArrayList<String>();
                                //ArrayList<String> remarks = new ArrayList<String>();
                     String entryn = request.getParameter("entryno");       
                        String rows = request.getParameter("rows");
                        out.println(rows);  
                        //String Entryno = request.getParameter("entryno");
                       // out.println(Entryno);
                      int entryno = 0,reqqty = 0,srno = 0,deprequest = 0,rowcount = 0;
                                if(!Entryno.equals("")){
                                        entryno = Integer.valueOf(Entryno);
                                if(!rows.equals("")){
                                        rowcount = Integer.valueOf(rows);
                               for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("srno"+i)!=null){
                                                serials.add(Integer.valueOf(request.getParameter("srno"+i).trim()));
                                                out.println(serials.size());
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("srno"+i)!=null){
                                                srname.add(Integer.valueOf(request.getParameter("srno"+i).trim()));
                                out.println(srname.get(0));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("itmcd"+i)!=null){
                                                itcode.add(request.getParameter("itmcd"+i).trim());
                                        } //out.println(itcode.get(i));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("itmnm"+i)!=null){
                                                itname.add(request.getParameter("itmnm"+i).trim());
                                        }//out.println(itname.get(i));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("indentqty"+i)!=null){
                                                iqnty.add(Integer.valueOf(request.getParameter("indentqty"+i).trim()));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("uom"+i)!=null){
                                                iuom.add(request.getParameter("uom"+i).trim());
                                        }//out.println(iuom.get(i));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("mcode"+i)!=null){
                                                mucode.add(request.getParameter("mcode"+i).trim());
                               for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("packqty"+i).equals("")){
                                          pqnty.add(0);
                                        }else
                                            pqnty.add(Integer.valueOf(request.getParameter("packqty"+i).trim()));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("pack"+i)!=null){
                                                puom1.add(request.getParameter("pack"+i).trim());
                                       }else
                                        puom1.add("");
                               for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("rate"+i).equals("")){                                     
                                            arate.add(0);
                                        }else
                                        arate.add(Integer.valueOf(request.getParameter("rate"+i).trim()));   
                     /* for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("rate"+i)!=null){
                                                arate.add(Integer.valueOf(request.getParameter("rate"+i).trim()));
                              for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("dor"+i)!=null){
                                                try{
                                                        rdate.add(dashdate.format(slashdate.parse(request.getParameter("dor"+i).trim())));
                                                }catch(ParseException p){p.printStackTrace();}
                                        }else
                                           { rdate.add("");}
                                   for(int i=1;i<=rowcount;i++){
                                 if(request.getParameter("bcc"+i)!=null){
                                                bcs.add(request.getParameter("bcc"+i).trim());
                                        }out.println(bcs.get(0));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("ccc"+i)!=null){
                                                ccs.add(request.getParameter("ccc"+i).trim());
                                        }out.println(ccs.get(0));
                                for(int i=1;i<=rowcount;i++){
                                    out.println("remark2");
                                        if(request.getParameter("remark2"+i)!=null){
                                                remarkss.add(request.getParameter("remark2"+i).trim());
                                        }out.println(remarkss.get(0));
                        ArrayList<String> Idate = new ArrayList<String>();
                        for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("dateindent"+i)!=null){
                                                try{
                                                        Idate.add(dashdate.format(dashdate.parse(request.getParameter("dateindent"+i).trim())));
                                                }catch(ParseException p){p.printStackTrace();}
                    String Rdate = dashdate.format(new java.util.Date());
                     String tdate = dashdate.format(new java.util.Date());    
                     // String Indentdate = dashdate.format(new java.util.Date());
                   //  String ApprovedT1 = dashdate.format(new java.util.Date());
                   //  String ApprovedT2 = dashdate.format(new java.util.Date());
                       // String ApprovedT1=" ";
                        //String ApprovedT2="";*/
                    String ApprovedT1= dashdate.format(new java.util.Date());
                   out.println (ApprovedT1);
                      String ApprovedT2=dashdate.format(new java.util.Date());
                       out.println(ApprovedT2);
                    String Indentdate=(dashdate.format(slashdate.parse(request.getParameter("dateindent").trim())));
                       out.println(Indentdate);
                        String Cocode ="BML001";  
                        out.println(Cocode);
                        String Deptcode = request.getParameter("dept1");
                        out.println(Deptcode);
                        String Empcode = request.getParameter("emp");
                        out.println(Empcode);
                        String Refno =request.getParameter("rtype"); 
                         out.println(Refno);
                        String Divcode = request.getParameter("todiv1");
                        out.println(Divcode);
                        String Usercode = "CIRIUS";    
                         String Whcode = request.getParameter("stor");
                        out.println(Whcode);
                        // String Itemgroupcode = request.getParameter("");
                         String Itemgroupcode ="120000";
                         out.println(Itemgroupcode);
                        String Supplytypecode = request.getParameter("stype");
                        out.println(Supplytypecode);
                        String Delcode = request.getParameter("deliverycode");
                        out.println(Delcode);
                        String Itemclass="WS";
                        out.println(Itemclass);
                        // String Itemclass = request.getParameter("iclass");
                       // out.println(Itemclass);
                        String unitcode = request.getParameter("uni");
                        out.println(unitcode);
                         String Todivcode = request.getParameter("todiv1");
                        out.println(Todivcode);
                        String Appxrate = request.getParameter("rate");
                        out.println(Appxrate);
                        String Srno = request.getParameter("srno");
                        out.println(Srno);                
                    /*    String Indqty = request.getParameter("indentqty");
                      out.println(Indqty);*/
                  String Itemcode = request.getParameter("itmcd");
                       out.println(Itemcode);
                       String Othersp = request.getParameter("remark1");
                        out.println(Othersp);
                        String Reqdt = request.getParameter("dor");
                        out.println(Reqdt);
                        String Munitcode = request.getParameter("mcode");
                        out.println(Munitcode);
                        String Packqty = request.getParameter("packqty");
                        out.println(Packqty);               
                        String Packuom = request.getParameter("pack");
                        out.println(Packuom);
                        String Remark2 = request.getParameter("remark2");
                        out.println(Remark2);
                        String BC = request.getParameter("bcc");
                        out.println(BC);
                        String CC = request.getParameter("ccc");
                        out.println(CC);
                        try{
                            st=connection.createStatement();
                            connection.setAutoCommit(false);
                            String sql="INSERT INTO PTXNINDHDR(COCODE,DEPTCODE,EMPCODE,APPROVEDT1,APPROVEDT2,INDDT,ENTRYNO,REFNO,REMARKS,DIVCODE,USERCODE,WHCODE,ITEMGROUPCODE,SUPTYPECODE,DELCODE,UNITCODE,TODIVCODE,ITEMCLASS)VALUES('"+Cocode+"','"+Deptcode+"','"+Empcode+"','"+ApprovedT1+"','"+ApprovedT2+"','"+Indentdate+"',"+Entryno+",'"+Refno+"','"+Othersp+"','"+Divcode+"','"+Usercode+"','"+Whcode+"','"+Itemgroupcode+"','"+Supplytypecode+"','"+Delcode+"','"+unitcode+"','"+Todivcode+"','"+Itemclass+"')";
                            out.println(sql);
                            st.addBatch(sql);
                            for(int i=0;i<serials.size();i++){
                                out.println("Inside the Statement");
                                String query3="test query for u";
                                out.println(query3);
                               String queryx="Insert into PTXNINDDTL(APXRATE,ENTRYNO,BRKNO,INDQTY,ITEMCODE,OTHERSPFCS,MUNITCODE,PACKQTY,PACKUOM,REMARKS,DIMSUBGRPCODE,DIMCODE,REQDT)VALUES("+arate.get(i)+","+entryno+","+srname.get(i)+","+iqnty.get(i)+","+itcode.get(i)+",'"+Othersp+"','"+mucode.get(i)+"',"+pqnty.get(i)+",'"+puom1.get(i)+"','"+remarkss.get(i)+"','"+bcs.get(i)+"','"+ccs.get(i)+"','"+rdate.get(i)+"')";
                               out.println(queryx);
                                st.addBatch(queryx);
                           int[] result=st.executeBatch();
                           connection.commit();
                           for(int k=0;k<result.length;k++)
                           out.println("rows updated by "+(k+1)+"insert sta:"+result[k]+"");
                        catch(BatchUpdateException bue)
                        out.println("error1;"+bue+"");
                        catch(SQLException sql)
                        out.println("error2;"+sql+"");
                        catch(Exception l)
                        out.println("error3;"+l+"");
    </html>
       Now I looking for to retrieve this footer section data available in multiple rows from footer table and present it in jsp page .
    I am finding difficulties in how to show this multiple row data for dynamic no of rows .i.e. variable no. of rows.
    I have able to show the data in Header portions of page in this ways
    here i am adding the part of code which shows the data from header part of table i.e from Header table
      <html>
    <h2 align="center"><b>Indent Preparation</b></h2>
        <div align="left">
            <table width="849" border="0" cellspacing="3" cellpadding="3" align="center">
                <tr>
                    <td ><div align="left"><b>Indent No.</b></div></td>
                    <td ><label>
                            <input name="indentno" type="text" id="indentno" size="15" value="" /><input type="hidden" name="no" id="no">
                    </label></td>
                    <td ><div align="center"><strong>Indent Date</strong></div></td>
                    <td ><label>
                            <div align="center">
                                <input name="dateindent" type="text" id="dateindent"value="<%=date1%>"/><input type="hidden" name="no" id="no">
                            </div>
                    </label></td>
                    <td> </td>
                    <td><div align="right"><strong>Entry No.</strong></div></td>
                     <%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
            <td><input type="text" value="<%=hdrcode.get(3)%>" size="10"></td>
    <%}else{%>
                   <td><input type="text" name="entryno" id="entryno" value="<%=entryNo%>"/></td>
                             <%}%>
                            <div align="right"></div>
                </tr>
                <tr>
                    <td><b>Division</b></td>
                    <%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
    <td><input type="text" value="<%=hdrdetails.get(9)%>" size="20"</td>
    <td><input type="hidden" name="div1" id="div1" value='<%=hdrcode.get(10)%>'></td>
    <%}else{%>
                   <td><input type="text" name="div" id="div" /></td>
                   <td><input type="hidden" name="div1" id="div1" /> </td>
              <%}%>
                    <td> </td>
                    <td> </td>
                    <td><div align="right"><strong>Unit</strong></div></td>
                   <%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
    <td><input type="text" value="<%=hdrdetails.get(14)%>" size="20"</td>
    <td><input type="hidden" name="uni" id="uni" value='<%=hdrcode.get(12)%>'></td>
    <%}else{%>
                   <td><input type="text" name="unit" id="unit" /></td>
                   <td><input type="hidden" name="uni" id="uni" /> </td>
              <%}%>
                </tr>
                <tr>
    </html>
      Any suggestion on any above works is highly appreciated.
    Thanks and regards
    harshal

    Too much code. It's also not well intented nor formatted. I don't see a question either or it got lost in that heap of unformatted code.
    I will only answer the question in the thread's subject:
    How to retrieve multiple data from table and represent it in jsp pageTo retrieve, make use of HttpServletRequest#getParameterValues() and/or #getParameter().
    To display, make use of JSTL's c:forEach.

  • How to convert the date format 'm/d/yyyy hh:mi:ss AM' to 'MM/DD/YYYY HH:M'

    How can i convert a the date format 'm/d/yyyy hh:mi:ss AM' to 'MM/DD/YYYY HH:MI:SS AM' in Oracle
    I have a query
    select UPPER(t.val_10) "TYPE", count(val_3) "Number of Transfers"
    from table1 t
    where t.is_active = 1
    and t.val_4 = 'INBOUND'
    and to_date(to_date(val_5,'MM/DD/YYYY HH:MI:SS AM'), 'DD/MM/YY') between to_date(to_date('01/08/2008 00:00:00','DD/MM/YYYY HH24:MI:SS'), 'DD/MM/YY') and add_months(to_date(to_date('01/08/2008 00:00:00','DD/MM/YYYY HH24:MI:SS'), 'DD/MM/YY'),1)
    group by UPPER(t.val_10)
    order by UPPER(t.val_10)
    I get the error [ORA-01861: literal does not match format string which i think is because
    val_5 has the values in the following format:
    8/29/2008 6:31:10 PM
    Does anyone have an answer?
    Thanks in advance
    Edited by: user2360027 on 26-Mar-2009 03:50                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    first off, you've got to_date(to_date(...)) - NEVER do this - you're forcing an implicit to_char which can cause all sorts of problems!
    What is the data type of your column val_5? If it's DATE then your query is simply:
    select UPPER(t.val_10) "TYPE",
           count(val_3) "Number of Transfers"
    from   table1 t
    where  t.is_active = 1
    and    t.val_4 = 'INBOUND'
    and    val_5 between to_date('01/08/2008','DD/MM/YYYY') and add_months(to_date('01/08/2008','DD/MM/YYYY') ,1)
    group by UPPER(t.val_10)
    order by UPPER(t.val_10)If it's a varchar2 (why, oh why, oh why, ...?!), then your query should be:
    select UPPER(t.val_10) "TYPE",
           count(val_3) "Number of Transfers"
    from   table1 t
    where  t.is_active = 1
    and    t.val_4 = 'INBOUND'
    and    to_date(val_5, 'mm/dd/yyyy hh:mi:ss AM') between to_date('01/08/2008','DD/MM/YYYY') and add_months(to_date('01/08/2008','DD/MM/YYYY') ,1)
    group by UPPER(t.val_10)
    order by UPPER(t.val_10)Remember that dates in DATE format are stored in an internal Oracle format - in order for you to tell Oracle that your string is a date, you need to use to_date. When you want to retrieve a date, you need to use to_char to put it into the format you want to see it in.
    Remember also that your nls_date_format defines the default format that you'll see a date, which is what is used in the implicit conversion that oracle does when you select a date:
    SQL> alter session set nls_date_format='dd/mm/yyyy hh24:mi:ss';
    Session altered.
    SQL> select sysdate from dual;
    SYSDATE
    26/03/2009 11:01:53
    1 row selected.
    SQL> alter session set nls_date_format='mm/dd/yy hh12:mi:ss AM';
    Session altered.
    SQL> select sysdate from dual;
    SYSDATE
    03/26/09 11:02:24 AM
    1 row selected.It doesn't make sense to convert something that's already in a DATE format into a DATE format - in order to do that, oracle has to first change the date into a string, and it does that by using the nls_date_format parameter setting - if you're working with dates-in-strings that are in a different format, then all sorts of problems arise, as you have found out!

  • Acrobat 9.3.4 doesn't enforce Date Formating

    After we upgraded to Acrobat 9.3.4 from a previous version of 9.3 acrobat doesn't enforce date formating..before in a Text field formated as Date mm/dd/yyyy it would autocompelete if we typed in 9/21 to 9/21/2010.. now it doesn't, we can type any random text in the field and it isn't validated.
    Ideas?

    Just checked, its enabled.. when I say validate I'm referring to Acrobat's internal date format validation, not JavaScript.
    For example if you create a text box, goto properties, format tab, format category = date, date options mm/dd/yyyy
    now if you type:
    "abcdef" in that text box it should say, "Invalid Date/time: please ensure that the date/time exists.
    if you type 9/21 it will automatically turn it into 9/21/2010.
    After Appling the 9.3.4 update no such validation takes place, any value entered is accepted..

  • DATE Format Error in ODI-11g(11.1.1.3)

    I am using ETL transformations in ODI-11g. There's a dominant issue regarding date formattings when I map an ODI variable (storing date) with a TGT column(datatype=date) mappings.
    In all the src-tgt mappings I am formatting the date by using TO_DATE() functions. But still getting the error:
    "ORA-01830: date format picture ends before converting entire input string".
    A point to Note: The same ETL in other env are ruuning fine but in my new dev env it's giving this date error.
    I had checked with the DBA folks and they confirmed they set equal DATE settings in all the env.
    The ODI Variable is defined as an "Alphanumeric".
    Tx Used: #BUSINESS_CURRENT_DT=TO_DATE('Date','YYYY-MM-DD')
    Require some urgent advice...Please let me know

    Hi,
    W store name-value pair in the Control table from where we exctract our data. Both (param name and param value) are varchars.
    Well this looks pretty strange in 11g! Here's what we found out...
    If you are trying to retrieve a date variable by using TO_DATE() in the refresh query the ODI Java driver (JDK 1.6) would call java.sql.timestamp and gracefully attach HH:MI:SS.NS along with the date (YYYY-MM-DD HH:MI:SS.NS). My target ia a date always..!
    So, when I do: TO_DATE('20101010','YYYY-MM-DD) in the refresh query ODI stores it as '2010-10-10 00:00:00.0'
    For this the Load always fails as Oracle would not be able to interpret a timestamp by suing TO_DATE()
    The Java driver does this damage. However, it may be wise to store as a timestamp rather as a date if in case u do a Data capture and want the exact time credentials.
    Unfortunately not a req, as of now for us so I had to chop-off the timestamp..!
    Let me know if you find any other details...
    Thanks.!

  • Date Formats - Strange behaviour

    Has anyone come across this one?
    I have a date picker item (DD-MON-YYYY) on a page with an item validation to ensure that the date is in a valid format if typed in. If I type a date with a month format of ‘MM’ instead of ‘MON’ then I get a validation error. I’ve tried removing the item validation but I just end up with an ‘ORA-01843: not a valid month’ error.
    However if I change the date picker to a DD-MM-YYYY then the validation and database both accept dates of any format ie MM or MON.
    I am sure there is a cunning reason for this and the easy answer is to only use date pickers with an MM month format. That said my industry has a writing policy that states that dates should be DD-MON-YYYY and I try to write applications that comply to that policy.
    Any suggestions gratefully received.
    Si

    Si,
    I learn something new every day. This is behavior in the underlying database. Here are some results from SQL*Plus:
    joel@MRVDEV22> select to_date('02/11/2006','DD-MON-YYYY') from dual;
    select to_date('02/11/2006','DD-MON-YYYY') from dual
    ERROR at line 1:
    ORA-01843: not a valid month
    joel@MRVDEV22> select to_date('02-NOV-2006','DD-MM-YYYY') from dual;
    TO_DATE('
    02-NOV-06So why is the one date conversion failing as expected, yet the other one is succeeding? I don't know. Might be a database bug, might be a database feature. The SQL Reference does not appear to shed any light on this subject.
    I thought maybe this was somehow related to the NLS_TERRITORY or NLS_DATE_FORMAT settings, but that does not appear to change this implicit behavior.
    Joel

  • Date format in the Results

    Hi,
    Dates in the Query are retrieved in DD-MON-YYYY format. Is there any option to set for retrieving all dates in the desired format?

    There is currently no preference for formatting dates returned by queries. However, the dates that are returned are formatted according to the NLS_DATE_FORMAT session variable, which can be changed with the following as an example:
    alter session set nls_date_format = 'DD-Mon-YYYY HH24:MI:SS';
    If you are selecting timestamps, then you need to alter the NLS_TIMESTAMP_FORMAT, etc - see the NLS_SESSION_PARAMETERS view for the different NLS settings.

Maybe you are looking for

  • IPod Touch 2g heats up iTunes won't detect it?

    Hello there I have a iPod touch 2g it heats up when I try to charge it. Its not in warranty anymore sadly. I tried to do the DFU mode and iTunes won't detect it. I have iTunes 10 and am running windows 7. Please help

  • BDC - Creating Inspections Plans using T-Code QP01

    Hi All, I want to Create Inspection Plans using QP01 transaction using BDC. It having 4 screens. Third and Fourth screens having line item details. I did recording. Upto First and second screens data is populating properly, coming to third screen dat

  • Problem in adobe interactive form

    hi everybody,                 I am doing my application in 2004s. I have used subforms in interactive form to display  a table. My problem is i could able to bind data to it when i am writing the implementation code in WdInit(). But i have a requirem

  • Success and Failure messages Report

    Hi All,           Could you advice if it is possible within SAP XI to generate a report or list of messages with sender party, receiver party and timestamp for reference. Say end of day we need to run a report of how many successful message passed th

  • Mac pro 8 core crashes every few days?

    I have a Mac Pro 8 core as an audio computer that creashes every few days. I'm new to Mac. Here's the error report... nterval Since Last Panic Report:  194586 sec Panics Since Last Report:          1 Anonymous UUID:                    0E0488BF-6748-4