JDBC Sender Adapter

Hi everybody
I have the following error in my JDBC to JDBC scenario; I  configured the JDBC sender adapter and receive the following message back. In the Configuration I set “Document Name” to MT_ScanningStatus:
  <?xml version="1.0" encoding="utf-8" ?>
<MT_ScanningStatus>
<row>
  <ScannerNb>1</ScannerNb>
  <Status>0</Status>
  </row>
<row>
  <ScannerNb>2</ScannerNb>
  <Status>2</Status>
  </row>
<row>
<ScannerNb>3</ScannerNb>
  <Status>0</Status>
  </row>
<row>
  <ScannerNb>4</ScannerNb>
  <Status>2</Status>
  </row>
  </MT_ScanningStatus>
I defined the  corresponding datatype as follow:
DT_ScanningStatus Complex Type
        row              Element 1...unbounded
          ScannerNb      Element 1
          STatus         Element 1
In the following Mapping I tried to Map this structure to the Structure used to send an Update SQL Statement to the JDBC Receiver to update the same table.  A normal Test in the Mapping Tool runs fine but when I enter under source the above incoming Message from the JDBC Adapter I got the following error. I think the incoming message cannot be interpreted. Can someone support me? I read the documentation for the JDBC adapter and also a lot of weblogs and discussion threads. Maybe someone knows a weblog describing more detailed the sender adapter and how to handle the incoming Message!!
Thanks in advance Oliver
14:58:03 Start of test
Compilation of MM_JDBC_to_JDBC_test successful
Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8)
com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8)
at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:130)
at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:68)
Root Cause:
com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8)(:main:, row=1, col=8) -> com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8)
at com.sap.engine.lib.xml.parser.XMLParser.scanPI(XMLParser.java:2009)
at com.sap.engine.lib.xml.parser.XMLParser.scanProlog(XMLParser.java:2657)
at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2713)
at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:162)
at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:132)
at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:142)
at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:245)
at com.sap.engine.lib.xml.parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:276)
at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:338)
at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:125)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:128)
at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:68)
at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:144)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:128)
at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:68)
Caused by: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8)
at com.sap.engine.lib.xml.parser.XMLParser.scanPI(XMLParser.java:2009)
at com.sap.engine.lib.xml.parser.XMLParser.scanProlog(XMLParser.java:2657)
at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2713)
at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:162)
at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:132)
at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:142)
at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:245)
at com.sap.engine.lib.xml.parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:276)
at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:338)
at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:125)
... 3 more
Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8)

Hi Oliver,
>>>>source the above incoming Message from the JDBC Adapter I got the following error. I think the incoming message cannot be interpreted.
do this:
in the test tab try your mapping once more
(the correct one)
then save the source xml as file
next compare this saved file with the one
you get from the jdbc sender
>>>>>Declaration not allowed here.(:main:, row:1, col:8)
and compare the first lines in those two XML files
are they the same?
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Similar Messages

  • How to update two tables in a single call using JDBC Sender adapter

    Hello All,
    The scenario is, database entries have to be selected from two tables and at the same time those tables have to be udpated with the flag.
    We are using JDBC sender adapter and in Select Query, we are fetching the data by joinin the two tables.
    Update Statemtent: We can only update one table using this statement.
    Is it possible to update two tables using the Update Statement without using Stored Procedures.
    Let me know.
    Regards,
    Sreenivas.

    Hi Sreenivas,
    > Is it possible to update two tables using the Update Statement without using Stored Procedures.
    Yes its possible through join statement
    Check this links
    Update in JDBC Sender adapter for more than one table
    data from 2 tables for jdbc sender adapter
    Regards
    Ramesh

  • JDBC Sender Adapter - Records sent one at a time

    Hello everyone,
    Here's a summary of my scenario JDBC > XI > RFC.
    My select statement (JDBC) looks like this:
    SELECT * FROM BATCH WHERE STATUS='Y'
    The problem is, whenever it returns multiple rows, the RFC can only accept one record at a time (1...1), so I need to pick up the records from the DB and send them one at a time.
    Currently, this is how the output XML looks like:
    <?xml version="1.0" encoding="utf-8" ?>
      <ns:SQL_RESP_MT xmlns:ns="http://www.pharmaindustries.com">
      <row>
      <number>200000000472</number>
      <status>Y</status>
      </row>
      <row>
      <number>200000000473</number>
      <status>Y</status>
      </row>
      <row>
      <number>200000000474</number>
      <status>Y</status>
      </row>
    </ns:SQL_RESP_MT>
    Instead, I need each row to be picked up and sent one at a time.
    <?xml version="1.0" encoding="utf-8" ?>
      <ns:SQL_RESP_MT xmlns:ns="http://www.pharmaindustries.com">
      <row>
      <number>200000000472</number>
      <status>Y</status>
    </ns:SQL_RESP_MT>
    <?xml version="1.0" encoding="utf-8" ?>
      <ns:SQL_RESP_MT xmlns:ns="http://www.pharmaindustries.com">
      <number>200000000473</number>
      <status>Y</status>
      </row>
    </ns:SQL_RESP_MT>
    <?xml version="1.0" encoding="utf-8" ?>
      <ns:SQL_RESP_MT xmlns:ns="http://www.pharmaindustries.com">
      <number>200000000474</number>
      <status>Y</status>
      </row>
    </ns:SQL_RESP_MT>
    Does anyone know the changes I need to make in my current SELECT statement or the JDBC Sender Adapter to make this possible.
    Thanks in advance!
    Glenn

    Thank you all for your replies. I'll check out your link in a bit, Phani. Thanks!
    A SpliByValue won't work since the BAPI Header is (1...1).
    Luckily, during testing, I found out that the BAPI (BAPI_PRODORDCONF_CREATE_TT) handles multiple lines in one of the subelements of the header so that was where I mapped the Rows.
    I might need to trigger multiple BAPIs in the future, so I'll take a good look at your suggestions, but for now, I'm marking this question answered.
    Warm regards,
    Glenn

  • In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String

    In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String , for executing the Stored Procedure with Current date as the input .

    Hi Srinath,
    The below blog might be useful
    http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/03/06/executing-stored-procedure-from-sender-adapter-in-sap-pi-71
    PI/XI: Sender JDBC adapter for Oracle stored procedures in 5 days
    regards,
    Harish

  • Event Handling in JDBC sender adapter

    Hi,
    please help me in this scenario.
    Scenario is Third Party will update the Header and Item values in to Database table.
    Once the update is done , a program will run in Thrid party system and it will update the Event Table with the primary key value of the DB table.
    So my JDBC sender should be looking for the event table updation. Whenever there is an update in the event table the JDBC sender should automatically kicked off and it should select all the field in the DB table where the primary key = Event table.primary key and the values will be generated as an Idoc.
    1.How will i achive this scenario.
    2.How to configure the JDBC sender Adapter which gets triggered automatically when there is an updation in event table.
    please advice.
    Thanks,
    Sujatha

    Hi,
    >>2.How to configure the JDBC sender Adapter which gets triggered automatically when there is an updation in event table.
    There is way to control the Communciation Channel externally. Refer this help document http://help.sap.com/saphelp_nw04/helpdata/EN/45/0c86aab4d14dece10000000a11466f/content.htm.
    Or alternately you can create a query that always queries only the updated record and configure the JDBC adapter which would periodiocally look the DB...
    ~SaNv...

  • JDBC Sender Adapter - No Namespace found

    Hello
    I am currently using PI 7.1. The scenario is JDBC to ECC ABAP Client Proxy. When the JDBC Sender Adapter sends the data to the Integration Server, the root element does not contain the xmlns attribute. This root element is constructed from the Document Name of the JDBC Sender Adapter attribute.
    I am getting the following error:
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Request Message Mapping
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>Application</SAP:Category>
      <SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
      <SAP:P1>com/sap/xi/tf/_MM_HIS_Material_Consumption_</SAP:P1>
      <SAP:P2>com.sap.aii.mappingtool.tf7.IllegalInstanceExcepti</SAP:P2>
      <SAP:P3>on: Cannot create target element /ns0:MT_Material_</SAP:P3>
      <SAP:P4>Consumption_ECC/Material. Values missing in queue~</SAP:P4>
      <SAP:AdditionalText />
      <SAP:Stack>Runtime exception occurred during application mapping com/sap/xi/tf/_MM_HIS_Material_Consumption_; com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot create target element /ns0:MT_Material_Consumption_ECC/Material. Values missing in queue~</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    When I perform a test at RWB, the message gets posted successfully. Once posted, the payload of this message contains the xmlns attribute.
    Here is the root element from both the instances:
    From RWB:  <ns0:MT_Material_Consumption_JDBC xmlns:ns0="http://xxx.com/xxx/finance">
    From JDBC Adapter:  <ns0:MT_Material_Consumption_JDBC>
    Could you please let me know, what has to be done to obtain the xmlns in the sender payload?
    Thank you in advance.
    John Jeyaraj
    Edited by: John jeyaraj on Apr 7, 2011 8:22 AM

    Hi Hiren
    When I test the MM without the xmlns attribute, I get the following error:
    The prefix "ns0" for element "ns0:MT_Material_Consumption_JDBC" is not bound.
    When I add the xmlns attribute, the mapping is successful.
    Thanks
    John

  • How to use sql variables in jdbc send adapter??

    Hi,
    i wanna use a variable in the sql statement in the jdbc send adapter.
    i know i can key sql statement in the "Query SQL Statement" in the jdbc send adapter.but i dont know how to use variables in the sql statement.
    i mean, for example, the sql statement is "SELECT * FROM t_student WHERE READFLAG = 0", but now i wanna instead of "0"(the value of the READFLAG) using a variable.
    and if i can use a variable to replace the "0"(the value of the READFLAG above sql statement), then how can i send a value to the variable??
    request help in the regard.
    thx in advance.
    Brian

    Hi,
    Use the place holders to pass the data at runtime. Check the below structure for more details.
    Hope this helps.
    Thanks and Regards,
    Kalpesh
    <root>
      <stmt>
        <Student action="SQL_QUERY">
          <access> SELECT * FROM t_student WHERE READFLAG = '$FLAG$ </access>
          <key>
            <FLAG>0</FLAG>
          </key>
        </Student>
      </stmt>
    </root>

  • PI 7.1 JDBC sender adapter huge load from DB select

    Hi,
    We have the problem that the JDBC sender adapter is selecting a huge amount of data from a Oracle DB. The Adapter seems to be able to cope the load but when sending to the integration server it causes problems. We found values to adjust but I dont think increasing them is a good solution.
    My question is:
    Is there any way to send the data in blocks with using the PI standard JDBC adapter ?
    Thank you and regards,
    Andreas

    Hi,
    You can use the below parameter in JDBC sender.
       Specify additional Parameter Names and Parameter Values in the table.
    Due to messages of large size it may cause issue
    Following are the parameters to be set in the table to limit the message size per polling:
    ●      msgLimit :
    ●      maxMsgSize :  SAP note 1253826.
    ●      maxRowSize : SAP note 1253826.
    Additional parameters are published in SAP Note 801367.
    Refer the link.
    Defining Additional Parameters in Advanced mode
    http://help.sap.com/saphelp_nw73/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm

  • JDBC Sender Adapter - Transaction & Parameterized Query?

    Dear Experts,
    I'm curious about the JDBC sender adapter in SAP PI.
    As I see from the document and have been searching in the Internet, The default procedure of the sender JDBC adapter is to first run a SELECT/Store Procedure query then update the records that have been read before.
    Configuring the Sender JDBC Adapter - Advanced Adapter Engine - SAP Library
    What I want to ask is:
    - What is the database transaction used for the SELECT and the UPDATE? I mean what if the SELECT is successful and the records have been sent to the IE, but the UPDATE failed. This way, the next polling run, the same records could be read again. Is it possible? Are the SELECT and UPDATE query atomic (if one fails the other fails too)?
    - Is it possible to have a parameterized query / stored procedure in sender JDBC adapter? Because seeing at the default procedure, there should be at least a field that will be used as a flag (for example the processed field needs to be updated to '1'). Something like:
              - SELECT * FROM table_a WHERE docno > $last_doc_no
                             $last_doc_no is a paramter or variable from PI
              - EXEC sp_do_something ( $param_a, $param_b )
                             $param_a, $param_b are parameters or variable in PI
    Thank you,
    Suwandi C.

    Hi Suwandi,
    all action to database are in one transaction and thats mean if one failed all failed.
    And it is possible to have parameterized storied procedure. You sould send something like
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:mt_proc xmlns:ns0="http://aaaa">
       <statementname>
          <stProc action="EXECUTE"/>
          <TABLE>PROCEDURE NAME</TABLE>
          <access>
             <param_in isInput="1" type="some_type">input param</param_in>
             <param_out isOutput="1" type="some_type"></param_out>
          </access>
       </statementname>
    </ns0:mt_proc>

  • Problem with JDBC Sender adapter

    hi guys!
    I´ve problem in PI 7.0, with the JDBC Sender Adapter, execute select sentence and update status in Oracle database.
    In RWB Message Monitoring and SXMB_MONI I can't see any message.
    Someone have any idea how to fix it?
    Thanks in advance.

    Hi David,
    First check on the sender communication channel, if no data has been picked up by PI on channel,
    then check the configuration of channel in the ID, especially select query.
    If that is ok, then ask the sender application team(oracle database team) to run the query on their side
    and to check if they are getting any data.
    There could be the possibility of error in data also.
    -Supriya.

  • JDBC Sender adapter - can VIEW be used in Query statement

    Hi,
    In JDBC Sender adapter, can we use a VIEW sql query in the "Query SQL Statement" placeholder?
    For eg:
    CREATE VIEW <view name> as SELECT * from <table name> WHERE <condition>
    instead of the usual:
    SELECT * from <table name> WHERE <condition>
    Thanks,
    Vishak

    Hi
    What exactly is your use of creating a view, if you are going to fetch data from different tables, then you can use the view through stored procedures.
    Hope this clears your doubts
    Thanks
    Saiyog

  • JDBC Sender adapter - Oracle - Stored Procedure - Error

    Hello,
    Need few clarifications on JDBC sender adapter and stored procedures when connecting to Oracle DB.
    My scenario is, Oracle to SAPBW. So in sender JDBC adapter, we have used a SP having multiple SQL statements it, esp. one of the SELECT statment having Joins on a table and View.
    My questions are,
    1) Is it possible to have more SQL statements in SP for Sender JDBC?
    2) Is the SP of Oracle DB returns resultset or cursor?
    I have tried in searching the forum perticularly for connecting to Oracle as Sender and below like said  that there is a limitation of XI JDBC when connecting to Oracle.
    Executing an Oracle Stored Procedure from Sender JDBC adapter
    So please clarify the doubts and help me.
    With regards,
    Jilan

    Hi Jilan,
    Unlike what was mentioned in the link given by you that oracle returns cursor and not resultset is not completely true. It may be difficult but certainly not impossible.
    Refer : http://www.enterprisedt.com/publications/oracle/result_set.html
    regards
    joel

  • JDBC sender adapter outofmemory error

    Dear friends,
    We are getting following error on JDBC sender Adapter: Error during conversion of query result to XML: java.lang.OutOfMemoryError: Java heap space (failed to allocate 1073741848 bytes)
    I have read blogs where there have been suggestions to limit the amount of data picked by using WHERE condition and not using SELECT *
    In our scenario we are creating GL IDOCs . In SQL when PI picks it up it needs to get all the corresponding Header and line items together. We cannot randomly pick 1000 records at a time. The SQL table has 500,000 rows in the following format
    H H H  L1 L1 L1
    H H H L2 L2 L2
    H H H  L3 L3 L3
    H1 H1 H1 L1 L1 L1
    H1 H1 H1 L2 L2 L2
    H1 H1 H1 L3 L3 L3
    Please let me know how can we solve this issue?
    Thank you,
    Teresa
    Edited by: Teresa lytle on Sep 27, 2011 3:13 PM

    If you are using oracle database, uses ROWNUM field to fetch first set of records and you can update those records with the flag as true.
    similarly If you are using MS SQL database, uses SELECT TOP command to fetch first set of records and you can update those records with the flag as true.
    Like File/FTP adapter, the next poll interval would be as scheduled. The Administrator can then alter the table contents, to ensure lesser no of records are picked up.
    Here You need to limit the no of rows if you again face the problem. Please chec the SAP Note
    https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1296819

  • JDBC Sender Adapter Error

    HI Friends,
    I have configured the JDBC Sender Adapter with parameters as
    Driver : oracle.jdbc.driver.OracleDriver
    Connection : jdbc:oracle:thin:system:netweaver:@172.25.4.221:1521
    But Iam getting an error in Componenet Monitoring:
    <b>History:
    - 2006-05-30 04:55:36 UTC: Error: Stopped unexpectedly - reconfigure and activate to continue processing. Error: java.lang.NullPointerException
    - 2006-05-30 04:55:36 UTC: Processing started</b>
    How to resolve this??
    Regards,
    Raju

    Hi
    Thanks for the reply.
    I tried with <b>jdbc:oracle:thin:@172.25.4.221:1521:netweaver</b> and
    <b>jdbc:oracle:thin:@172.25.4.221:1521:system</b>
    Now Iam getting another error.
    <b>Sender Adapter v2108 for Party '', Service 'TBIT40_XI_LEGACY_BS_04':
    Configured at 2006-05-30 05:12:30 UTC
    History:
    - 2006-05-30 05:13:00 UTC: Retry interval started. Length: 20.000 s
    - 2006-05-30 05:13:00 UTC: Error: Accessing database connection 'jdbc:oracle:thin:@172.25.4.221:1521:system' failed: DriverManagerException: Cannot establish connection to URL 'jdbc:oracle:thin:@172.25.4.221:1521:system': SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=153093376)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
    - 2006-05-30 05:13:00 UTC: Processing started</b>
    Can U please solve it..
    regards,
    Raju

  • JDBC Sender Adapter - Restrict number of rows fetched, Oracle

    Hi,
    Is it possible to restrict the number of rows fetched by the JDBC Sender adapter at each run? What would the appropriate Select and Update statements be to make sure a limited number of rows are selected and flagged as processed?
    We are connecting to a Oracle RDBMS.
    //Johan

    hi,
    have a look at this info:
    about oracle and limiting number of rows
    http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Maybe you are looking for