Challenging issue with JDBC sender adapter

Hello Guys
I have this requirement
From Oracle Database I have to read to tables  one for the header and one for the detailes and map the result to one RFC.
I have only  worked with one table at the time with the JDBC sender adapter but never with 2  tables
My challenges are
1 - How I can read the 2 tables at the same select statement , I suppose I have to use a join with 2 identical fields , so far so good ,but how I can handle multiple records
suppose the result is 10 new different records which each of the recored has to be mapped to the RFC , then we will have 10 RFC calls.
how can I do the mapping in this case.
2 - How can I update the 2 tables at the samme time and flag them as processed , as far as I know we can not use 2 update statement in the same JDBC sender
any help will do
Thanks in advance.

Hi
Thanks for the replayes
The RFC is used to create and Invoice Idoc , It has to be one record (Header and Item ) to one RFC.
a JDBC to IDoc can also be used , but we have to update another table in SAP that is why the RFC,
My doubt is how the Data type for the sender JDBC should look like , as mentioned I have 2 tables to fetch data from
<Invoice>
<Header> 1 -- 1
<f1>
<f2>
<f3>
</Header>
<Item> 1--n
<f1>
<f2>
<f3>
</Item>
</Invoice>
The sender JDBC returns
<Invoice>
<row>
<f1>
<f2>
<f3>
</row>
</Invoice>
How can I replicate the data type to meet the JDBC sender structure.
and regarding the mapping do I have to change the occurrunce to 0 -- unbounded
regarding the update Ragu is right in his suggestion
Table1 can be used as primary table, Table2 can be used as Secondary table.. u will have key field to link both table.
So Just Updating only Primary Table(Table1) will helps on this.
Thanks.

Similar Messages

  • 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.

  • Timestamp issue in JDBC sender adapter

    All,
    Database is sending the timestamp in th below format,
    28-06-2010 12:41:20
    but  SAP PI JDBC adapter is converting the same data as below.
    28-06-2010 12:41:20.0
    we are getting an extra ZERO, can any one tell me the solution for not getting extra ZERO.
    Thank You,
    Madhav

    Try to Use JDBC Date Function in Select Query .
    to_char( Coloumn_name , 'DD-MON-YYYY HH:MI:SS')
    it will forcefully get the date in following format .. but one thing to remeber this will covert your date into string format ..so  to catch the following date on sender Message Type , it may require to create that structure  with string type.
    Regards
    Prabhat Sharma(Dragon).

  • Mapping issues with soap sender adapter

    Scenario SOAP->XI-> file.
    I have configured a sender soap adapter.
    When the soap message is sent to XI from third party system using the 'DOC' , SXMB_MONI shows the following format
    <SOAP-ENV:Envelope
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:m="http://localhost">
      <SOAP-ENV:Body>
        <m:MyOperation>
    <b>     <m:a>123</m:a>
          <m:b>abc</m:b></b>    </m:MyOperation>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    But I get a mapping exception..
    While the soap message generated through XMLSPY, is processed successfully. The main difference that I can see between the two soap request, "The namespace M: is getting attached to the failed soap request". I have highlighted the difference.  How should I handle this?
    <SOAP-ENV:Envelope
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      >
      <SOAP-ENV:Body>
        <m:MyOperation xmlns:m="http://localhost">
          <b>  <a>123</a>
          <b>abc</b></b>    
        </m:MyOperation>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    Hi,
    Are you using XSL mapping for the Same ? If so try to add the NameSpace in the Header. like <xmlns:....Name Space Name/>
    Otherwise avoid the Namespace from your message. That can be done while creating the Message Type.
    Hope this helps..
    Regards,
    Moorthy

  • Jdbc sender adapter  hangs and starts showing "Processing Started" forever

    Dear ,
              We are facing some issues with jdbc sender adapter channel on production system
              Environment : XI 3.0 SP 20 + HP-UX 11.23 ia64 + Oracle 10.2
    Sometimes it hangs and starts showing "Processing Started" forever on communication channel monitoring .
    There is no error log for this.
    If i stop it and then start it , no use.
    If i copied this to a new one then it works.
    I have found few SAP note like 1078420,1083488 , but my system is already at higher patch level.
    Can you please advise me something as we are facing in production frequently.
    Regards,
    Sandeep

    Hi Sandeep,
    This problem even we too faced in our project and thought of many stupid things finally found that the JDBC adapter is LOCKED.
    Check in the Visual Admin >Cluster> "LOCKING ADAPTER"
    we get a option of Display Locks .Check for an entry with
    NAME : $XIDBAD.JDBC2XI
    reset the locks and restart the CC ,now it works fine.
    Note 1083488 - XI FTP/JDBC sender channel stop polling indefinitely(04/04S)
    Thanks
    Sudharshan

  • 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 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 question

    Hi,
    Scenario: JDBC-XI-R/3
    I am trying to run the JDBC sender adapter every 3 minutes based on the poll interval to select rows from Oracle db.
    In the select and update statements when I use the rownum < '11' and flag condition (Y or N), then I see XI is picking up 10 rows in a two times and I see two parallel processes in SXMB_MONI.
    I want XI to run only pickup 10 rows for every 3 minutes and update only 10 rows in Oracle to "N" from "Y".
    When I take out the rownum condition from update I do not see this issue.
    <u>Update statement:</u>
    Update <TABLE> set status_flag = 'N' WHERE status_flag = 'Y' and rownum < '11'.
    Can some body point me in the right direction ?
    Thanks
    Steve

    Hi there,
    See if this works. Though I never came across such a scenario, I can think what to be done in this case.
    Create a staging table as same structure as from where our JDBC adapter is picking up the data currently.
    Whrite a tigger(after delete) on staging table to call a stored procedure.
    stored procedure will select the data from source table and insert them in to staging table (rownum<11) as well as update the flag column in source table.
    Now load the staging table initially from source table with only 10 rows (one time process). Configure your JDBC adapter on staging table. In update sqlquery field of JDBC adapter write delete statement for all the data from staging table to be purged, as there will not be more than 10 rows at any time and after each time the adapter supplied Delete statement will purge the data so you dont have to worry about selecting 10 rows or updating 10 rows from JDBC adapter. As every time the trigger after delete statement will fire and load only 10 rows from source marking those 10 rows as read_already status.
    NOTE: for Calling stored procedure from trigger follow your database SQL reference documentation.
    Thanks.
    -Nilkanth.

  • Update- statement in JDBC sender Adapter

    Hi ,
    I have a requirement where I am trying to fetch data from ODS based on some flag and immediately I want to update the flag status . So I used selected and update in JDBC sender adapter .
    But I have one question , in the small timeframe where  XI has done a select and just before  XI could  issue the update statement  if a new record is added to ODS . Then  that new record will also get updated though it wasnot selected in select statement .
    Can someone let me know how to overcome this problem ; as I want to make sure I update only those recrods which are selected in select statement ??
    Thanks & Regards,
    Suvarna

    Hi,
    Check out the following thread. It gives the exact answer to this question.
    JDBC Sender Update Query
    One of the replies in the above thread:
    I put in an OSS note asking this exact question with your specific example, and got a reply. I was referred to OSS note 0000831162, where it is explained very unambiguously that the SELECT and UPDATE queries are run in the same transaction.
    Regards,
    P.Venkat
    Message was edited by:
            Venkataramanan

  • JDBC Sender Adapter : java.sql.SQLException: Cursor state not valid.

    Hello all,
    We have configured JDBC Sender Adapter which fetches around 10K records with poll interval 1hr  from DB2 System .
    It was working fine,suddenly it started throwing an exception in Adapter Monitoring :
    Error during conversion of query result to XML: java.sql.SQLException: Cursor state not valid.
    It is not fetching any records.
    Without changing any configurations when we tried to fetch to around 1000 records it's working fine.
    For 10K records same exception persists
    What could be the reason ?How to resolve this issue?
    regards
    GangaPrasad

    Hello Christophe ,
    Trace in VA :::
    Date : 05/09/2008
    Time : 11:45:57:750
    Message : Unexpected error converting database resultset to XML, reason: java.sql.SQLException: Cursor state not valid.
         at java.lang.Throwable.<init>(Throwable.java:194)
         at java.lang.Exception.<init>(Exception.java:41)
         at java.sql.SQLException.<init>(SQLException.java:40)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:389)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:366)
         at com.ibm.as400.access.AS400JDBCResultSet.getValue(AS400JDBCResultSet.java:3580)
         at com.ibm.as400.access.AS400JDBCResultSet.getString(AS400JDBCResultSet.java:3223)
         at sun.reflect.GeneratedMethodAccessor459222074.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:309)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.TraceInvocationHandler.invoke(TraceInvocationHandler.java:45)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.$Proxy254.getString(Unknown Source)
         at com.sap.aii.adapter.jdbc.JDBC2XI.convert2XML(JDBC2XI.java:954)
         at com.sap.aii.adapter.jdbc.JDBC2XI.invoke(JDBC2XI.java:492)
         at com.sap.aii.af.service.scheduler.JobBroker$Worker.run(JobBroker.java:475)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:99)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:119)
    Severity : Error
    Category : /Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/JDBC
    Location : com.sap.aii.adapter.jdbc.JDBC2XI.convert2XML(ResultSet, ResultSetMetaData)
    Application :
    Thread : XI JDBC2XI[JDBC_SND_DB2_VehicleReceiving/DB2PRD00/]_170
    Datasource : 12428950:/usr/sap/PXI/DVEBMGS01/j2ee/cluster/server0/log/applications/com.sap.xi/xi.log
    Message ID : 00145E742794005E0014980B000000BE00044CC763766C4F
    Source Name : /Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/JDBC
    Argument Objs : java.sql.SQLException: Cursor state not valid.
         at java.lang.Throwable.<init>(Throwable.java:194)
         at java.lang.Exception.<init>(Exception.java:41)
         at java.sql.SQLException.<init>(SQLException.java:40)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:389)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:366)
         at com.ibm.as400.access.AS400JDBCResultSet.getValue(AS400JDBCResultSet.java:3580)
         at com.ibm.as400.access.AS400JDBCResultSet.getString(AS400JDBCResultSet.java:3223)
         at sun.reflect.GeneratedMethodAccessor459222074.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:309)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.TraceInvocationHandler.invoke(TraceInvocationHandler.java:45)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.$Proxy254.getString(Unknown Source)
         at com.sap.aii.adapter.jdbc.JDBC2XI.convert2XML(JDBC2XI.java:954)
         at com.sap.aii.adapter.jdbc.JDBC2XI.invoke(JDBC2XI.java:492)
         at com.sap.aii.af.service.scheduler.JobBroker$Worker.run(JobBroker.java:475)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:99)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:119)
    Arguments : java.sql.SQLException: Cursor state not valid.
         at java.lang.Throwable.<init>(Throwable.java:194)
         at java.lang.Exception.<init>(Exception.java:41)
         at java.sql.SQLException.<init>(SQLException.java:40)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:389)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:366)
         at com.ibm.as400.access.AS400JDBCResultSet.getValue(AS400JDBCResultSet.java:3580)
         at com.ibm.as400.access.AS400JDBCResultSet.getString(AS400JDBCResultSet.java:3223)
         at sun.reflect.GeneratedMethodAccessor459222074.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:309)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.TraceInvocationHandler.invoke(TraceInvocationHandler.java:45)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.$Proxy254.getString(Unknown Source)
         at com.sap.aii.adapter.jdbc.JDBC2XI.convert2XML(JDBC2XI.java:954)
         at com.sap.aii.adapter.jdbc.JDBC2XI.invoke(JDBC2XI.java:492)
         at com.sap.aii.af.service.scheduler.JobBroker$Worker.run(JobBroker.java:475)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:99)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:119)
    Dsr Component :
    Dsr Transaction : d1f629d01d9b11dd984200145e742794
    Dsr User :
    Indent : 0
    Level : 0
    Message Code :
    Message Type : 1
    Relatives : com.sap.aii.adapter.jdbc.JDBC2XI
    Resource Bundlename :
    Session : 0
    Source : /Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/JDBC
    ThreadObject : XI JDBC2XI[JDBC_SND_DB2_VehicleReceiving/DB2PRD00/]_170
    Transaction : SAP J2EE Engine JTA Transaction : [0ffffffbdffffffa6ffffff960086]
    User : J2EE_GUEST
    Regards
    Ganga Prasad

  • JDBC Sender Adapter -  NOT FETCHING RECORDS -PROCESSING STARTED

    Hello all,
    I have set up a JDBC sender adapter .With polling interval as 30 Seconds. Polling is done successfully
    but it does not fetch the records .
    Valid Data is present in the tables.In the Communication Channel Monitoring log shows :
    "Processing Started"
    after each poll interval.
    Adding to this , it was working fine  with the same parameters two days back.
    I have enabled the Driver Trace but didnot get any information from Trace.
    How to resolve this issue?Any help
    Regards
    Ganga Prasad

    Hello maheshwari,
    Valid Data is there & many records are there to be fetched.
    One more thing  Normally in the Communication Channel Monitoring
    for an JDBC adapter even if there are no records to fetch we get the Log information in detail that :
    Polling interval started.
    Processing finished successfully
    Processing started
    Polling interval started.
    Processing finished successfully
    Processing started
    But here in my case am getting only : (polling interval : is 60 Seconds)
            2/5/08 8:29:19 AM           Processing started
         2/5/08 8:28:19 AM           Processing started
         2/4/08 3:34:54 PM           Processing started
         2/4/08 3:33:54 PM           Processing started
    One more observation is that my poll interval is 60 seconds but now it is polling after every 120sec
           2/5/08 11:17:31 AM           Processing started
         2/5/08 11:15:31 AM           Processing started
         2/5/08 11:13:31 AM           Processing started
         2/5/08 11:11:31 AM           Processing started
    I have tried refreshing Cache but no change .
    Regards
    Prasad

  • JDBC sender adapter - driver problems

    Hi.
    Iu2019m struggling with a little problem regarding the JDBC sender adapter, querying an Oracle database.
    Iu2019m making a simple SELECT statement, where one of the fields is of the typeu201DTIMESTAMP(0) WITH LOCAL TIMEu201D.
    Making the query in a SQL client works just fine, but in the JDBC sender adapter, it generates this error u201DError during conversion of query result to XML: java.sql.SQLException: Session Time Zone not set!u201D
    Iu2019ve searched for answers on numerous forums, and found one place, where the following where the solution:
    >>> Hi. The issue is that the driver itself needs to have a time zone
    >>> set. You have to call setSessionTimeZone() on the connection object.
    Unfortunately it is a bit hard to call this function in the adapter.
    Any of you guys have an idea what to do?
    I can add, that making a query, where no date fields are selected, works fine in the adapter.
    Regards...
    Peter

    Problem solved...
    Put a conversion (CONCAT, SUBSTR, TO_CHAR, etc.) around the date field you are about to fetch, and it works just fine.

  • 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

  • Select query problem in JDBC sender adapter

    Hello Experts,
    We have a problem with PI sender adapter that PI has started to miss records in database some database records are missing and we are using the below selet query :
    SELECT * FROM [database name].[dbo].[Material_Movement] WHERE [Process_Order_Number] = (Select TOP 1 [Process_Order_Number] FROM [database name].[dbo].[Material_Movement] WHERE ([PI_Read_Date] IS NULL AND [Movement_Type] = (SELECT TOP 1 [Movement_Type] FROM [database name].[dbo].[Material_Movement] WHERE [Transaction_Code] = 'xyz' AND [PI_Read_Date] IS NULL ORDER BY Created_Date ASC))) AND [Transaction_Code] = 'xyz' AND [Movement_Type] = (SELECT TOP 1 [Movement_Type] FROM [database name].[dbo].[Material_Movement] WHERE [Transaction_Code] = 'xyz' AND [PI_Read_Date] IS NULL ORDER BY Created_Date ASC) AND [PI_Read_Date] IS NULL ORDER BY [Transaction_ID] ASC
    I am weak in select query could you please check and suggest how the query can be modified to avoid this issue .
    Thanks,
    Somenath

    Hi ,
    After looking into These Query .. I found ...
    Your Query Will run such Kind of scenario ..
    1.)   Movement Type will be fetched from from below Query
            SELECT TOP 1 Movement_Type
            FROM database name.dbo.Material_Movement
            WHERE Transaction_Code = 'xyz'
           AND PI_Read_Date IS NULL
            ORDER BY Created_Date ASC
    2.) on the  basis of abovr fetched  moment code . your Query will fetch 1 Process Order number
    Select TOP 1 Process_Order_Number
    FROM database name.dbo.Material_Movement
    WHERE ( PI_Read_Date IS NULL
                  AND Movement_Type =  Moment Type will be same as 1.
    3.)
    After  Getting 1 and 2 . Query will fetch Data  from table " dbo.Material_Movement "
    On the basis of ..
    Movement_Type = value from 1.
    Process_order_type = value from 2.
    Transaction_Code = 'xyz'
    ORDER BY Transaction_ID ASC
    So check Missed record Fullfill this Condition or not ....................
    If not ... You will get why they are not picked by your given Query ...........
    Hope it helps ..
    regards
    Prabhat Sharma.

  • 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

Maybe you are looking for