Need Sample Code in C#  to Insert,Update,Query data using W 2.0 wsdl

Hi,
Can anyone please share sample code in C# to Insert,Update,Query data using W 2.0 wsdl.
Thanks in advance

I have found solution.
Need add following line for non string data type.
objOutreachUpdateList.Opportunity[0].IndexedNumber0Specified = true;

Similar Messages

  • Need sample code with RV_INVOICE_CREATE used

    Hi everybody!
    I need sample code with RV_INVOICE_CREATE or similar FMs used.
    The thing is that I do not know how to populate parametres of this and other invoicing FMs....
    For example, there are some tables to be passed to RV_INVOICE_CREATE
         TABLES
              XKOMFK     = XKOMFK
              XKOMV       = XKOMV
              XTHEAD      = XTHEAD
              XVBFS        = XVBFS
              XVBPA        = XVBPA
              XVBRK        = XVBRK
              XVBRP        = XVBRP
              XVBSS        = XVBSS
    How to populate them? I mean how to fill them with needed values?
    Useful answers will be awarded.
    Kind regards, M.

    RV_INVOICE_CREATE is the function module to create invoice based on delivery .
    when you pass delivery number ,it will create invoice ,see the invoice number in vf02,vf03 transaction. and also see the data vbrk,vbrp tables
    I have done this development and i have cancelled invoice,reverse goods issue,updated the delivery and again i am createing invoice..see the below progrm to get better understanding.
    REPORT ZWM_OVERWEIGHT_FIX  no standard page heading
                               message-id zwm.
    ======================================================================
    Program Name : ZWM_OVERWEIGHT_FIX                                    *
    Description  : Tool to fix Overweight in delivery line item,         *
                   Used All Function module to cancel invoice ,          *
                   Reverse the goods issue  ,Update Delivery qty,Create  *
                   invoice                                               *
    Author       : Seshu                                                 *
    Date         : 05/08/2007                                            *
    MODIFICATION HISTORY                                                 *
    DATE    | AUTHOR   | CHANGE #   | DESCRIPTION OF MODIFICATION        *
    --|||--
    05/08/07| Seshu    | DEVK921979 | Initial                            *
    D A T A - D E C L A R A T I O N     *******************
    Tables
    Tables : vbak,
             vbap,
             vbfa,
             likp,
             lips,
             vbrk,
             vbrp.
    Internal Tables
    data : i_lips like lips occurs 0 with header line,
           i_vbap like vbap occurs 0 with header line.
    Variables
    data : v_deliv like vbfa-vbelv,
           v_invoic like vbfa-vbelv.
    Data Declaration Part for Post Goods Issue
    DATA: l_vbeln LIKE likp-vbeln,
          l_vbkok LIKE vbkok,
          i_prot LIKE prott OCCURS 0 WITH HEADER LINE,
          ef_error_any_0 TYPE c,
          ef_error_in_item_deletion_0 TYPE c,
          ef_error_in_pod_update_0 TYPE c,
          ef_error_in_interface_0 TYPE c,
          ef_error_in_goods_issue_0 TYPE c,
          ef_error_in_final_check_0 TYPE c,
          d_return   LIKE bapireturn1.
    Internal tables for BAPI Function Module
    data : i_cret like BAPIRETURN1 occurs 0 with header line,
           i_csucess like BAPIVBRKSUCcESS occurs 0 with header line,
           i_ret2 like bapiret2 ,
           flag type c,
           i_mesg like mesg occurs 0 with header line.
    Data Declaration for Invoice Creation
    DATA: VBSK_I     LIKE  VBSK.
    data: d_success  type  c.
    DATA: XKOMFK LIKE      KOMFK   OCCURS 0 WITH HEADER LINE,
          XKOMV  LIKE      KOMV    OCCURS 0 WITH HEADER LINE,
          XTHEAD LIKE      THEADVB OCCURS 0 WITH HEADER LINE,
          XVBFS  LIKE      VBFS    OCCURS 0 WITH HEADER LINE,
          XVBPA  LIKE      VBPAVB  OCCURS 0 WITH HEADER LINE,
          XVBRK  LIKE      VBRKVB  OCCURS 0 WITH HEADER LINE,
          XVBRP  LIKE      VBRPVB  OCCURS 0 WITH HEADER LINE,
          XVBSS  LIKE      VBSS    OCCURS 0 WITH HEADER LINE,
          XKOMFKGN LIKE    KOMFKGN OCCURS 0 WITH HEADER LINE.
    S E L E C T I O N  -  S C R E E N   ******************
    Selection-screen
    Selection-screen : begin of block blk with frame title text-001.
    parameters : p_vbeln like vbak-vbeln obligatory.
    selection-screen : end of block blk.
    A T -  S E L E C T I O N  - S C R E E N ***************
    Validation on Sales order
    at selection-screen on p_vbeln.
    Check the data on VBAK Table
      select single vbeln from vbak into vbak-vbeln
                                where vbeln = p_vbeln.
      if sy-subrc ne 0.
        message e006 with p_vbeln.
      endif.
    S T A R T  - O F - S E L E C T I O N *******************
    Start-of-selection.
      break sreddy.
    Get the Invoice Number corresponding Sales Order Number
      perform get_invoice.
    Step 1.
    Cancel the Invoice  - Transaction VF11
      perform cancel_invoice.
    Reverse the goods issue
      perform reverse_goodsissue.
    Get the Order and Delivery Items
      perform get_sales_deliv.
    Delivery Change
      perform Delivery_change.
    Create Invoice document
      perform invoice_create.
    E N D  -  O F -  S E L E C T I O N  *******************
    end-of-selection.
    if flag = 'X'.
    message i012 with p_vbeln.
    endif.
    *&      Form  get_invoice
          Get Invoice Number
    FORM get_invoice.
    Clear Variables
      clear : v_deliv,
              v_invoic,
              flag.
    Get the Delivery Number First
      select single vbeln from vbfa into v_deliv
                               where vbelv = p_vbeln
                               and   vbtyp_n = 'J'.
      if sy-subrc ne 0.
        message i004 with p_vbeln.
        stop.
      endif.
    Get the Invoice Number
      select single vbeln from vbfa into v_invoic
                               where vbelv = p_vbeln
                               and   vbtyp_n = 'M'.
      if sy-subrc ne 0.
        message i003 with p_vbeln.
        stop.
      endif.
    ENDFORM.                    " get_invoice
    *&      Form  cancel_invoice
          Cancel the Invoice
    FORM cancel_invoice.
      clear : i_ret2,
              i_cret,
              i_csucess.
      refresh : i_cret,
                i_csucess.
      CALL FUNCTION 'BAPI_BILLINGDOC_CANCEL1'
        EXPORTING
          BILLINGDOCUMENT       = v_invoic
      TESTRUN               =
      NO_COMMIT             =
      BILLINGDATE           =
        TABLES
          RETURN                = i_cret
          SUCCESS               = i_csucess
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
           EXPORTING
                WAIT   = space
           IMPORTING
                RETURN = i_ret2.
    read table i_cret with key type = 'E'.
      if sy-subrc ne 0.
        message i005 with v_invoic.
        stop.
      endif.
    ENDFORM.                    " cancel_invoice
    *&      Form  reverse_goodsissue
          Reverse the goods Issue
    FORM reverse_goodsissue.
    Local Variable
      data : lv_vbtyp like likp-vbtyp.
      clear : i_mesg,
              lv_vbtyp.
      refresh : i_mesg.
      select single vbtyp from likp into lv_vbtyp
                               where vbeln = v_deliv.
      CALL FUNCTION 'WS_REVERSE_GOODS_ISSUE'
        EXPORTING
          I_VBELN                         = v_deliv
          I_BUDAT                         = sy-datum
        I_COUNT                         =
        I_MBLNR                         =
        I_TCODE                         =
          I_VBTYP                         = lv_vbtyp
        TABLES
          T_MESG                          = i_mesg
       EXCEPTIONS
         ERROR_REVERSE_GOODS_ISSUE       = 1
         OTHERS                          = 2
      if sy-subrc ne 0.
        message i007 with v_deliv.
      endif.
    ENDFORM.                    " reverse_goodsissue
    *&      Form  get_sales_deliv
          Get the Sales order and Deliv Items
    FORM get_sales_deliv.
    Local Variables
      data : lv_kwmeng like vbap-kwmeng.
      clear : i_lips,
              i_vbap.
      refresh : i_lips,
                i_vbap.
    Select the data from LIPS
      select * from lips into table i_lips
                         where vbeln = v_deliv.
      if sy-subrc ne 0.
        message i008 with v_deliv.
        stop.
      endif.
      sort i_lips by vbeln posnr.
      Get the Sales order Item Data.
      select * from vbap into table i_vbap
                              where vbeln = p_vbeln.
      if sy-subrc ne 0.
        message i006 with p_vbeln.
        stop.
      endif.
      sort i_vbap by vbeln posnr.
    Compare delivery Item and Order Items
      loop at i_lips.
        clear lv_kwmeng.
        read table i_vbap with key posnr = i_lips-posnr.
        if sy-subrc eq 0.
          lv_kwmeng = i_vbap-kwmeng * 2.
          if lv_kwmeng >= i_lips-lfimg.
            i_lips-lfimg = i_vbap-kwmeng.
            modify i_lips.
          endif.
        endif.
      endloop.
    ENDFORM.                    " get_sales_deliv
    *&      Form  Delivery_change
          Delivery Update
    FORM Delivery_change.
      Clear : i_prot.
      refresh : i_prot.
    Delivery Update
      CALL FUNCTION 'LE_MOB_DELIVERY_UPDATE'
           EXPORTING
                do_commit                = 'X'
           TABLES
                t_delivery_items         = i_lips
                prot                     = i_prot
           EXCEPTIONS
                conversion_overflow      = 1
                essential_data_missing   = 2
                error                    = 3
                nothing_to_update        = 4
                lock_after_update_failed = 5
                error_in_delivery_update = 6
                OTHERS                   = 7.
      COMMIT WORK.
      IF sy-subrc <> 0.
        MESSAGE i009 with v_deliv.
      endif.
    Post Goods Issue
      CLEAR:    d_return,
                i_prot,
                l_vbeln,
                l_vbkok.
      REFRESH i_prot.
      CLEAR:  ef_error_in_item_deletion_0    ,
              ef_error_in_pod_update_0       ,
              ef_error_in_interface_0        ,
              ef_error_in_goods_issue_0      ,
              ef_error_in_final_check_0      .
    carry out goods issue
      l_vbeln          = v_deliv.
      l_vbkok-vbeln_vl = l_vbeln.
      l_vbkok-wabuc    = 'X'.
    carry out goods issue
      l_vbeln          = v_deliv.
      l_vbkok-vbeln_vl = l_vbeln.
      l_vbkok-wabuc    = 'X'.
    SET UPDATE TASK LOCAL.
      CALL FUNCTION 'WS_DELIVERY_UPDATE'
           EXPORTING
                vbkok_wa                    = l_vbkok
                synchron                    = 'X'
                no_messages_update          = ' '
                update_picking              = 'X'
                commit                      = 'X'
                delivery                    = l_vbeln
                nicht_sperren               = 'X'
                if_error_messages_send_0    = space
           IMPORTING
                ef_error_any_0              = ef_error_any_0
                ef_error_in_item_deletion_0 = ef_error_in_item_deletion_0
                ef_error_in_pod_update_0    = ef_error_in_pod_update_0
                ef_error_in_interface_0     = ef_error_in_interface_0
                ef_error_in_goods_issue_0   = ef_error_in_goods_issue_0
                ef_error_in_final_check_0   = ef_error_in_final_check_0
           TABLES
                prot                        = i_prot
           EXCEPTIONS
                error_message               = 1
                OTHERS                      = 2.
      if sy-subrc ne 0.
        message i010 with v_deliv.
      else.
        COMMIT WORK .
      endif.
    ENDFORM.                    " Delivery_change
    *&      Form  invoice_create
          Invoice Creation
    FORM invoice_create.
      refresh: XKOMFK, XKOMV,
               XTHEAD, XVBFS,
               XVBPA,  XVBRK,
               XVBRP,  XVBSS.
      clear  : XKOMFK, XKOMV,
               XTHEAD, XVBFS,
               XVBPA,  XVBRK,
               XVBRP,  XVBSS,
               VBSK_I.
      VBSK_I-SMART = 'F'.
      XKOMFK-VBELN =  v_deliv.
      XKOMFK-VBTYP = 'J'.
      APPEND XKOMFK.
      CALL FUNCTION 'RV_INVOICE_CREATE'
           EXPORTING
                VBSK_I       = VBSK_I
                WITH_POSTING = 'C'
           TABLES
                XKOMFK       = XKOMFK
                XKOMV        = XKOMV
                XTHEAD       = XTHEAD
                XVBFS        = XVBFS
                XVBPA        = XVBPA
                XVBRK        = XVBRK
                XVBRP        = XVBRP
                XVBSS        = XVBSS.
      if sy-subrc eq 0.
        COMMIT WORK.
       flag = 'X'.
      else.
      message i011 with p_vbeln.
      endif.
    ENDFORM.                    " invoice_create
    Reward Points if it is helpful
    Thanks
    Seshu

  • Need Sample Code for Vendor creation using JAVA API

    Hi,
    I have a scenario like Vendor creation using <b>Java API</b>.
    1.I have Vendors (Main) Table.
    2.I have <b>look up</b> tables like Account Group.
    3.Also <b>Qualifier table</b>(Phone numbers) too.
    Could you please give me the sample code which helps me to create Vendor records using Java API?
    <b>I need Code samples which should cover all of the above scenario.</b>
    <b>Marks will be given for the relevent answers.</b>
    Best Regards
    PK Devaraj

    Hi Devraj,
    I hope the below code might solve all your problem:-
    //Adding Qualified field
    //Creating empty record in Qualifed table 
    //Adding No Qualifiers
    Record qualified_record = RecordFactory.createEmptyRecord(new TableId(<TableId>));
    try {
    qualified_record.setFieldValue(new FieldId(<fieldId of NoQualifier), new StringValue(<StringValue>));//Adding No Qualifier
    catch (IllegalArgumentException e2) {
    // TODO Auto-generated catch block
    e2.printStackTrace();
    catch (MdmValueTypeException e2) {
    // TODO Auto-generated catch block
    e2.printStackTrace();
    //Creating Record in Qualified table
    CreateRecordCommand create_command = new CreateRecordCommand(connections);
    create_command.setSession(sessionId);
    create_command.setRecord(qualified_record);
    try
    create_command.execute();
    catch(Exception e)
    System.out.println(e.toString());
    RecordId record_id = create_command.getRecord().getId();
    //Adding the new record to Qualifed Lookup value and setting the Yes Qualifiers
    QualifiedLookupValue lookup_value = new QualifiedLookupValue();
    int link = lookup_value.createQualifiedLink(new QualifiedLinkValue(record_id));
    //Adding Yes Qualifiers
    lookup_value.setQualifierFieldValue(0 , new FieldId(<FieldID of Yes Qualifier>) , new StringValue(<StringValue>));
    //Now adding LookUP values
    //Fetch the RecordID of the value selected by user using the following function
    public RecordId getRecordID(ConnectionPool connections , String sessionID , String value , String Fieldid , String tableid)
    ResultDefinition rsd = new ResultDefinition(new TableId(tableid));
    rsd.addSelectField(new FieldId(Fieldid));
    StringValue [] val = new StringValue[1];
    val[0] = new StringValue(value);
    RetrieveRecordsByValueCommand val_command = new RetrieveRecordsByValueCommand(connections);
    val_command.setSession(sessionID);
    val_command.setResultDefinition(rsd);
    val_command.setFieldId(new FieldId(Fieldid));
    val_command.setFieldValues(val);
    try
         val_command.execute();
    catch(Exception e)
    RecordResultSet result_set = val_command.getRecords();
    RecordId id = null;
    if(result_set.getCount()>0)
         for(int i = 0 ; i < result_set.getCount() ; i++)
         id = result_set.getRecord(i).getId();     
    return id;
    //Finally creating the record in Main table
    com.sap.mdm.data.Record empty_record = RecordFactory.createEmptyRecord(new TableId("T1"));
    try {
         empty_record.setFieldValue(new FieldId(<FieldId of text field in Main table>),new StringValue(<StringValue>));
         empty_record.setFieldValue(new FieldId(<FieldId of lookup field in Main table>), new LookupValue(<RecordID of the value retrieved using the above getRecordID function>));
    empty_record.setFieldValue(new FieldId(<FieldId of Qualified field in Main table>), new QualifiedLookupValue(<lookup_value>));//QualifiedLookUp  value Retrieved above
    } catch (IllegalArgumentException e1) {
    // TODO Auto-generated catch block
         e1.printStackTrace();
    } catch (MdmValueTypeException e1) {
         // TODO Auto-generated catch block
         e1.printStackTrace();
    //Actually creating the record in Main table
    CreateRecordCommand create_main_command = new CreateRecordCommand(connections);
    create_main_command.setSession(sessionId);
    create_main_command.setRecord(empty_record);
    try
         create_main_command.execute();
    catch(Exception e)
         System.out.println(e.toString());
    Thanks
    Namrata

  • Fetch Insert / Update Query From Table Trigger

    Hi everyone !,
    I have a situation, is there any way where I can get insert/update query by before-insert / after insert trigger when a user inserts/updates any row in the table.
    Plz....help me....champs.....
    Regards,
    Naushad

    That was a nice thing but it works only on some oracle 9i with DML statements.
    On database versions 9.2.0.1 to 9.2.0.6 ora_sql_text works and returns the calling text for dml triggers, where as starting from 9.2.0.7 the behavior has changed and returns NULL.
    Cause
    This issue had surfaced from 9.2.0.7.0 patchset. After discussions in Bug 4171597 which was closed as a duplicate of Bug 4230721 it was concluded that it was the expected behavior i.e ORA_SQL_TXT should return null when dml triggers are used.
    ORA_SQL_TXT is a "System defined event attribute" and is supposed to work only with "System triggers". This is also what the Documentation says - "Application Developers Guide : Fundamentals(9.2)
    Chapter 16 Working with System events".
    Bye Alessandro

  • Query regarding Update the data using application

    I have scenario i need to update single record in the the application and insert into a table
    for example
    SELECT ContactID,FirstName,MiddleName,LastName,Description FROM Contact
    Contact table contains 4 columns as explained. in the application there is one tab called Contact where it displays Above information
    and description is non editable.
    Now the new requirement has come user can update the description information and save information in a new column say 'Description1'
    that means new column needs to be added in the db and also necessary changes needs to be done at the application side
    For ex :SELECT ContactID,FirstName,MiddleName,LastName,Description,Description1 FROM Contact
    Now when user views the contact table it should display description info by default from 'description' table.
    If he edits he should see edited data from 'description1' table.
    Can any body guide me please and send me sample update query please, and the logic should if updated data is there display that data from
     'description1' table other wise display from  'description' table
    Smash126

    Hi Smash126,
    You need to fire the update command once you have filled the description record. It should happen on the primary key column of the record.
    For Example: 
    UPDATE Contact
    SET Description  = 'New Description',
    Description1 = 'New Description'
    where contactID = <<ContactID from application>>
    This way both will updated to same value, and next time you will get the updated value.
    Here is some ADO.Net links:
    http://www.codeproject.com/Articles/1155/Simple-ADO-NET-Database-Read-Insert-Update-and-Del
    http://www.onlinebuff.com/article_step-by-step-select-insert-update-and-delete-using-aspnet-c-and-adonet_32.html
    Regards Harsh

  • I want single update query without use the function.

    I want to update sells_table selling_code field with max date product_code from product table.
    In product table there is multiple product_code date wise.
    I have been done it with below quey with the use of function but can we do it in only one update query
    without use the function.
    UPDATE sells_table
    SET selling_code = MAXDATEPRODUCT(ctd_vpk_product_code)
    WHERE NVL(update_product_flag,0) = 0 ;
    CREATE OR REPLACE FUNCTION HVL.maxdateproduct (p_product IN VARCHAR2) RETURN NUMBER
    IS
    max_date_product VARCHAR2 (100);
    BEGIN
    BEGIN
    SELECT NVL (TRIM (product_code), 0)
    INTO max_date_product
    FROM (SELECT product_code, xref_end_dt
    FROM product
    WHERE TO_NUMBER (p_product) = pr.item_id
    ORDER BY xref_end_dt DESC)
    WHERE ROWNUM = 1; -- It will return only one row - max date product code
    EXCEPTION
    WHEN OTHERS
    THEN
    RETURN 0;
    END;
    RETURN max_date_product;
    END maxdateproduct;
    Thanks in Advance.

    Hi,
    Something like this.
    update setlls_table st
            set selling_code =(select nvl(trim(product_code)) from 
                                  (select product_code
                                          , rank() over (partition by item_id order by xref_end_dt DESC) rn
                                       from product
                                   ) pr
                                   where rn =1
                                         and pr.item_id = st.ctd_vpk_product_code
                               ) where NVL(update_product_flag,0) = 0 ;As such not tested due to lack of input sample.
    Regards
    Anurag Tibrewal.

  • Updating spatial data USING JAVA

    I want to update spatial data using java.Does anyone know how can i do this;;;
    for example i have created the following table.
    CREATE TABLE customers (
    customer_id NUMBER,
    last_name VARCHAR2(30),
    first_name VARCHAR2(30),
    street_address VARCHAR2(40),
    city VARCHAR2(30),
    state_province_code VARCHAR2(2),
    postal_code VARCHAR2(9),
    cust_geo_location SDO_GEOMETRY);
    HOW CAN I UPDATE THE FIELD:cust_geo_location,
    WHICH TYPE IS: SDO_GEOMETRY;;;;;
    I wrote a programm in java, which updates the FIELD CUSTOMER_ID.
    ( rset.absolute(3);
    rset.updateInt("CUSTOMER_ID",2222 );
    CUSTOMER_ID = rset.getInt("CUSTOMER_ID");
    rset.next();
    rset.updateRow(); ).
    ---------- THE FULL JAVA PROGRAMM
    import java.sql.*;
    import java.io.*;
    import java.util.Date;
    public class update{
    public static void main (String args [])
    throws SQLException, IOException
    System.out.println ("Loading Oracle driver");
    try {
    Class.forName ("oracle.jdbc.driver.OracleDriver");
    catch (ClassNotFoundException e)
    System.out.println ("Could not load the driver");
    e.printStackTrace ();
    System.out.println ("Connecting to the local database");
    try{
    Connection conn =
    DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:XE", "sp", "spgianna");
    Statement stmt = conn.createStatement (ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_UPDATABLE);
    // String LAST_NAME,FIRST_NAME ;
    int CUSTOMER_ID ;
    ResultSet rset = stmt.executeQuery("SELECT CUSTOMER_ID FROM CUSTOMERS");
    /* while ( rset.next() ) {
    CUSTOMER_ID = rset.getInt("CUSTOMER_ID");
    LAST_NAME = rset.getString("LAST_NAME");
    FIRST_NAME = rset.getString("FIRST_NAME");
    System.out.println( CUSTOMER_ID+""+LAST_NAME + " " +FIRST_NAME);
    rset.absolute(3);
    rset.updateInt("CUSTOMER_ID",2222 );
    CUSTOMER_ID = rset.getInt("CUSTOMER_ID");
    rset.next();
    rset.updateRow();
    System.out.println(CUSTOMER_ID);
    catch(SQLException sqle) {
    System.out.println("SQL Exception encountered: " );
    } catch(Exception e) {
    System.out.println("Unexpected Exception: " );
    HOW CAN I UPDATE THE FIELD:cust_geo_location,
    WHICH TYPE IS: SDO_GEOMETRY;;;;;;;;;;;;;;

    Hi Guys,
    Dont forget to close your stmt and connection after execution
    Use this as a template if you like:
    try{
         /**make connection**/
         ServerConnection sc = new ServerConnection();
    Statement stmt = sc.conn.createStatement();
    /**create statement & execute**/
    String insertstmt = "insert into .......";
    //execute
    stmt.execute(insertstmt);
    /**Close and catch exception**/
    stmt.close();
    sc.conn.close();
    catch(SQLException sqlE){
         sqlE.printStackTrace();
         System.out.println(sqlE.getMessage());
    As for the string "insertstmt" itself, this is where your standard SQL statement goes
    So get it working using a standard SQL editor first, then copy and paste it in to this string variable. The string should be a series of concatenated strings and variables to recreate the SQL atatement in Java. For example
    the SQL statement:
    insert into Mytable(SESSIONID, TIME1) values ('300', '4.45pm' );
    assuming the values are stored in variables called 'sessionnumber' and 'time'
    will become
    String stmt =
    "insert into Mytable(SESSIONID, TIME1) values ('"+sessionnumber+"', '"+time+"')";
    Hope this helps.
    E
    Ps. Do a system.out.println after you create the stmt. The statement printed out to the console should be a valid SQL statement that you can use in your editor. (minus the ;)
    ...keep working on the string until you can do this.

  • 'Stale data error' is encountered while trying to update the data using EO.

    Hi,
    I am getting the following error when I am trying to update the data using EO:
    '' Unable to perform transaction on the record. \nCause: The record contains stale data. The record has been modified by another user. \nAction: Cancel the transaction and re-query the record to get the new data."
    I have tried clearing the corresponding VO cache and have also used the "getTransaction().setClearCacheOnCommit(true)" method in the AM, but the error persists.
    Kindly suggest some work around for this problem.

    Chirag,
    this error is usually.... thrown by framework, if some other user has updated the same record you are trying to update by your EO, just check db, and try for a different record!
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Pleasee Help , URGENTT , Need sample code

    We should upload Sales Order XML File into OA Tables everyday .
    As I am very new to XML I request to give complete sample code ( giving just the logic needs time to understand, very urgent..)
    The current XML File can have mutilpe one sales order and each sales order can have many lines .Each line can have multiple taxes.
    Pls give the sample Code which you think is the best approach.
    I have used xpath(may not be right)
    I want to insert Parent Node / Child Node / Grand Child Done as one set of data.
    I used Xpath syntax , when I give the Parent node path in for loop, it inserts all parent nodes data at one time into the table , similarly all child nodes at one time .
    So I am unable to link grand child record with child record and parent record.
    To be specific , I am unable to trace these are the tax records for this line from this order.
    I have used xpath. I have loaded the xml file into table with clob variable
    l_OrderRequest_nodelist := xslprocessor.selectNodes(xmldom.makeNode(l_doc), '/Recordset');
    FOR rec IN 0 .. xmldom.getlength(l_OrderRequest_nodelist) -1 loop l_OrderRequest_node := xmldom.item(l_OrderRequest_nodelist,
    rec);
    end loop;
    we are not validating Sales order XML File with DTD or XSD .
    Please give sample code for parent / child /grandchild .
    Below is the sample file.
    - <Recordset>
    - <Header dueDate="2007-01-17T16:09:05" orderDate="2004-01-17" orderID="0009" transactionID="1389" type="new">
    <KeyIndex>2</KeyIndex>
    - <BillTo>
    - <Address addressID="5619" isoCountryCode="US">
    <Name>fMat</Name>
    - <PostalAddress name="default">
    <Street>34545</Street>
    <City>dfgfg</City>
    <State>AZ</State>
    <PostalCode>85086-1693</PostalCode>
    <County>Maricopa</County>
    <Country>US</Country>
    </PostalAddress>
    <Email name="default">[email protected]</Email>
    </Address>
    </BillTo>
    <PromotionCode />
    - <SubTotal>
    <Money currency="USD">32.49</Money>
    </SubTotal>
    - <Tax>
    <Money currency="USD">2.32</Money>
    <Description />
    </Tax>
    - <Shipping>
    <Money currency="USD">8.95</Money>
    <Description />
    </Shipping>
    </Header>
    - <Detail lineNumber="1" quantity="1">
    - <ItemDetail>
    - <UnitPrice>
    <Money currency="USD">29.99</Money>
    </UnitPrice>
    <ShortName>Little;reg; pxxxx® Learning System</ShortName>
    </ItemDetail>
    - <Tax>
    <Money currency="USD">1.68</Money>
    <Description />
    - <TaxDetail category="sales">
    - <TaxAmount>
    <Money currency="USD">1.68</Money>
    </TaxAmount>
    <TaxLocation>AZ</TaxLocation>
    </TaxDetail>
    </Tax>
    </Detail>
    - <Detail lineNumber="2" quantity="1">
    - <ItemDetail>
    - <UnitPrice>
    <Money currency="USD">29.99</Money>
    </UnitPrice>
    <ShortName>Little;reg; pxxxx® Learning System</ShortName>
    </ItemDetail>
    - <Tax>
    <Money currency="USD">1.68</Money>
    <Description />
    - <TaxDetail category="sales">
    - <TaxAmount>
    <Money currency="USD">1.68</Money>
    </TaxAmount>
    <TaxLocation>AZ</TaxLocation>
    </TaxDetail>
    </Tax>
    - <Tax>
    <Money currency="USD">0.68</Money>
    <Description />
    - <TaxDetail category="sales">
    - <TaxAmount>
    <Money currency="USD">0.68</Money>
    </TaxAmount>
    <TaxLocation>DISTRICT</TaxLocation>
    </TaxDetail>
    </Tax>
    </Detail>
    </Recordset>
    We are working on Oracle9i Enterprise Edition Release 9.2.0.6.0
    Thanks in Adv
    Kal

    Hi
    here is a quick demo:
    DATA: a,b, result(10).
    IF a IS Initial.
      Result = 'yes'.
    ELSEIF NOT a IS Initial AND NOT b is initial.
      Result = 'no'.
    Else.
    RESULT = 'abc'.
    ENDIF.

  • Need sample code to get handle of Selected rows from ADF Table

    Hi,
    I am new to ADF. I have an ADF table based on VO object.On some button action,I need to get handle of selected rows in application module.
    If anybody is having sample code to do this then please share with me.
    Thanks,
    ashok

    wow now link http://blogs.oracle.com/smuenchadf/examples/#134 is working.thanks a lot.
    also the link http://baigsorcl.blogspot.com/2010/06/deleting-multi-selected-rows-from-adf.html is very useful. Thanks a lot for Sameh Nassar too.He made it clear that in 11g Select column is not available for a ADF table and provided a solution to get Select column.
    Thanks,
    ashok

  • Need Sample code to upload the data to Application Server

    Hi ,
    I need to upload the data to application server.
    The output should be an XML file.
    Can anybody send me sample code for this.
    Reward points are assured.
    Best Regards
    Bhagat.

    may be this code wil help ,first to downjload the XML fine -
    1)
    REPORT  zhr_test2_tk.
    TYPE-POOLS: ixml.
    TYPES: BEGIN OF xml_line,
            data(256) TYPE x,
           END OF xml_line.
    DATA: l_ixml            TYPE REF TO if_ixml,
          l_streamfactory   TYPE REF TO if_ixml_stream_factory,
          l_ostream         TYPE REF TO if_ixml_ostream,
          l_renderer        TYPE REF TO if_ixml_renderer,
          l_document        TYPE REF TO if_ixml_document.
    DATA: l_element_position TYPE REF TO if_ixml_element,
          l_element_title    TYPE REF TO if_ixml_element,
           l_element_flight  TYPE REF TO if_ixml_element,
           l_element_from    TYPE REF TO if_ixml_element,
           l_element_to      TYPE REF TO if_ixml_element,
            l_element_dummy   TYPE REF TO if_ixml_element,
             l_value           TYPE string.
    DATA: l_xml_table       TYPE TABLE OF xml_line,
          l_xml_size        TYPE i,
          l_rc              TYPE i.
    DATA: lt_erec TYPE TABLE OF hrp5126,
          l_erec TYPE hrp5126.
    DATA: date(10),
          time(4),
          filepath TYPE string.
    CONSTANTS: filedir TYPE string VALUE 'C:\tmp\',
               filename TYPE string VALUE 'ZHR_test'.
    START-OF-SELECTION.
    fill internal table
      SELECT * FROM hrp5126 INTO TABLE lt_erec.
    Start filling xml DOM object from internal table lt_erec.
      LOOP AT lt_erec INTO l_erec.
    *Create the root node 'position'
        IF sy-tabix EQ 1.
        create an ixml factory
          l_ixml = cl_ixml=>create( ).
        create Document Object Model
          l_document = l_ixml->create_document( ).
       Fill root node with value 'position'
          l_element_position = l_document->create_simple_element(
                         name   = 'position'
                         parent = l_document ).
        ENDIF.
        IF sy-tabix GT 1.
        create element jobtitle as child of position
          l_value = l_erec-jobtitle.
          l_element_title = l_document->create_simple_element(
                             name   = 'job_title'
                             parent = l_element_position
                             value  = l_value ).
          l_value = l_erec-empl_start_date.
          l_element_dummy = l_document->create_simple_element(
                             name   = 'StartDate'
                             parent = l_element_title
                             value  = l_value ).
          l_value = l_erec-empl_end_date.
          l_element_dummy = l_document->create_simple_element(
                             name   = 'EndDate'
                             parent = l_element_title
                             value  = l_value ).
        ENDIF.
      ENDLOOP.
      IF sy-subrc NE 0.
        WRITE: 'No data in table hrp5125'.
      ENDIF.
    create a stream factory
      l_streamfactory = l_ixml->create_stream_factory( ).
    connect internal XML table to streamfactory
      l_ostream = l_streamfactory->create_ostream_itable(
                      table = l_xml_table ).
    render the document
      l_renderer = l_ixml->create_renderer( ostream  = l_ostream
                                            document = l_document ).
      l_rc = l_renderer->render( ).
    Get time and date
      WRITE sy-uzeit2(2) TO time2(2).
      WRITE sy-uzeit0(2) TO time0(2).
      WRITE sy-datum4(2) TO date0(2).
      WRITE sy-datum6(2) TO date2(2).
      WRITE sy-datum0(4) TO date4(4).
    *Build filename with date and time reference
    CONCATENATE filedir filename date time '.xml' INTO filepath.
    <i>* This is the code I hope to modify in order to save the xml structure on the application server, with a specified filepath.</i>
    <b>  OPEN DATASET filepath FOR OUTPUT IN BINARY MODE.
      LOOP AT lt_erec into l_erec.
        TRANSFER  l_erec TO filepath.
      ENDLOOP.
      CLOSE DATASET filepath.</b>
    save XML document
      l_xml_size = l_ostream->get_num_written_raw( ).
    *This is the code for download to local computer
    CALL METHOD cl_gui_frontend_services=>gui_download
       EXPORTING
         bin_filesize            = l_xml_size
         filename                = filepath
         filetype                = 'BIN'
       CHANGING
         data_tab                = l_xml_table
       EXCEPTIONS
         file_write_error        = 1
         no_batch                = 2
         gui_refuse_filetransfer = 3
         invalid_type            = 4
         no_authority            = 5
         unknown_error           = 6
         header_not_allowed      = 7
         separator_not_allowed   = 8
         filesize_not_allowed    = 9
         header_too_long         = 10
         dp_error_create         = 11
         dp_error_send           = 12
         dp_error_write          = 13
         unknown_dp_error        = 14
         access_denied           = 15
         dp_out_of_memory        = 16
         disk_full               = 17
         dp_timeout              = 18
         file_not_found          = 19
         dataprovider_exception  = 20
         control_flush_error     = 21
         OTHERS                  = 22.
    IF sy-subrc <> 0.
       MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    2) uploading tht PC XML file to APPliaction server -
    DATA rec like QISRS_XML_LINE.
    OPEN DATASET filepath FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    LOOP AT l_xml_table into rec.
    TRANSFER rec TO filepath.
    ENDLOOP.
    CLOSE DATASET filepath.

  • Need sample code in webdynpro for java

    Hi all
    actually i have one webdynpro form which is having multiple input elements. for example name,address,phoneno,price quantity and amount. and there is update button for that form.
    when i click the update button the multiplication of quantity and price value will be updated by in one input field which is part of the another webdynpro form is part of the same view.
    i want to update the input field in another form only when i change the value of either price or quantity otherwise the value of inputfield in another form should be same.
    now how do we retrieve the event of either price or quantity inputfield which only changes rather than changes of name or adreess.
    only when i modify the value of price or quantity in form and updated button then only the multiplication will be reflected in inputfield of another form.i dont want to reflect that inputfield of another form when i changes of other inputfields except price or quantity.
    please provide the sample code on the same...especially how to retrieve the event of that price or quantity in a form..
    Regards
    Suresh babu

    Hi Suresh,
    please post your issue to the Web Dynpro forum.
    Greetings,
    Carsten

  • Need sample code using windows BitBlt() function to display image in CVI

    Hello all,
    I need a sample code which uses windows BitBlt() function to display image in CVI
    Thank you.
    Bob.

    Hello Bob -
    I'm curious why you'd like to use BitBlt.  What functionality does it offer that you've not seen in the CVI canvas control?
    It's hard to say without knowing what transitions you're looking for, but the canvas is very capable of animating/transitioning.  The place it can fall a little short is if you require access to the alpha channel for transparency.
    I put together a short demo for you - maybe it will address some of what you're looking for.  The important functions are CanvasStartBatchDraw, CanvasEndBatchDraw, and CanvasDrawBitmap.  The animation/transition is driven by a simple UI timer.
    Let me know if you have any questions -
    NickB
    National Instruments
    Attachments:
    CanvasAnimation.zip ‏10 KB

  • Need sample code to connect MDM using JCA

    hi friends,
    I want to connect MDM server using JCA
    can you please provide me the sample code for that.
    Regards,
    Venki

    Hello Venki,
    why do you want to use JCo for connecting to MDM? MDM has its own specific Java API for this task. There's no need for using JCo at all.
    BR Michael.

  • Need sample code to connect MDM using JCO

    hi friends,
    I want to connect MDM server using JCO,
    can you please provide me the sample code for that.
    Regards,
    Venki.

    Hello Venki,
    why do you want to use JCo for connecting to MDM? MDM has its own specific Java API for this task. There's no need for using JCo at all.
    BR Michael.

Maybe you are looking for