DatabaseTransaction Handling--JDBC Adapter

Hi,
I am on XI 3,SP9. We are trying to delete all the records from the table first and then Insert Records into the table.
I have definted seperate Statements for the Database Table Delete and INSERT in my XML Schema for the Receiver JDBC Adapter.
The Problem: After Deleting if there is an Error in the INSERT the Adapter does NOT do a Rollback but it Auto-commits.
Can someone tell me how do I stop this? I want to bundle both the Delete and Insert into 1 transaction. Any help would be appreciated.
Here is the output XML from the adpater:
<?xml version="1.0" encoding="UTF-8" ?>
- <ns:root xmlns:ns="urn:genentech:xi:fin_int_056:costcenters:sap_to_adaytum">
- <StatementName1>
<FI_OUT_COST_CENTER action="DELETE" />
</StatementName1>
+ <StatementName2>
- <FI_OUT_COST_CENTER action="INSERT">
- <access>
<COST_CENTER_ID>0001</COST_CENTER_ID>
<COST_CENTER_NAME>Standard Hierarchy CO Area 0001</COST_CENTER_NAME>
<PARENT_ID />
<ELEMENT_LEVEL>0</ELEMENT_LEVEL>
<TYPE>G</TYPE>
<START_DATE>19970101</START_DATE>
<CLIENT>200</CLIENT>
</access>
</FI_OUT_COST_CENTER>
</StatementName2>
- <StatementName2>
+ <FI_OUT_COST_CENTER action="INSERT">
- <access>
<COST_CENTER_ID>0001-1</COST_CENTER_ID>
<COST_CENTER_NAME>Administration</COST_CENTER_NAME>
<PARENT_ID>0001</PARENT_ID>
<ELEMENT_LEVEL>1</ELEMENT_LEVEL>
<TYPE>G</TYPE>
<START_DATE>19970101</START_DATE>
<CLIENT>200</CLIENT>
</access>
</FI_OUT_COST_CENTER>
</StatementName2>
- <StatementName2>
- <FI_OUT_COST_CENTER action="INSERT">
+ <access>
<COST_CENTER_ID>0001-1-1</COST_CENTER_ID>
<COST_CENTER_NAME>Executive</COST_CENTER_NAME>
<PARENT_ID>0001-1</PARENT_ID>
<ELEMENT_LEVEL>2</ELEMENT_LEVEL>
<TYPE>G</TYPE>
<START_DATE>19970101</START_DATE>
<CLIENT>200</CLIENT>
</access>
</FI_OUT_COST_CENTER>
</StatementName2>
+ <StatementName2>
- <FI_OUT_COST_CENTER action="INSERT">
- <access>
<COST_CENTER_ID>SAP-DUMMY</COST_CENTER_ID>
<COST_CENTER_NAME>SAP dummy</COST_CENTER_NAME>
<PARENT_ID>0001-1-1</PARENT_ID>
<ELEMENT_LEVEL>3</ELEMENT_LEVEL>
<TYPE>C</TYPE>
<START_DATE>19970101</START_DATE>
<CLIENT>200</CLIENT>
</access>
</FI_OUT_COST_CENTER>
</StatementName2>
Thanks
Ashish

Hi,
I have XI 3.0 with SP10 Installed.
We do not have the JDBC Transaction handling enabled.
So how did it work for you? I do not have the Auto-Commit  checkbox enabled.
Here is my sample xml:
If there is any error in the INSERT, THE DELETE does NOT rollback. Please advice.
<?xml version="1.0" encoding="UTF-8" ?>
- <ns18:root xmlns:ns18="urn:genentech:xi:fin_int_010:wbs:sap_to_adaytumroot">
- <statement1>
- <db_fi_out_wbs action="DELETE">
  <table>FI_OUT_WBS</table>
  </db_fi_out_wbs>
  </statement1>
- <statement2>
- <db_fi_out_wbs action="UPDATE_INSERT">
  <table>FI_OUT_WBS</table>
- <access>
  <OBJECT_TYPE>P</OBJECT_TYPE>
  <PROJECT_TYPE />
  <ELEMENT_ID>100</ELEMENT_ID>
  <ELEMENT_NAME>ASHISH SINGH</ELEMENT_NAME>
  <PARENT_ID />
  <SEARCH1 />
  <SEARCH2 />
  <KRON />
  <LABR />
  <CLIENT>200</CLIENT>
  <DATE_CREATED>28-Feb-2005</DATE_CREATED>
  </access>
- <key>
  <OBJECT_TYPE>P</OBJECT_TYPE>
  <ELEMENT_ID>100</ELEMENT_ID>
  <CLIENT>200</CLIENT>
  </key>
  </db_fi_out_wbs>
  </statement2>
- <statement2>
- <db_fi_out_wbs action="UPDATE_INSERT">
  <table>FI_OUT_WBS</table>
- <access>
  <OBJECT_TYPE>P</OBJECT_TYPE>
  <PROJECT_TYPE />
  <ELEMENT_ID>1000</ELEMENT_ID>
  <ELEMENT_NAME />
  <PARENT_ID />
  <SEARCH1 />
  <SEARCH2 />
  <KRON />
  <LABR />
  <CLIENT>200</CLIENT>
  <DATE_CREATED>28-Feb-2005</DATE_CREATED>
  </access>
- <key>
  <OBJECT_TYPE>P</OBJECT_TYPE>
  <ELEMENT_ID>1000</ELEMENT_ID>
  <CLIENT>200</CLIENT>
  </key>
  </db_fi_out_wbs>
  </statement2>
- <statement2>
- <db_fi_out_wbs action="UPDATE_INSERT">
  <table>FI_OUT_WBS</table>
- <access>
  <OBJECT_TYPE>P</OBJECT_TYPE>
  <PROJECT_TYPE />
  <ELEMENT_ID>10000</ELEMENT_ID>
  <ELEMENT_NAME>SY Test</ELEMENT_NAME>
  <PARENT_ID />
  <SEARCH1 />
  <SEARCH2 />
  <KRON />
  <LABR />
  <CLIENT>200</CLIENT>
  <DATE_CREATED>28-Feb-2005</DATE_CREATED>
  </access>
- <key>
  <OBJECT_TYPE>P</OBJECT_TYPE>
  <ELEMENT_ID>10000</ELEMENT_ID>
  <CLIENT>200</CLIENT>
  </key>
  </db_fi_out_wbs>
  </statement2>
- <statement2>
- <db_fi_out_wbs action="UPDATE_INSERT">
  <table>FI_OUT_WBS</table>
- <access>
  <OBJECT_TYPE>W</OBJECT_TYPE>
  <PROJECT_TYPE>01</PROJECT_TYPE>
  <ELEMENT_ID>10000</ELEMENT_ID>
  <ELEMENT_NAME>SY Test</ELEMENT_NAME>
  <PARENT_ID />
  <SEARCH1 />
  <SEARCH2 />
  <KRON />
  <LABR />
  <CLIENT>200</CLIENT>
  <DATE_CREATED>28-Feb-2005</DATE_CREATED>
  </access>
- <key>
  <OBJECT_TYPE>W</OBJECT_TYPE>
  <ELEMENT_ID>10000</ELEMENT_ID>
  <CLIENT>200</CLIENT>
  </key>
  </db_fi_out_wbs>
  </statement2>
- <statement2>
- <db_fi_out_wbs action="UPDATE_INSERT">
  <table>FI_OUT_WBS</table>
- <access>
  <OBJECT_TYPE>W</OBJECT_TYPE>
  <PROJECT_TYPE>01</PROJECT_TYPE>
  <ELEMENT_ID>10000.01</ELEMENT_ID>
  <ELEMENT_NAME>SY Test</ELEMENT_NAME>
  <PARENT_ID>10000</PARENT_ID>
  <SEARCH1>U Field 2</SEARCH1>
  <SEARCH2 />
  <KRON />
  <LABR />
  <CLIENT>200</CLIENT>
  <DATE_CREATED>28-Feb-2005</DATE_CREATED>
  </access>
- <key>
  <OBJECT_TYPE>W</OBJECT_TYPE>
  <ELEMENT_ID>10000.01</ELEMENT_ID>
  <CLIENT>200</CLIENT>
  </key>
  </db_fi_out_wbs>
  </statement2>
- <statement2>
- <db_fi_out_wbs action="UPDATE_INSERT">
  <table>FI_OUT_WBS</table>
- <access>
  <OBJECT_TYPE>W</OBJECT_TYPE>
  <PROJECT_TYPE>01</PROJECT_TYPE>
  <ELEMENT_ID>10000.01.0001</ELEMENT_ID>
  <ELEMENT_NAME>SY Test</ELEMENT_NAME>
  <PARENT_ID>10000.01</PARENT_ID>
  <SEARCH1>U Field 2</SEARCH1>
  <SEARCH2 />
  <KRON />
  <LABR />
  <CLIENT>200</CLIENT>
  <DATE_CREATED>28-Feb-2005</DATE_CREATED>
  </access>
- <key>
  <OBJECT_TYPE>W</OBJECT_TYPE>
  <ELEMENT_ID>10000.01.0001</ELEMENT_ID>
  <CLIENT>200</CLIENT>
  </key>
  </db_fi_out_wbs>
  </statement2>
- <statement2>
- <db_fi_out_wbs action="UPDATE_INSERT">
  <table>FI_OUT_WBS</table>
- <access>
  <OBJECT_TYPE>W</OBJECT_TYPE>
  <PROJECT_TYPE>01</PROJECT_TYPE>
  <ELEMENT_ID>10000.01.0001.0001</ELEMENT_ID>
  <ELEMENT_NAME>SY Test</ELEMENT_NAME>
  <PARENT_ID>10000.01.0001</PARENT_ID>
  <SEARCH1>U Field 2</SEARCH1>
  <SEARCH2 />
  <KRON />
  <LABR />
  <CLIENT>200</CLIENT>
  <DATE_CREATED>28-Feb-2005</DATE_CREATED>
  </access>
- <key>
  <OBJECT_TYPE>W</OBJECT_TYPE>
  <ELEMENT_ID>10000.01.0001.0001</ELEMENT_ID>
  <CLIENT>200</CLIENT>
  </key>
  </db_fi_out_wbs>
  </statement2>
- <statement2>
- <db_fi_out_wbs action="UPDATE_INSERT">
  <table>FI_OUT_WBS</table>
- <access>
  <OBJECT_TYPE>P</OBJECT_TYPE>
  <PROJECT_TYPE />
  <ELEMENT_ID>10001</ELEMENT_ID>
  <ELEMENT_NAME>2H7 Immunology</ELEMENT_NAME>
  <PARENT_ID />
  <SEARCH1 />
  <SEARCH2 />
  <KRON />
  <LABR />
  <CLIENT>200</CLIENT>
  <DATE_CREATED>28-Feb-2005</DATE_CREATED>
  </access>
- <key>
  <OBJECT_TYPE>P</OBJECT_TYPE>
  <ELEMENT_ID>10001</ELEMENT_ID>
  <CLIENT>200</CLIENT>
  </key>
  </db_fi_out_wbs>
  </statement2>
- <statement2>
- <db_fi_out_wbs action="UPDATE_INSERT">
  <table>FI_OUT_WBS</table>
- <access>
  <OBJECT_TYPE>P</OBJECT_TYPE>
  <PROJECT_TYPE />
  <ELEMENT_ID>10002</ELEMENT_ID>
  <ELEMENT_NAME>SY Test</ELEMENT_NAME>
  <PARENT_ID />
  <SEARCH1 />
  <SEARCH2 />
  <KRON />
  <LABR />
  <CLIENT>200</CLIENT>
  <DATE_CREATED>28-Feb-2005</DATE_CREATED>
  </access>

Similar Messages

  • Handling JDBC adapter errors in BPM

    Hi,
    I am using BPM to insert data in SQL server using a snychronous send.However i am not able to trap the adapter errors like server is down or could not insert because of key violation.
    Hence i decided to use transport level ack. But i understand that error description is returned in fault messages. Can i use fault messages in BPM???
    And also if that is not possible, I would like to know how can i configure alerts in JDBC adapter.
    Thanks in advance.

    Anand,
    I dont think this is possible. Fault Messages should be sent by the Application System back to XI , the Database in our case. AFAIK< the database cannot send back such fault messages and the error message is trapped in the JDBC adapters log. Try using Adapter Engine Alerts and this will cause the Message to be passed to your ALert framework from the adapter.
    Regards,
    Bhavesh

  • How to handle BLOB field in receiver JDBC adapter into ABAP table

    Dear Experts,
    I am working in a synchronous scenario with Sender ABAP Proxy to Oracle Database as receiver via SAP PO 7.4.I will be calling a stored procedure view with fields ID, NAME,Age,*** and BLOB (Image binary).
    1. The response from Oracle Database field BLOB is to be stored in ABAP table.Would I have to write any JAVA program to read the BLOB or the receiver JDBC adapter will handle it and store in a table by using ABAP proxy once it reaches ECC.
    2. If yes, would the JAVA program have to deal with other 4 fields.
    3. Can I use a UDF mapping to this BLOB field.
    Regards
    Rebecca...

    Dear Praveen,
    Thanks for your response...
    Please correct me if I am wrong.
    1. For 1-1 response mapping for BLOB field, I will use just use the below UDF code.
    public static byte[] hexStringToByteArray(String s) { 
                int len = s.length(); 
                byte[] data = new byte[len / 2]; 
                for (int i = 0; i < len; i += 2) { 
                            data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) 
                                                                                         + Character.digit(s.charAt(i+1), 16)); 
                return data; 
    2. ===Using the byte data, create binary attachment in mapping for abap proxy response===
    Could you please share how to create the binary attachment.. I am not clear
    Regards...

  • Oracle Receiver JDBC Adapter - Handling Unicode Characters

    We have an IDOC to JDBC scenario.
    In this IDOC is sending data like -  10/14u2019/P7 After 4 there is special character coming from SAP ( It is not single quote).
    Mapping is going through OK and data is getting saved in Oracle Database as 10/14&#x19;/P7 with & # x 19;
    I came across following solution in forums and SAP Note.
    I am not sure how to modify Oracle JDBC URL to handle Unicode characters properly.
    Or is there any other approach we can follow to achieve this..
    Any input is really appreciated
    Q: I am inserting Unicode data into a database table or selecting Unicode data from a table. However, the data inserted into or retrieved from the table appears garbled. Why doesn't the JDBC Adapter handle Unicode correctly?
    A: While the JDBC Adapter is Unicode-aware, many JDBC drivers and/or database management systems aren't by default and need a codepage or Unicode-awareness to be configured explicitly. For the respective JDBC drivers, this codepage setting is often configured via the driver URL. For details, refer to the documentation of your JDBC driver or database management system.

    Hi Simona,
    1.To start the visual admin, execute "go" file:
    On Windows: Run \usr\sap\<SAPSID>\JC<xx>\j2ee\admin\go.bat
    On UNIX: Run /usr/sap/<SAPSID>/JC<xx>/j2ee/admin/go
    2.supply the credentials to login into visual admin
    3.under "cluster" tab select "server node"
    4.you will find "log viewer" under "services"
    Since you are new, I recommend you to take help from your BASIS team.
    Hope it helps !
    Hi Alwin,
    Just a quick clarification.
    I used the URL you have mentioned, when we were on SP5. After that we upgraded to SP9.
    From SP9, if you try to use the URL http://XISERVER:50000/AdapterFramework then it automatically redirects to a new webpage with the link to the URL i have mentioned.
    Regards,
    Sridhar

  • Exactly-Once Handling in Receiver JDBC Adapter

    Hi,
    I have doubt abt Exactly-Once Handling in Receiver JDBC Adapter.
    For Conflict Resolution as Database.
    Why there is need to define table as below ?
    In the database where the write-to tables are located you must create an additional table with two columns for this purpose. To define the table, specify the following:
    Database Table Name
    Enter the name of the table.
    Key Column Name
    Enter the name of the column in which the key is entered.
    Value Column Name
    Enter the name of the column in which the key value is entered.
    Please explain in simple language.

    Hi Abhishake,
    Thanks for your reply.
    I understant that the tables needs to be created in DB.
    But if you read the SAP Docs for conflict resolution. My undestanding is "During Database commit if AS Java is terminated then the message will be in unknown state, for this type of messgaes when the AS Java restarted the behaviour is defined by this parameters. If the message doesn't have primary key, then there is probablity when AS Java will try second time it may get the message in DB so a message can be duplicated. To avoid this condition it is mentioned that you must create additional table with three column".
    Please correct my understanding if I am wrong.
    My additional table needs to create & how it will resolve the problem.
    Thanks in advance.

  • JDBC Adapter - transaction handling

    Hi,
    I have a question. I use graphical Message Mapping and standard documents formats for Receiver JDBC Adapter.
    Now I need to push a delete call and insert calls in one message looks like that one f.e.:
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_CostcentreUpdate xmlns:ns0="http://rtl.de/xi/TransCostcenter">
    - <StmName>
    - <dbTableName action="DELETE">
      <table>KOSTENSTELLEN</table>
      </dbTableName>
    - <dbTableName action="INSERT">
      <table>KOSTENSTELLEN</table>
    - <access>
      <KOSTL>0000001000</KOSTL>
      <GUELTVON>2005-09-01</GUELTVON>
      <GUELTBIS>9999-12-31</GUELTBIS>
      <ABTEI>Test1</ABTEI>
      <VERAK>Name1</VERAK>
      <KHINR>K1000_1010</KHINR>
      <KTEXT>Test1</KTEXT>
      </access>
    - <access>
      <KOSTL>0000001001</KOSTL>
      <GUELTVON>2005-03-01</GUELTVON>
      <GUELTBIS>9999-12-31</GUELTBIS>
      <ABTEI>Test1</ABTEI>
      <VERAK>Name2</VERAK>
      <KHINR>K1000_1010</KHINR>
      <KTEXT>Test2</KTEXT>
      </access>
    - <access>
      <KOSTL>0000001006</KOSTL>
      <GUELTVON>2006-04-01</GUELTVON>
      <GUELTBIS>9999-12-31</GUELTBIS>
      <ABTEI>Test1</ABTEI>
      <VERAK>Name3</VERAK>
      <KHINR>K1000_1010</KHINR>
      <KTEXT>Test3</KTEXT>
      </access>
      </dbTableName>
    </StmName>
    </ns0:MT_CostcentreUpdate>
    Because I need to do both (delete & insert) in one transaction mode. But i will not work at the moment
    I always get error:
    com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'KOSTENSTELLEN' (structure 'StmName'): java.sql.SQLException: FATAL ERROR document format: invalid level 5' found (structure 'StmName')
    Thanks for any help
    Matt

    Hi Matthias,
    you need to have two statements (StmName), one for delete, one for insert.
    Regards,
    Udo

  • Transaction handling in sender JDBC adapter

    Hello,
    In a scenario where a third party application updates a field (counting it up) and we pick up these counts and zero out the field with the sender JDBC adapter, we would like that the third party application is not able to update while the JDBC sender adapter is processing.
    We were under the assumption that the select and update statements of the sender JDBC adapter where executed within the same DB transaction and set the isolation level to "repeatable read" to make sure the third party app. could  not update while the adapter is processing.
    This had no effect.
    Do the select and update statement occur within the same transaction?
    Thanks,
    Dan
    Edited by: Dan Hansen on May 5, 2008 9:58 AM

    Thanks for the answers so far, I have looked through this and can find no reason why the current set up with "repeatable_read" should not work... a little more info. We are running against a MSSQL 2005 database using a table with the following structure.
    CREATE TABLE [dbo].[OPERATION] (
         [WERKS] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
         [AUFNR] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
         [VORNR] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
         [SSAVD] [datetime] NULL ,
         [ARBPL] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
         [MGVRG] [bigint] NULL ,
         [LMNGA] [bigint] NULL ,
         [LTXA1] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
         [ZCONFQTY] [numeric](18, 0) NULL ,
         [ZTIMESTAMP] [datetime] NULL ,
         [ZSTATUS] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
         [STAT] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
         [SSEVD] [datetime] NULL ,
         [FSEVD] [datetime] NULL ,
         [FSAVD] [datetime] NULL ,
         [XMNGA] [bigint] NULL ,
         [RMNGA] [bigint] NULL ,
         [RUECK] [bigint] NULL ,
         [ZPACKQTY] [bigint] NOT NULL ,
         [STEUS] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
         [ZSCRAPQTY] [numeric](18, 0) NULL ,
         [ZREWORKQTY] [numeric](18, 0) NULL ,
         [BEARZ] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
         [BEAZE] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
         [RUEST] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
         [RSTZE] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
    ) ON [PRIMARY]
    GO
    We read information about the quantities per primary key combination with the select statement where the ZSTATUS field is "CONF" and then zero out the quantity field and set the ZSTATUS to CONF2SAP with the update statement.
    Another app counts up the quantities and sets the ZSTATUS to CONF as needed.
    Sometimes we see that we miss a count because we read before someone has increased the quantity but update back after they did and thereby zero out their entry.

  • How to handle the BOLB column Using JDBC adapter

    Hi,
      I want to sending of a BOLB column from a DB2 database table to another DB2 database, and the sender and receiver both by using JDBC adapter. The two tables in each other database have the same columns.
      Here is the table's structure:
      <ID>string type</ID>
      <PDF>blob type</PDF>
      Also, i haved create two DataTypes in PI system.
      Sender DataType:
      ns:DT_PDF_Req xmlns:ns="http://XXXXX.com/sap/xi">
       <row>
         <ID>1</ID>
         <PDF></PDF>
       </row>
      </ns:DT_PDF_Req>
      Receiver DataType:
      <ns0:DT_PDF_Res xmlns:ns0="http://XXXX.com/sap/xi">
      <STMT>
      <dbtable action="INSERT">
      <table>tablename</table>
      <access>
       <ID></ID>
       <PDF></PDF>
      </access>
      </dbtable>
      </STMT>
      </ns0:DT_PDF_Res>
    When test this interface, i found the that we can get the data, but when execute the insert stms  the follow errors occured  in RWB :
    <ERROR>
    Could not execute statement for table/stored proc. "DBDPUSER.pdf" (structure "STMT") due to com.ibm.db2.jcc.b.nm: DB2 SQL Error: SQLCODE=-103, SQLSTATE=42604, SQLERRMC=255044462d312e330a25c7ec8fa20a352030206f626a0a3c3c2f4c656e677468203620, DRIVER=3.50.153
    JDBC Message processing failed, due to Error processing request in sax parser: Error when executing statement for table/stored proc. 'DBDPUSER.pdf' (structure 'STMT'): com.ibm.db2.jcc.b.nm: DB2 SQL Error: SQLCODE=-103, SQLSTATE=42604, SQLERRMC=255044462d312e330a25c7ec8fa20a352030206f626a0a3c3c2f4c656e677468203620, DRIVER=3.50.153
    </ERROR>
    Can anybody tell me how to resolve the problems?
    And tell me about how to deal BOLB column using PI.
    Best Regards
    Terry

    Hi Terry Qin,
    I understand, you are getting below XML from sender JDBC channel. But when you getting SAX parser error, in receiver JDBC.
    <ns:DT_PDF_Req xmlns:ns="http://XXXXX.com/sap/xi">
    <row>
    <ID>1</ID>
    <PDF></PDF>
    </row>
    </ns:DT_PDF_Req>
    I think it is because the XML which is going to receiver JDBC channel is not well formed (because pdf can containg < & characters).
    You can achive this sceanrio, by selecting receiver JDBC channel as Message Protocol "Native SQL Format" [Link1|http://help.sap.com/saphelp_nwpi711/helpdata/en/44/7c24a75cf83672e10000000a114a6b/frameset.htm] you can send non XML to receiver channel.
    Before that, you have convert above input XML into SQL statement, using Java Mapping.
    Regards,
    Raghu_Vamsee

  • Error in calling stored procedure in sender JDBC adapter

    Hi Experts,
    I am working on MySQl to SAP scenario. I have to use stored procedure in sender JDBC adapter.
    I am calling SP as fallows: execute proc_dtdc_booking_interface_sd
    But it returned following error,
    Database-level error reported by JDBC driver while executing statement 'execute proc_dtdc_booking_interface_sd'. The JDBC driver returned the following error message: 'java.sql.SQLException: Unknown prepared statement handler (proc_dtdc_booking_interface_sd) given to EXECUTE'. For details, contact your database server vendor.
    the way i called SP is correct ??
    please suggest me how to resolve the issue ??
    Regards,
    Bhuvan.

    Hi
    Below is the code , when we are using this code directly in the mySQl command promp, it fetches 10 record but when the same code is called through XI adapter  its fetching only one record
    DELIMITER $$
    DROP PROCEDURE IF EXISTS `proc_dtdc_booking_interface_sd` $$
    CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_dtdc_booking_interface_sd`()
    BEGIN
    declare done int(1);
    declare v_dsr_booked_by char(1) ;
    declare v_dsr_branch_code char(3) ;
    declare v_dsr_cust_code varchar(7) ;
    declare v_dsr_booking_date date ;
    declare v_dsr_cnno char(9) ;
    declare v_dsr_cn_type char(3) ;
    declare v_dsr_cn_weight decimal(8,3) ;
    declare v_dsr_dest char(3) ;
    declare v_dsr_mode char(2) ;
    declare v_dsr_amt decimal(10,2) ;
    declare v_dsr_dox char(1) ;
    declare v_office_code char(3) ;
    declare v_dsr_status char(1) ;
    declare v_dsr_remarks varchar(25) ;
    declare v_dsr_refno varchar(20) ;
    declare v_dsr_transmf_no varchar(10) ;
    declare v_dsr_trans_status_xi char(1) ;
    declare v_ndsr_cnno char(9) ;
    declare v_ndsr_product char(3) ;
    declare v_ndsr_sercharge decimal(8,3) ;
    declare v_ndsr_ins_amt decimal(8,3) ;
    declare v_ndsr_others decimal(8,3) ;
    declare v_dr_amt_type decimal(2,0) ;
    declare v_dr_extra_amt decimal(10,2) ;
    declare v_sales_document varchar(2) ;
    declare bookcur CURSOR for
    SELECT *
    FROM dtdcdb_rw.dtdc_booking_interface_sd
    LIMIT 10;
    DECLARE CONTINUE HANDLER FOR NOT FOUND SET DONE=1;
    set done=0;
    OPEN bookcur;
    bookloop: loop
    FETCH bookcur
    INTO
    v_dsr_booked_by ,
    v_dsr_branch_code,
    v_dsr_cust_code,
    v_dsr_booking_date,
    v_dsr_cnno,
    v_dsr_cn_type,
    v_dsr_cn_weight,
    v_dsr_dest,
    v_dsr_mode,
    v_dsr_amt,
    v_dsr_dox,
    v_office_code,
    v_dsr_status,
    v_dsr_remarks,
    v_dsr_refno,
    v_dsr_transmf_no,
    v_dsr_trans_status_xi,
    v_ndsr_cnno,
    v_ndsr_product,
    v_ndsr_sercharge,
    v_ndsr_ins_amt,
    v_ndsr_others,
    v_dr_amt_type,
    v_dr_extra_amt,
    v_sales_document ;
    IF DONE=1 THEN
    LEAVE bookloop;
    END IF;
    select
    v_dsr_booked_by As dsr_booked_by,
    v_dsr_branch_code As dsr_branch_code,
    v_dsr_cust_code As dsr_cust_code,
    v_dsr_booking_date As dsr_booking_date,
    v_dsr_cnno As dsr_cnno,
    v_dsr_cn_type As dsr_cn_type,
    v_dsr_cn_weight As dsr_cn_weight,
    v_dsr_dest As dsr_dest,
    v_dsr_mode As dsr_mode,
    v_dsr_amt As dsr_amt,
    v_dsr_dox As dsr_dox,
    v_office_code As office_code,
    v_dsr_status As dsr_status,
    v_dsr_remarks As dsr_remarks,
    v_dsr_refno As dsr_refno,
    v_dsr_transmf_no As dsr_transmf_no,
    v_dsr_trans_status_xi As dsr_trans_status_xi,
    v_ndsr_cnno As ndsr_cnno,
    v_ndsr_product As ndsr_product,
    v_ndsr_sercharge As ndsr_sercharge,
    v_ndsr_ins_amt As ndsr_ins_amt,
    v_ndsr_others As ndsr_others,
    v_dr_amt_type As dr_amt_type,
    v_dr_extra_amt As dr_extra_amt,
    v_sales_document As sales_document;
    update dtdcdb_rw.dsr_table
    set dsr_trans_status_xi='T'
    where dsr_cnno=v_dsr_cnno;
    end loop;
    SELECT *
    FROM dtdcdb_rw.dtdc_booking_interface_sd
    LIMIT 10;
    END $$
    DELIMITER ;
    Please help
    Regards
    Bhuvan

  • Calling Stored Procedure from JDBC Adapter

    Hello,
    I am Updating a SQL Server Table using JDBC Adapter.
    Now I have multiple input rows and the procedure needs to be called for each set.
    Do I need to use multimapping for this or just generating multiple <b>Statement</b> node will solve?
    Also For this will there is any knows/ forseen problem (like Transaction handling) that I need to take care of?
    Thanks and Regards,
    Himadri
    Message was edited by:
            Himadri Chakraborty

    Himadri,
    You can just create multiple statement nodes in one message.
    I am not aware of any known or foreseen issues with this approach.
    Kind regads,
    Koen

  • JDBC adapter questions

    Hello all,
    I have been playing around with the JDBC adapter on my XI sandbox to figure it out.  I read through a few guides and I almost have a good handle on it, but there is still a big question lingering.  I have configured an example scenario in which I would like to pull data out of the USR01 table from the XI database and transform some user data and place it back in the same table.  I was able to get my connections correct and have the communication channel successfully execute SQL statements to alter the data.  For example, my <b>Query SQL Statement</b> in the sender communication channel is as follows:
    SELECT * FROM USR01 WHERE BNAME='ZTEST2'
    And the <b>Update SQL Statement</b> in the sender communication channel is:
    UPDATE USR01 SET BNAME='ZTEST'  WHERE BNAME='ZTEST2'
    This works fine and when I go to transaction se16 and pull up that table I see that the username gets modified when the interface is activated.  However, I haven't really figured out exactly how to configure the communication channel / data types so that I can run a SQL statement that will populate my data type that I created for mapping.  In other words, lets say I created a data type that looks as follows:
    mt_sender
        row
             MANDT
             BNAME
             STCOD
    And I want to populate that data type with data from the USR01 table (in the corresponding fields), what would my SQL statement look like in the sender communication channel?  I read a few weblogs on how to do scenarios like this, so I built my receiving Data Type to look like this:
    mt_receiver
         STATEMENT
              ROW
                   action
                   TABLE
                   access
                        MANDT
                        BNAME
                        STCOD
    But I still don't understand how exactly XI correlates the data types / mapping and transformations to the SQL statements....
    I'm having a hard time putting this into words, but basically I'm asking a rather high level question I think.  How does XI relate the data types to the data it pulls from the SQL statements?  How do I actually get the SQL statement to populate my data types so I can do mapping and then repopulate the database table again?  Does this make sense?

    Hi Harrison,
          Also check out these JDBC structure links related to your question:
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/frameset.htm">http://help.sap.com/saphelp_nw2004s/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/frameset.htm</a>
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm">http://help.sap.com/saphelp_nw2004s/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm</a>
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/4d/8c103e05df2e4b95cbcc68fed61705/frameset.htm">http://help.sap.com/saphelp_nw2004s/helpdata/en/4d/8c103e05df2e4b95cbcc68fed61705/frameset.htm</a>
    Regards,
    Subhasha Ranjan

  • JDBC adapter: greek characters

    Hi All,
    We are reading and sending data from a ms sql dbase towards our R/3 system via PI (JDBC adapter).
    I am having some problems related with exotic characters (greek). Reading these characters from the dbase works fine without any additional config, but writing these characters gives problems.
    When I check the message logging inside XI, the characters look fine, but the result in the dbase is not.
    ex:
      XI       = Martine &#913;&#932;&#932;&#921;&#922;&#927; &#920;&#917;&#929;&#913;&#928;&#917;&#933;&#932;&#919;&#929;&#921;&#927;
      dbase = Martine ?????? T???????????
    I already tried changing the charset of the communication channel to "iso-8859-7", but that did not fix the problem.
    Anyone an idea?
    Kindest regards
    Joris

    In note 831162 (FAQ: XI 3.0 / PI 7.0 JDBC Adapter) is mentioned:
    "2. Unicode Handling
    Q: I am inserting Unicode data into a database table or selecting Unicode data from a table. However, the data inserted into or retrieved from the table appears garbled. Why doesn't the JDBC Adapter handle Unicode correctly?
    A: While the JDBC Adapter is Unicode-aware, many JDBC drivers and/or database management systems aren't by default and need a codepage or Unicode-awareness to be configured explicitly. For the respective JDBC drivers, this codepage setting is often configured via the driver URL. For details, refer to the documentation of your JDBC driver or database management system.
    Note: For the Lotus Domino Driver for JDBC, there does not seem to be any documented method to enable support for Unicode strings."
    Does this help you?
    Regards
    Stefan

  • Strange behavior of JDBC Adapter

    Hello everybody!
    I found a pretty strange behaviour of JDBC Receiver Adapter during problems with network (big thanks to our Basis). According to the status in Adapter Engine, the message wasn't processed. In the database I can see these inserts. However, there are more lines in the XML than lines in the database. So, how it is possible that adapter commits only part of inserts. Logs and settings see below.
    My XML includes a SQL_DML statement and a few INSERT statements, each contains many inserts.
    It looks like that:
    <?xml version="1.0" ?>
    <MyMessage>
        <statement>
            <table1 action="SQL_DML">
                <access>here I delete old values</access>
            </table1>
        </statement>
        <statement>
            <table2 action="INSERT">
                <access>some data</access>
            </table2>
        </statement>
        <statement>
            <table3 action="INSERT">
                <access>some data</access>
            </table3>
        </statement>
    </MyMessage>
    Part of adapter log is here:
    Information
    Message successfully put into the queue
    Information
    The message was successfully retrieved from the receive queue
    Information
    Message status set to DLNG
    Information
    Delivering to channel: Adapter_Name
    Information
    MP: processing local module localejbs/CallSapAdapter
    Information
    Receiver JDBC adapter: processing started; QoS required: ExactlyOnce
    Information
    JDBC Adapter Receiver Channel Adapter_Name: Processing started; party / service BS
    Information
    Database request processed successfully
    Error
    MP: exception caught with message Ack handling failed: creation of messageFactory failed: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Connection JDBC_http://sap.com/xi/XI/System is currently not started.
    Error
    Exception caught by adapter framework: Ack handling failed: creation of messageFactory failed: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Connection JDBC_http://sap.com/xi/XI/System is currently not started.
    Error
    Delivery of the message to the application using connection JDBC_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.lang.Exception: Ack handling failed: creation of messageFactory failed: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Connection JDBC_http://sap.com/xi/XI/System is currently not started.
    Information
    Message status set to WAIT
    Information
    The asynchronous message was successfully scheduled to be delivered at ...
    Information
    Message status set to TBDL
    Information
    Retrying to deliver message to the application. Retry: 1
    Information
    The message was successfully retrieved from the receive queue
    Information
    Message status set to DLNG
    Information
    Delivering to channel: Adapter_Name
    Information
    MP: processing local module localejbs/CallSapAdapter
    Information
    Receiver JDBC adapter: processing started; QoS required: ExactlyOnce
    Information
    JDBC Adapter Receiver Channel Adapter_Name: Processing started; party / service BS
    Error
    Unable to execute statement for table or stored procedure. 'Table' (Structure 'statement') due to com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'fields'. Cannot insert duplicate key in object 'Table'. The duplicate key value is (field values).
    Error
    JDBC message processing failed; reason Error processing request in sax parser: Error when executing statement for table/stored proc. 'Table' (structure 'statement'): com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'fields'. Cannot insert duplicate key in object 'Table'. The duplicate key value is (field values).
    Error
    MP: exception caught with cause com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'Table' (structure 'statement'): com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'fields'. Cannot insert duplicate key in object 'Table'. The duplicate key value is (field values).
    Error
    Exception caught by adapter framework: Error processing request in sax parser: Error when executing statement for table/stored proc. 'Table' (structure 'statement'): com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'fields'. Cannot insert duplicate key in object 'Table'. The duplicate key value is (field values).
    Error
    Delivery of the message to the application using connection JDBC_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'Table' (structure 'statement'): com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'fields'. Cannot insert duplicate key in object 'Table'. The duplicate key value is (field values).
    Adapter settings:
    Maximum concurrency: 20
    Persistence: Local
    Conflict Resolution: Redo
    Advanced Mode: On
    Number of Retries of Database Transaction on SQL Error: 0
    Transaction Isolation Level: serializable

    Dear All,
    Follow the steps below to resolve the "Connection JDBC_http://sap.com/xi/XI/System is currently not started." issue:
    1. Log in to NWA
    2. Navigate to Operations -> Systems -> Start & Stop
    3. Click on Java Services tab
    4. Search  the service Service "XPI Adapter: JDBC"
    5. Select the service XPI Adapter: JDBC and click on Restart button
    With the restart of JDBC Service in NWA, the channels should start working properly
    Regards,
    Shreyansh

  • We get "uFF06uFF03x0;" from sender JDBC adapter

    Thank you.
    This is naoki kurihara.
    We have a problem in sender JDBC adapter.
    We use java mapping and sender JDBC adapter in PI7.1 on Windows.(DB is sqlserver)
    and we test the interface and we found error.
    the reason is to get "&#x0;" from JDBC adapter.
    and our java mapping can't parse it. and we got error.
    the column is not null.
    how we can prevent "&#x0;",
    (sorry I cant write "&#" 1byte word, so I wrote 2bytes word)
    please give me your help!!
    Thanks

    Hi,
    Replace the & character with &amp ; in your java mapping. The same goes for these special characters:
    < with &lt ;
    > with &gt ;
    " with &quot ;
    ' with &apos ;
    Please remove the space between the escape character and the ; in your Java mapping. The spaces are typed here because the equivalent characters are not displaying correctly.
    It should be able to handle the # though. Hope this helps
    Regards,
    Mark

  • What will be input for custom module developed for JDBC adapter

    Hi,
    I have a scenario SQLDB -> Xi -> R3 .
    Here I have added a custom module before callsapadapter module.
    As I know the sequence of module calling will be as follows :
    1. Standard jdbc adapter
    2. custom module
    3. callsapadapter
    Standard jdbc adapter has a select query . After that what will be the input format for my custom module .Will it be the xml structure of my source Data type or will it be a resultset or will it be a inputstream(stream of xml fomat????).
    And then in which format i need to generate the output format for CallSapAdapter.
    Regards

    Hello Moni,
    SAP has a wonderful feature in ABAP. There are some Runtime Errors that you can <i>catch</i>. This is somewhat similar to the Exception Handling procedure in Java / C++. So here's how you go about it....
    Sometimes there might some calculations that we do, multiplication , for example, where the result of the arithmetic operation is known only at run-time. And the recepient for this result may not always be of the right type to take the result. Consider the following code:
    parameters a type i obligatory.
    data : b type i,
           c type i.
    b = 99999999.
    ** Assume that the user has entered 99999999 for the value of the parameter a.
    c = a * b.    " 99999999 * 99999999 "
    write c.
    This program will certainly give a short dump saying that there was an arithmetic overflow. But we can actually avoid this Shor Dump and handle the situation quite elegantly. consider the following.
    parameters a type i obligatory.
    data : b type i,
           c type i.
    b = 99999999.
    CATCH SYSTEM-EXCEPTIONS ARITHMETIC_ERRORS = 1.
    ** Assume that the user has entered 99999999 for the value of the parameter a.
       c = a * b.    " 99999999 * 99999999 "
    ENDCATCH.
    if sy-subrc ne 0.
      write: 'There was an arithmetic overflow in the calculation.'
    else.
      write c.
    endif.
    This way you can actually avoid the short dump and make the system set a value for sy-subrc. Based on the avlue of the sy-subrc, you can go ahead with further processing / error-handling, as the case may be.
    Here, ARITHMETIC_EXCEPTIONS is called an <i>exception group</i>. For more information on what other run-time errors can be <i>caught</i>, and What the various exception groups contain, please refer to the online documentation for the CATCH statement.
    Regards,
    Anand Mandalika.

Maybe you are looking for

  • Iphoto cannot find original photo

    I cannot open photo files in iphoto from pictures I have imported the photos several years ago.  I'm just sick...these are old family pictures I want to use.  iPhoto can't find the original...what the heck...it's popping up for me to see I just can't

  • How can we have transient variable value as a parameter for an attribute?

    Hi, I am using JDev 11.1.1.2 with ADF11g. I have a requirement where I have to display a table with many columns. One of the columns is a drop down whose values are fetched from DB. This is a non-DB item and so becomes a transient variable of the VO.

  • Processing class 10 and partial period factor specification /807

    dear experts, I want to know the difference in specification of /801 or /802 or 803 or /804 or /805 or /807 when we give or maintain processing class 10 for an y customised wage type in table v_t512w_d. there is no documetation for /806 or /807 wage

  • SpeedGrade CC14  will not open - Mac 10.9.5

    SpeedGrade refuses to luanch on my Mac. Mac Pro, GTX 680, latest Cuda drivers. Tried uninstalling and reinstalling, using the CC cleaner tool to wipe it out before re-install and same result. The splash screen never even comes up. A small dot appears

  • How to set alert threshold and email alerts?

    Hi! I have configured Solution manager 3.2 to monitor our R/3 systems. I want to be able to set the threshold for  tablespace usage and be able to send an email if the usage of the tablespace is 80% full. Could anybody tell how to implement it? Thank