Date Format in servlet when i insert into database

I am inserting data into database through servlet, but i am getting NumberFormat Exception, and my datatype in database is DATE ,when i typecast my day and year because they r in int and changing into String,still i am getting the same error .So please can any one tell me where to cahnge the format of date and how to type cast to my Date format of database.
Thanks,
lalitha

My code is:import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import java.text.*;
import java.sql.Date;
import java.util.*;
public class RegisterServlet extends HttpServlet
     Connection con;
     PreparedStatement ps;
public void init(ServletConfig sc) throws ServletException
     try
     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
     con=DriverManager.getConnection("jdbc:odbc:plk","scott","tiger");
     System.out.println("connection created");
     catch(Exception e)
     System.out.println(e);
public void doPost(HttpServletRequest req, HttpServletResponse res)
     try
     res.setContentType("text/html");
     PrintWriter pw= res.getWriter();
String ulogin=req.getParameter("login").trim();
String uph1=req.getParameter("ph1").trim();
int ph1=Integer.parseInt(uph1);
String upass=req.getParameter("pass").trim();
String uph2=req.getParameter("ph2").trim();
int ph2=Integer.parseInt(uph2);
String cpass=req.getParameter("cfm").trim();
String uweb=req.getParameter("web").trim();
String ufirst=req.getParameter("first").trim();
String uaddress=req.getParameter("address").trim();
String umiddle=req.getParameter("middle").trim();
String ucity=req.getParameter("city").trim();
String ulast=req.getParameter("last").trim();
String uzip=req.getParameter("zip").trim();
int zip=Integer.parseInt(uzip);
String ud=req.getParameter("Aday").trim();
String um=req.getParameter("Amonth").trim();
String uy=req.getParameter("Ayear").trim();
SimpleDateFormat din=new SimpleDateFormat("dd-mm-yyyy");
SimpleDateFormat dout=new SimpleDateFormat("yyyy/mm/dd");
String txtDate="2001-07-07";
Date date=din.parse(txtDate);
java.sql.Date dt=new java.sql.Date(txtDate);
dout.format(dt);
String usex=req.getParameter("sex").trim();
String uemail=req.getParameter("email").trim();
String ust=req.getParameter("st").trim();
String ucty=req.getParameter("cty").trim();
ps=con.prepareStatement("insert into Userdetails values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
ps.setString(1,ulogin);
ps.setString(2,uph1);
ps.setString(3,upass);
ps.setString(4,uph2);
ps.setString(5,cpass);
ps.setString(6,uweb);
ps.setString(7,ufirst);
ps.setString(8,uaddress);
ps.setString(9,umiddle);
ps.setString(10,ucity);
ps.setString(11,ulast);
ps.setString(12,uzip);
ps.setDate(13,dt);
ps.setString(14,usex);
ps.setString(15,uemail);
ps.setString(16,ust);
ps.setString(17,ucty);
int i=ps.executeUpdate();
if(i==1)
pw.println("<h3><center> Thankyou! Your details have been stored. </center></h3>");
res.sendRedirect("http://localhost:8080/SeekLogin.html");
pw.close();
else
     pw.println("<h3><center>Sorry! you are not registered properly. </center></h3>");
pw.close();
catch(Exception e)
     System.out.println(e);
Can anyone look this code and help me out where i am doing the mistake.
Thanks.

Similar Messages

  • Using USB NI-6008 on LV7.1 the results data has to be in Excel. It looks as cluster data format that i can not insert into excel VI

    I am Using USB 6008 with LV 7.1. The application is voltage logger and i would like to use excel and upload the data . The Columns will be the channels and the rows will be the data.
    The data comes from the DAQmx vi not like a simple string or an number it is kind of cluster data
    which contains strings and numbers and more for each measurement.
    I tryed to work with spraedshit and it goes ok but it is not conveniant to convert later to excel.
    Do you have a solution for that please?
    (How to extract the data from the cluster type format that is used with USB6008).
    TX arik
    Attachments:
    USB-6008-r3.vi ‏80 KB

    Arik:
    I hope all is well. If you are trying to write data to a text file along with the header information, you could do the following:
    1. Open a reference to a file and write the header information right away.
    2. Do your continuous acquisition (in a loop) using the 6008 and write the data to a file everytime.
    3. With the proper formatting, your colums will represent channels and your rows data.
    Please take a look at the attached example and let me know if you have any other questions.
    Regards,
    Rudi N.
    Attachments:
    WriteFilewHeaders.vi ‏64 KB

  • Pool data from text file and insert into database

    Can anyone tell me how to pool data from a text file and insert into database?
    let's say my text file is in this format
    123456 Peter 22
    234567 Nicholas 24
    345678 Jane 20
    Then I need to insert the all the value for this three column into a table which has the three column name ID, Name, Age
    Anyone knows? I need to do this urgently...Thank in advanced

    1. Use BufferedReader and read the file line by line.
    2. Loop thru the file and do the following steps with in this loop.
    3. Use StringTokenizer to seperate each line into three values (columns).
    4. Now create a insert statement with these values and add the statement to the batch (using addBatch() method of PreparedStatement or Statement).
    5. Finally (after exiting the loop), execute these batch of statements (using ps.executeBatch()).
    Sudha

  • Date not changing based on timezone during insert into database...

    I have a bpel project that gets data in GMT and insert into a database that's based on EST timezone...for some reason during insert into database, I expect it to reflect the time in EST time, but it's not doing so. It's a standard oracle bpel project and there was no customization to the date input. The following are the details:
    input data:
    <InvoiceDate>
    <GLogDate>20110613213249</GLogDate>
    <TZId>UTC</TZId>
    <TZOffset>+00:00</TZOffset>
    </InvoiceDate>
    date I get after transformation:
    <ns5:invoiceDate> 2011-06-13T21:32:49 </ns5:invoiceDate>
    date that gets inserted into the database:
    6/13/2011 9:32:49 PM
    Any thoughts as to what's going on? Is this the intended fuctionality or how does it adjust itself to the daylight saving? I thought database itself would handle it in this case.
    Thanks,
    Amkay

    WpgMom --
    From your description, it sounds totally like you are using Manually Scheduled tasks, which is not what you should be using in your project.  If you look at the Gantt bars in the Gantt Chart view of your project, if the Gantt bars are a turquoise color,
    you are using Manually Scheduled tasks, and that would be the reason that the dates do not automatically calculate for you.  If this is the case, click the Select All button to select every task in the project.  In the Tasks section of your Task
    ribbon, click the Auto Schedule button.  From this point forward, your project schedule will automatically recalculate every time you make any kind of schedule edit.
    Also, in the lower left corner of the Microsoft Project application window, you will probably see a button that says New Tasks: Manually Scheduled.  Click this button and select the Auto Scheduled option.
    To avoid all of these problems in all future projects, click File > Options.  In the Project Options dialog, click the Schedule tab.  In the Scheduling Options for This Project section, click the pick list where you see the name of your project
    and select the All New Projects item on the pick list.  Click the New Tasks Created pick list and select the Auto Scheduled option.  Click the OK button.
    Hope this helps.
    Dale A. Howard [MVP]

  • XML document convert into String and Insert into Database

    Hello all,
         In the FIle to File Scenario  I want to send the data to the Reciever System in xml Document and convert into String and insert into Database.
      Please can you tell me exact way how to send it.
    Thanks & Regards,
    Raj

    HI,
    As per my understanding your scenario is File to file where you will get output fiel in XML format.
    Now that XMl payload need to be passed as single string in the database via XI.
    You cauld do this but you need to imply some manipulations such as
    With the help of standard API you need to concatenate the  XML tags and create the structre along with the data.
    For e.g. in your outpuf file the XML structre contain data as
    <field1>ABCD</field1>
    Then in mapping
    The source field will be mappeda s concat(<field1>) + value of  Source field "ABCD" + concat(</field1>) to the target field.
    This is the way that you could achive the requirments else there is no direct way avaialble for it.
    thanks
    Swarup

  • Date/Time Field in Access 2000 - INSERT INTO ... syntax error

    I am using Labview 6.1 Professional with the Database Connectivity Toolkit. When I execute this SQL Command "INSERT INTO PRODUCTION (Part, Passed, Date) VALUES ('Part#1', 2, '10/10/2003 10:10:10 AM')" I get a Run-Time Syntax Error. If I remove the Date Label and Date Value it works. What is the proper Format of the Date/Time Type Field in ACCESS 2000 for Labview 6.1 SQL? I have seen and tried all of the solutions already posted like MSG 1ZNAJHJ6.

    Well, if it's any consolation handling dates is a pain regardless of which database you use. In any case, I created a table with the following definition:
    CREATE TABLE testing
    (item1 INTEGER,
    item2 DATE)
    I them did the following insert:
    INSERT INTO testing
    VALUES (1, '18/11/1953 04:20:00');
    And everything worked fine. Note that in the date (my Bday, BTW) the format is DD/MM/YYYY followed by the time.
    What exactly is the error you're getting? Can you post the exact text of the error message. Also, I ran my test using the examples that come with LabSQL--not the toolkit.
    Mike...
    Oops, just noticed something. You have a column name that is probibly a reserved word "Date". Try your insert as:
    INSERT INTO PRODUCTION
    VALUES
    ('Part#1', 2, '10/10/2003 10:10:10 AM')
    If there is only those three columns and they the order the data appears is the same as the column order, you don't need the column list. If this works (and it should--I just tried it) I would only view it as a temporary patch. The column name should be changed.
    This is also a good reason to not use the Access GUI to create tables. If you tried creating a table like that in SQL you would have gotten an error message. Learning to build tables in SQL code isn't hard and it adds an extra layer of error checking that the GUI apparently doesn't think is important.
    If you're interested let me know and I can send you the info on a really good book on SQL...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Trigger a process when a record is inserted into database

    Hi, could someone tell me how to do the following (if it's possible):
    when a record is inserted into a table in a database,
    I want it to somehow trigger an action which will put an item into user's To-Do inBox of the WorkSpace,
    the user can then open the form in the To-Do and use it to view the data in the newly inserted record.
    this "user"'s login ID is part of the inserted record.
    thanks

    Mmm, trigger?  I don't know of a way.
    But I supposed you could have a process that has a timer that peroidically queries the database for changes and then do the same thing.
    You could also perhaps write a Service and then use the Java API to start a process?
    Maybe take a look here
    http://blogs.adobe.com/livecycle/2010/12/how-to-invoke-a-livecycle-process-periodically.ht ml

  • Date format becomes incorrect when you run check option on portal

    Hi,
    We have a report which has Date variable in selection screen. When we enter selection as interval and then when we click on Check option before executing the report, the date format becomes garbage.
    Here is an example:
    This is what I enter in Date variable :
    Date : 01/01/2001-01/01/2010
    After that when I click on CHECK option, the system automatically converts the first date into garbage value i.e. 01/01/2001 will be converted to 1//20/01/0
    This only happens when we run report in Portal 7.0 When we try to run similar report using default web template of BW 3.5, it works fine.
    Has anybody faced similar problem ? We are on Portal Java SP13 with Patch 6.
    Thanks,
    Parin Gandhi.

    Thanks Frank for a quick reply.
    I have used the SimpleDateFormat for formatting with the pattern as, "MM/dd/yyyy" and it is working fine if user enters 4 digit year.
    However, for a entry with 2 digits for a year e.g. 04/10/07 when i parse the date using SimpleDateFormat,it is giving me date as 04/10/0007.
    Is there a way by means of which i could force the user to enter 4 digits for the year?
    I have tried using dateStyle attribute of <af:convertDateTime> tag with 'shortish' as its value, it converts a 2 digit year into 4digit on the browser side & displays on the screen e.g. if user enters 04/10/07 it will appear as 04/10/2007 on the screen however, in value change listener method, i could see date as 04/10/0007.
    Any help in this regard is highly appreciated.
    Thanks in advance,
    Shriniwas

  • Data is not inserted into database through OA-Page

    Hi all,
    I developed a region to store supplier additional information.In that region i'm able to enter data into fields and data is sucessfully stored into custom table.But when I embedded that region with Supplier-Address Book page(in R12) page through Personalization i'm facing a problem with inserting data into custom table.i.e After I entered data the data is not goes to custom table and the fields which are filled by data are also not cleared.
    Could anyone please help me..
    Thanks in Advance
    Edited by: user9970067 on Oct 13, 2009 12:15 PM

    Hi Nilesh,
    First I just created region in Jdeveloper and ran it from jdeveloper then it's working fine.After this I added custom region in seeded xml page file and then ran page from Jdeveloper,then the data is not saved into custom table.
    Steps I followed:
    1. I created an EO(oracle/apps/pos/supplier/server)
    2.Created VO based on above EO(oracle/apps/pos/supplier/server)
    3.Created AM based on VO(oracle/apps/pos/supplier/server)
    4.Created one Region based on this view instance.(oracle/apps/pos/supplier/webui)
    5.Created one CO for the above region.( compiled and ran this standalone region then it's working fine)
    6.Now I embedded the above region with the page which is located in oracle/apps/fnd/ framework/toolbox/tutorial/webui/SupplierSearchPG.xml through personalization.
    When I entered into customized region the "save " button in my region is not highlighted.only "GO" button in SupplierSearch is highlighted.when I click on "save" button in my custom region it's not calling the controller.
    could you please give me any solution for this.
    Thanks in Advance.

  • Change date format in EP when introduce values with "/" as date separator

    Hi experts,
    We have ECC 6 EHP3 with Enterprise Portal 7 SP 18. We instal BP_ERP5ESS
    1.31 SP 4.0, BP_ERP5COM 1.31 SP 4.0, BP_ERP5MSS 1.31 SP 4.0, SAP_ESS
    603 SP 4.12 and SAPPCUI_GP 603 SP 4.1
    We activate the Travel Management (FIN_TRAVEL_1) business function, so
    we use WD ABAP for travel expenses.
    The issue is when in the Portal, go to Travel and Expenses and create a
    new travel request or a new expense report and introduce the values of
    the date with "/" as separator. The system changes the date format, and
    change the days for months and months for days, DD/MM/YYYY change to
    MM/DD/YYYY. For example if we introduce 31/12/2009, the system change
    to 12/31/2009 and gives an error.
    If we introduce with "." as separator, 31.12.2009, it works fine, don´t change days for months, so it seems that is not a problem of language settings.
    Any idea?
    Thanks in advance,
    Manuel

    Hi,
    You can check the date formate in the portal.........
    log in by the Super Super give the user name ...........and check the details..........
    in there in the 1st ..view you can set the date formate..............

  • Parse xml data and insert into database

    Hi Friends,
    I have an xml document which needs to be parsed and the data need to be inserted into an oracle database table.
    Please tell me which will be the easiest and optimal way of doing this.
    Thanks,
    Achayan

    Take a look at the JDOM xml parsing library - google for JDOM download or something.
    This will allow you to build an object representation of the XML doc, from which you can then extract the data.
    J

  • How to execute a Java method when row inserted into a database table?

    I have the need to fire off a java method when a row is inserted into a database table. I am unfortunately working with MySQL which just recently supported triggers but these new triggers can not execute a Java application on any event.
    What I am looking for is an event driven approach such that when a row is inserted into a specific table I can fire off a java method (sitting in a tomcat container) that will take the contents and send it to a web service.
    It has been mentioned that JMS may have the ability to poll and monitor a database table. Just wondering if anyone could point me in the right direction.
    thanks
    JavaTek

    A service handler might be the right way to run some code at the end of a service call (another way would be to make use of filters).
    First, make sure your static table is merged with ServiceHandlers.
    Secondary, change your custom method name into one that is not already in the service definition of COLLECTION_COPY_LOT (preferably a unique method name like collectionCopyLotLastAction that describes its purpose) and remove the following line from your code:
    m_service.doCodeEx("",this);Now create a service definition for COLLECTION_COPY_LOT in your custom component based on the original COLLECTION_COPY_LOT (copy paste from the original service definition) and add you own method collectionCopyLotLastAction as the last step in the service. Play with the load order to make sure CS is using your service definition of COLLECTION_COPY_LOT instead of the original.
    regards,
    Fabian

  • Program to upload csv file to internal table and insert into database table

    Hi I'm writing a program where I need to upload a csv file into an internal table using gui_upload, but i also need this program to insert the data into my custom database table using the split command.  Anybody have any samples to help, its urgent!

    Hi,
    Check this table may be it will give u an hint...
    REPORT z_table_upload LINE-SIZE 255.
    Data
    DATA: it_dd03p TYPE TABLE OF dd03p,
          is_dd03p TYPE dd03p.
    DATA: it_rdata  TYPE TABLE OF text1024,
          is_rdata  TYPE text1024.
    DATA: it_fields TYPE TABLE OF fieldname.
    DATA: it_file  TYPE REF TO data,
          is_file  TYPE REF TO data.
    DATA: w_error  TYPE text132.
    Macros
    DEFINE write_error.
      concatenate 'Error: table'
                  p_table
                  &1
                  &2
             into w_error
             separated by space.
      condense w_error.
      write: / w_error.
      stop.
    END-OF-DEFINITION.
    Field symbols
    FIELD-SYMBOLS: <table> TYPE STANDARD TABLE,
                   <data>  TYPE ANY,
                   <fs>    TYPE ANY.
    Selection screen
    SELECTION-SCREEN: BEGIN OF BLOCK b01 WITH FRAME TITLE text-b01.
    PARAMETERS: p_file  TYPE localfile DEFAULT 'C:\temp\' OBLIGATORY,
                p_separ TYPE c DEFAULT ';' OBLIGATORY.
    SELECTION-SCREEN: END OF BLOCK b01.
    SELECTION-SCREEN: BEGIN OF BLOCK b02 WITH FRAME TITLE text-b02.
    PARAMETERS: p_table TYPE tabname OBLIGATORY
                                     MEMORY ID dtb
                                     MATCHCODE OBJECT dd_dbtb_16.
    SELECTION-SCREEN: END OF BLOCK b02.
    SELECTION-SCREEN: BEGIN OF BLOCK b03 WITH FRAME TITLE text-b03.
    PARAMETERS: p_create TYPE c AS CHECKBOX.
    SELECTION-SCREEN: END OF BLOCK b03,
                      SKIP.
    SELECTION-SCREEN: BEGIN OF BLOCK b04 WITH FRAME TITLE text-b04.
    PARAMETERS: p_nodb RADIOBUTTON GROUP g1 DEFAULT 'X'
                                   USER-COMMAND rg1,
                p_save RADIOBUTTON GROUP g1,
                p_dele RADIOBUTTON GROUP g1.
    SELECTION-SCREEN: SKIP.
    PARAMETERS: p_test TYPE c AS CHECKBOX,
                p_list TYPE c AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN: END OF BLOCK b04.
    At selection screen
    AT SELECTION-SCREEN.
      IF sy-ucomm = 'RG1'.
        IF p_nodb IS INITIAL.
          p_test = 'X'.
        ENDIF.
      ENDIF.
    At selection screen
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
           EXPORTING
                field_name = 'P_FILE'
           IMPORTING
                file_name  = p_file.
    Start of selection
    START-OF-SELECTION.
      PERFORM f_table_definition USING p_table.
      PERFORM f_upload_data USING p_file.
      PERFORM f_prepare_table USING p_table.
      PERFORM f_process_data.
      IF p_nodb IS INITIAL.
        PERFORM f_modify_table.
      ENDIF.
      IF p_list = 'X'.
        PERFORM f_list_records.
      ENDIF.
    End of selection
    END-OF-SELECTION.
          FORM f_table_definition                                       *
    -->  VALUE(IN_TABLE)                                               *
    FORM f_table_definition USING value(in_table).
      DATA: l_tname TYPE tabname,
            l_state TYPE ddgotstate,
            l_dd02v TYPE dd02v.
      l_tname = in_table.
      CALL FUNCTION 'DDIF_TABL_GET'
           EXPORTING
                name          = l_tname
           IMPORTING
                gotstate      = l_state
                dd02v_wa      = l_dd02v
           TABLES
                dd03p_tab     = it_dd03p
           EXCEPTIONS
                illegal_input = 1
                OTHERS        = 2.
      IF l_state NE 'A'.
        write_error 'does not exist or is not active' space.
      ENDIF.
      IF l_dd02v-tabclass NE 'TRANSP' AND
         l_dd02v-tabclass NE 'CLUSTER'.
        write_error 'is type' l_dd02v-tabclass.
      ENDIF.
    ENDFORM.
          FORM f_prepare_table                                          *
    -->  VALUE(IN_TABLE)                                               *
    FORM f_prepare_table USING value(in_table).
      DATA: l_tname TYPE tabname,
            lt_ftab TYPE lvc_t_fcat.
      l_tname = in_table.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
           EXPORTING
                i_structure_name = l_tname
           CHANGING
                ct_fieldcat      = lt_ftab
           EXCEPTIONS
                OTHERS           = 1.
      IF sy-subrc NE 0.
        WRITE: / 'Error while building field catalog'.
        STOP.
      ENDIF.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = lt_ftab
        IMPORTING
          ep_table        = it_file.
      ASSIGN it_file->* TO <table>.
      CREATE DATA is_file LIKE LINE OF <table>.
      ASSIGN is_file->* TO <data>.
    ENDFORM.
          FORM f_upload_data                                            *
    -->  VALUE(IN_FILE)                                                *
    FORM f_upload_data USING value(in_file).
      DATA: l_file    TYPE string,
            l_ltext   TYPE string.
      DATA: l_lengt   TYPE i,
            l_field   TYPE fieldname.
      DATA: l_missk   TYPE c.
      l_file = in_file.
      l_lengt = strlen( in_file ).
      FORMAT INTENSIFIED ON.
      WRITE: / 'Reading file', in_file(l_lengt).
      CALL FUNCTION 'GUI_UPLOAD'
           EXPORTING
                filename = l_file
                filetype = 'ASC'
           TABLES
                data_tab = it_rdata
           EXCEPTIONS
                OTHERS   = 1.
      IF sy-subrc <> 0.
        WRITE: /3 'Error uploading', l_file.
        STOP.
      ENDIF.
    File not empty
      DESCRIBE TABLE it_rdata LINES sy-tmaxl.
      IF sy-tmaxl = 0.
        WRITE: /3 'File', l_file, 'is empty'.
        STOP.
      ELSE.
        WRITE: '-', sy-tmaxl, 'rows read'.
      ENDIF.
    File header on first row
      READ TABLE it_rdata INTO is_rdata INDEX 1.
      l_ltext = is_rdata.
      WHILE l_ltext CS p_separ.
        SPLIT l_ltext AT p_separ INTO l_field l_ltext.
        APPEND l_field TO it_fields.
      ENDWHILE.
      IF sy-subrc = 0.
        l_field = l_ltext.
        APPEND l_field TO it_fields.
      ENDIF.
    Check all key fields are present
      SKIP.
      FORMAT RESET.
      FORMAT COLOR COL_HEADING.
      WRITE: /3 'Key fields'.
      FORMAT RESET.
      LOOP AT it_dd03p INTO is_dd03p WHERE NOT keyflag IS initial.
        WRITE: /3 is_dd03p-fieldname.
        READ TABLE it_fields WITH KEY table_line = is_dd03p-fieldname
                             TRANSPORTING NO FIELDS.
        IF sy-subrc = 0.
          FORMAT COLOR COL_POSITIVE.
          WRITE: 'ok'.
          FORMAT RESET.
        ELSEIF is_dd03p-datatype NE 'CLNT'.
          FORMAT COLOR COL_NEGATIVE.
          WRITE: 'error'.
          FORMAT RESET.
          l_missk = 'X'.
        ENDIF.
      ENDLOOP.
    Log other fields
      SKIP.
      FORMAT COLOR COL_HEADING.
      WRITE: /3 'Other fields'.
      FORMAT RESET.
      LOOP AT it_dd03p INTO is_dd03p WHERE keyflag IS initial.
        WRITE: /3 is_dd03p-fieldname.
        READ TABLE it_fields WITH KEY table_line = is_dd03p-fieldname
                             TRANSPORTING NO FIELDS.
        IF sy-subrc = 0.
          WRITE: 'X'.
        ENDIF.
      ENDLOOP.
    Missing key field
      IF l_missk = 'X'.
        SKIP.
        WRITE: /3 'Missing key fields - no further processing'.
        STOP.
      ENDIF.
    ENDFORM.
          FORM f_process_data                                           *
    FORM f_process_data.
      DATA: l_ltext TYPE string,
            l_stext TYPE text40,
            l_field TYPE fieldname,
            l_datat TYPE c.
      LOOP AT it_rdata INTO is_rdata FROM 2.
        l_ltext = is_rdata.
        LOOP AT it_fields INTO l_field.
          ASSIGN COMPONENT l_field OF STRUCTURE <data> TO <fs>.
          IF sy-subrc = 0.
          Field value comes from file, determine conversion
            DESCRIBE FIELD <fs> TYPE l_datat.
            CASE l_datat.
              WHEN 'N'.
                SPLIT l_ltext AT p_separ INTO l_stext l_ltext.
                WRITE l_stext TO <fs> RIGHT-JUSTIFIED.
                OVERLAY <fs> WITH '0000000000000000'.           "max 16
              WHEN 'P'.
                SPLIT l_ltext AT p_separ INTO l_stext l_ltext.
                TRANSLATE l_stext USING ',.'.
                <fs> = l_stext.
              WHEN 'F'.
                SPLIT l_ltext AT p_separ INTO l_stext l_ltext.
                TRANSLATE l_stext USING ',.'.
                <fs> = l_stext.
              WHEN 'D'.
                SPLIT l_ltext AT p_separ INTO l_stext l_ltext.
                TRANSLATE l_stext USING '/.-.'.
                CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
                     EXPORTING
                          date_external = l_stext
                     IMPORTING
                          date_internal = <fs>
                     EXCEPTIONS
                          OTHERS        = 1.
              WHEN 'T'.
                CALL FUNCTION 'CONVERT_TIME_INPUT'
                     EXPORTING
                          input  = l_stext
                     IMPORTING
                          output = <fs>
                     EXCEPTIONS
                          OTHERS = 1.
              WHEN OTHERS.
                SPLIT l_ltext AT p_separ INTO <fs> l_ltext.
            ENDCASE.
          ELSE.
            SHIFT l_ltext UP TO p_separ.
            SHIFT l_ltext.
          ENDIF.
        ENDLOOP.
        IF NOT <data> IS INITIAL.
          LOOP AT it_dd03p INTO is_dd03p WHERE datatype = 'CLNT'.
          This field is mandant
            ASSIGN COMPONENT is_dd03p-fieldname OF STRUCTURE <data>
                                                          TO <fs>.
            <fs> = sy-mandt.
          ENDLOOP.
          IF p_create = 'X'.
            IF is_dd03p-rollname = 'ERDAT'.
              ASSIGN COMPONENT is_dd03p-fieldname OF STRUCTURE <data>
                                                            TO <fs>.
              <fs> = sy-datum.
            ENDIF.
            IF is_dd03p-rollname = 'ERZET'.
              ASSIGN COMPONENT is_dd03p-fieldname OF STRUCTURE <data>
                                                            TO <fs>.
              <fs> = sy-uzeit.
            ENDIF.
            IF is_dd03p-rollname = 'ERNAM'.
              ASSIGN COMPONENT is_dd03p-fieldname OF STRUCTURE <data>
                                                            TO <fs>.
              <fs> = sy-uname.
            ENDIF.
          ENDIF.
          IF is_dd03p-rollname = 'AEDAT'.
            ASSIGN COMPONENT is_dd03p-fieldname OF STRUCTURE <data>
                                                          TO <fs>.
            <fs> = sy-datum.
          ENDIF.
          IF is_dd03p-rollname = 'AETIM'.
            ASSIGN COMPONENT is_dd03p-fieldname OF STRUCTURE <data>
                                                          TO <fs>.
            <fs> = sy-uzeit.
          ENDIF.
          IF is_dd03p-rollname = 'AENAM'.
            ASSIGN COMPONENT is_dd03p-fieldname OF STRUCTURE <data>
                                                          TO <fs>.
            <fs> = sy-uname.
          ENDIF.
          APPEND <data> TO <table>.
        ENDIF.
      ENDLOOP.
    ENDFORM.
          FORM f_modify_table                                           *
    FORM f_modify_table.
      SKIP.
      IF p_save = 'X'.
        MODIFY (p_table) FROM TABLE <table>.
      ELSEIF p_dele = 'X'.
        DELETE (p_table) FROM TABLE <table>.
      ELSE.
        EXIT.
      ENDIF.
      IF sy-subrc EQ 0.
        FORMAT COLOR COL_POSITIVE.
        IF p_save = 'X'.
          WRITE: /3 'Modify table OK'.
        ELSE.
          WRITE: /3 'Delete table OK'.
        ENDIF.
        FORMAT RESET.
        IF p_test IS INITIAL.
          COMMIT WORK.
        ELSE.
          ROLLBACK WORK.
          WRITE: '- test only, no update'.
        ENDIF.
      ELSE.
        FORMAT COLOR COL_NEGATIVE.
        WRITE: /3 'Error while modifying table'.
        FORMAT RESET.
      ENDIF.
    ENDFORM.
          FORM f_list_records                                           *
    FORM f_list_records.
      DATA: l_tleng TYPE i,
            l_lasti TYPE i,
            l_offst TYPE i.
    Output width
      l_tleng = 1.
      LOOP AT it_dd03p INTO is_dd03p.
        l_tleng = l_tleng + is_dd03p-outputlen.
        IF l_tleng LT sy-linsz.
          l_lasti = sy-tabix.
          l_tleng = l_tleng + 1.
        ELSE.
          l_tleng = l_tleng - is_dd03p-outputlen.
          EXIT.
        ENDIF.
      ENDLOOP.
    Output header
      SKIP.
      FORMAT COLOR COL_HEADING.
      WRITE: /3 'Contents'.
      FORMAT RESET.
      ULINE AT /3(l_tleng).
    Output records
      LOOP AT <table> ASSIGNING <data>.
        LOOP AT it_dd03p INTO is_dd03p FROM 1 TO l_lasti.
          IF is_dd03p-position = 1.
            WRITE: /3 sy-vline.
            l_offst = 3.
          ENDIF.
          ASSIGN COMPONENT is_dd03p-fieldname OF STRUCTURE <data> TO <fs>.
          l_offst = l_offst + 1.
          IF is_dd03p-decimals LE 2.
            WRITE: AT l_offst <fs>.
          ELSE.
            WRITE: AT l_offst <fs> DECIMALS 3.
          ENDIF.
          l_offst = l_offst + is_dd03p-outputlen.
          WRITE: AT l_offst sy-vline.
        ENDLOOP.
      ENDLOOP.
    Ouptut end
      ULINE AT /3(l_tleng).
    ENDFORM.
    Regards,
    Joy.

  • Error while insert into database using DB adpater for Field BLOB

    Hello All
    I am trying to tranfer data from Database A to Database B using Oracle DB adapter.
    Table of databse A contains field BLOB, which cotains the resume /doc file.After transformation in Database B format ,while invoking the DB adapter to insert, I am getting follwing error
    <bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="code"><code>null</code>
    </part><part name="summary"><summary>file:/u01/bpelvinc/product/10.1.3.1/OracleAS_1/bpel/domains/viapps/tmp/.bpel_ERecuit_Application_New_1.0_d1c2b2149a9e0c7c745279667ad1fc84.tmp/DB_APPL_111.wsdl [ DB_APPL_111_ptt::insert(RtmApplicantCollection) ] - WSIF JCA Execute of operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception.
    insert failed. Descriptor name: [DBAPPL111.RtmApplicant]. [Caused by: Error in encoded stream, got 2]
    ; nested exception is:
         ORABPEL-11616
    DBWriteInteractionSpec Execute Failed Exception.
    insert failed. Descriptor name: [DBAPPL111.RtmApplicant]. [Caused by: Error in encoded stream, got 2]
    Caused by Exception [TOPLINK-3001] (Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070608)): oracle.toplink.exceptions.ConversionException
    Exception Description: The object [xs:base64Binary 43524541544520544193B0D0A], of class [class java.lang.String], could not be converted to [class java.sql.Timestamp].
    Internal Exception: java.io.IOException: Error in encoded stream, got 2.
    </summary>
    </part><part name="detail"><detail>
    Exception Description: The object [xs:base64Binary 4352E616D65293B0D0A], of class [class java.lang.String], could not be converted to [class java.sql.Timestamp].
    Internal Exception: java.io.IOException: Error in encoded stream, got 2</detail>
    </part></bindingFault>
    Please let me know ,what are the possibilities.
    Thanks
    Satendra

    Hi...
    well... My flow goes like Pl/SQl ---> BPEL,
    Now PL/SQL code reads data from the Database A and Send it to BPEL which inserts into the Database B.
    with respest to above design, I found the problem in pl/sql block.
    Actually I am sending a BLOB field in the soap message. but some how pl/sql now ablt tot handle that or sending some wrong data.
    my question is how to send a blob filed data to bpel using pl/sql block. this the reasion I am getting above error.
    Thanks

  • Insert into database table

    Hi Guy's,
    Please help me, trying to insert the records into database table. when i debug the program work area contain  data records  but not insert into databse table.  Here pasted my code pls suggest me where i did mistake.
    FUNCTION ZEXM_PHOTOCOPYDTLS_EP.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(EXMCODE) TYPE  ZEXMCODE OPTIONAL
    *"     VALUE(EXMMONTH) TYPE  ZEXMMONTH OPTIONAL
    *"     VALUE(SEATNO) TYPE  ZSEATNO OPTIONAL
    *"     VALUE(STDFIRSTNAME) TYPE  ZSTDFIRSTNAME OPTIONAL
    *"     VALUE(STDMIDDLENAME) TYPE  ZSTDMIDDLENAME OPTIONAL
    *"     VALUE(STDLASTNAME) TYPE  ZSTDLASTNAME OPTIONAL
    *"     VALUE(ADDLINE1) TYPE  ZADDLINE1 OPTIONAL
    *"     VALUE(CITY) TYPE  ZCITY OPTIONAL
    *"     VALUE(COUNTRY) TYPE  ZCOUNTRY OPTIONAL
    *"     VALUE(PIN) TYPE  ZPIN OPTIONAL
    *"     VALUE(TELEPHONENO) TYPE  ZTELEPHONENO OPTIONAL
    *"     VALUE(MOBNO) TYPE  ZMOBNO OPTIONAL
    *"     VALUE(EMAIL) TYPE  ZEMAIL OPTIONAL
    *"     VALUE(DDNO) TYPE  ZDDNO OPTIONAL
    *"     VALUE(DDAMT) TYPE  ZDDAMOUNT OPTIONAL
    *"     VALUE(DDDATE) TYPE  ZDDDATE OPTIONAL
    *"     VALUE(BANKNAME) TYPE  ZBANKNAME OPTIONAL
    *"     VALUE(COLNAME) TYPE  ZCOLNAME OPTIONAL
    *"     VALUE(COLADDRESS) TYPE  ZCOLADDRESS OPTIONAL
    *"     VALUE(COURSECODE) TYPE  ZCOURSECODE OPTIONAL
    *"     VALUE(EXMYEAR) TYPE  ZEXMYEAR OPTIONAL
    *"     VALUE(PAPERCODE) TYPE  ZPAPERCODE OPTIONAL
    *"     VALUE(PAPERNO) TYPE  ZPAPERNO OPTIONAL
    *"     VALUE(MARKSOBT) TYPE  ZMARKSOBT OPTIONAL
    *"     VALUE(EXMDATE) TYPE  ZEXMDATE OPTIONAL
    *"     VALUE(EXMTIME) TYPE  ZEXMTIME OPTIONAL
    *"     VALUE(SUBCODE) TYPE  ZSUBCODE OPTIONAL
    *"  EXCEPTIONS
    *"      SELECTION_ERROR
      DATA : WA_OUTPUT TYPE  ZEXM_PHOTOCOPYDT,
             WA_COLL TYPE ZEXM_COLLEGEMST,
             WA_COURSE TYPE ZEXM_COURSEMST,
             WA_EXMCODE TYPE ZEXM_EXMCODEMST,
             WA_PAPER   TYPE ZEXM_PHOPAPERMAP,
             WA_SUBJECT TYPE  ZEXM_SUBJECTMST.
    STUDENT DETAILS
      MOVE : EXMCODE     TO WA_OUTPUT-ZEXMCODE,
             EXMMONTH    TO WA_OUTPUT-ZEXMMONTH,
             SEATNO    TO WA_OUTPUT-ZSEATNO,
             STDFIRSTNAME TO WA_OUTPUT-ZSTDFIRSTNAME,
             STDMIDDLENAME TO WA_OUTPUT-ZSTDMIDDLENAME,
             STDLASTNAME TO WA_OUTPUT-ZSTDLASTNAME,
             ADDLINE1    TO WA_OUTPUT-ZADDLINE1,
             CITY        TO WA_OUTPUT-ZCITY,
             COUNTRY     TO WA_OUTPUT-ZCOUNTRY,
             PIN         TO WA_OUTPUT-ZPIN,
             TELEPHONENO TO WA_OUTPUT-ZTELEPHONENO,
             MOBNO       TO WA_OUTPUT-ZMOBNO,
             EMAIL       TO WA_OUTPUT-ZEMAIL,
             DDNO        TO WA_OUTPUT-ZDDNO,
             DDAMT       TO WA_OUTPUT-ZDDAMT,
             DDDATE      TO WA_OUTPUT-ZDDDATE,
             BANKNAME    TO WA_OUTPUT-ZBANKNAME.
    insert into ZEXM_PHOTOCOPYDT values wa_output.
    if sy-subrc = 0.
    commit work.
    endif.
    Thanks and Regards,
    Sai.
    Edited by: sai shanhu on Jun 4, 2008 11:13 AM

    Hai,
    move wa_output into ZEXM_PHOTOCOPYDT.
    insert  ZEXM_PHOTOCOPYDT.
    Thanks,
    Durai.V

Maybe you are looking for

  • IR report value from function error

    i have ir report and one column value coming from function,when open the IR report its giving error.. IR report code SELECT CS_ID ,CS_NAME, Util_func(PASS_ID) as "ALERT_DAYS"   from "CSD_MASTERS" Function code FUNCTION  Util_func(PASS_ID NUMBER) RETU

  • Error when the time of create apllication in webdynpro abap

    hi,   when i am trying to create apllication for webdynpro component it shows the error message like 'you are not authorized to use transaction sicf '   in the status bar .  what is the problem and how can avoid this issue.

  • ITunes thinks podcasts are unplayed

    I use other methods to play the podcasts downloaded by iTunes (I use a Squeezebox). iTunes will stop automatically updating my subscriptions because it thinks I haven't played them since however long. Is there any way to tell iTunes to quit this obno

  • Re: ESS and MSS

    Hi Friends , Please share the ESS and MSS Configuration Steps with screen . Regards Jagan babu

  • Can't kill session with "Alter system kill session"?

    I'm using 9iR2. After I check the v$session table: SQL> select sid, serial# from v$session where username='XMLDEMO'; SID SERIAL# 18 19155 I issue the command: SQL> alter system kill session '18,19155' immediate; System altered. But after this, I stil