JDBC Sender scenario
Hi All,
I am creating a JDBC -> Idoc scenario.I have a clarification required,
Do I need to create the DataType(Sender JDBC Structure) with all the fields in the table ,or if it is OK to create a Datatype with only the fields of the table which I am going to extract.
Thanks,
Venu
You do not have to include all the fields in your data type, it depends on your business requirement.
To create datatype quickly and effeciately, you can down load a tool I wrote:
/people/liang.ji/blog/2009/03/03/data-type-generator
Regards.
Liang
Edited by: Liang Ji on Mar 17, 2009 6:41 PM
Similar Messages
-
MS Access (JDBC Sender) to File Scenario
Hi,
I want to read an MS Access File thru JDBC Sender Adapter & send the entire details present in MS Access to a File .
Kindly need your valid inputs on this .Hi,
I have configured Sender JDBC adpater as follows :
JDBC Driver : sun.jdbc.odbc.JdbcOdbcDriver
Connection : jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=
piramid\data\PNG\inf78786\IN\Employee.mdb;
I am getting the following error in Communication Channel monitoring ->
Error during database connection to the database URL 'jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=
piramid\data\PNG\inf78786\IN\Employee.mdb;' using the JDBC driver 'sun.jdbc.odbc.JdbcOdbcDriver': 'com.sap.aii.adapter.jdbc.sql.DriverManagerException: Can not establish connection:: SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified'
What might be the issue here ? -
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!
GlennThank 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 -
Hi All,
I'm doing a scenario as JDBC2FILE.
I tried to add my jdbc sender system to SLD. So i created the technical system
now i'm creating business system...what should i give at logical system name tab? I've created tech system and business system as third party.
do we need logical system name in this scenario where we are not interacting with any R/3???
can anyone suggest the way to achieve this scenario?
Thanks in advance.....
Santhosh.Hi Santhosh,
I just want to add ons..few more information which it might help you.
You no need to give logical system when you are using Thirdpaty.
Please check the below blog you will get more idea how to proceed to achieve the JDBC Scenario.
/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
If you have any doubts while proceeding with your scenario plesae let me know..I will try my level best.
Thanks and Regards,
Chandu -
JDBC send data to oracle, oracle only accept column name in Upper case
Hi experts,
I am doing a scenario File --> XI --> JDBC, JDBC send data to a Oracle 10g database, I have configured JDBC receiver to use XML-SQL format. in oracle database , table "EMPLOYEE" has a column "NAME", but when I send data to oracle using JDBC receiver, the column is "name", then XI complains
" 'EMPLOYEE' (structure 'insert'): java.sql.SQLException: FATAL ERROR: Column 'name' does not exist in table 'EMPLOYEE'.
can anyone help me to let oracle accpet column "name". I can't change colum in JDBC receiver from "name" to "NAME".
Thanks a lot.<i>can anyone help me to let oracle accpet column "name"</i>
Making Oracle case insensitive is not possible (in my opinion). By default all object names are stored in UPPER case in the rdbms dictionary.
When XI searches for column name in Oracle, this search is case sensitive. So u have to configure accordingly.
Regards,
Prateek -
Update query not working in the JDBC sender Communication channel
Hi,
We are working on JDBC to File scenario. As per the configuration, XI should pick the data from SQL database every 20 secs and should update the corresponding flag. We are using subquery in the select and update statement as both header and detail tables are involved.
Now the issue is, select query is working fine but update statement is not working as expected. It is somehow updating some other records rather than doing for the ones selected by the adapter.
Moreover logSQLstatement is also not working. Hence we are unable to identify the records which are getting updated.
Please advise.Hi Rumi,
See Question 8. Transaction Handling (Sender) in [SAP Note 831162 - FAQ: XI 3.0 / PI 7.0 / PI 7.1 JDBC Adapter|https://websmp130.sap-ag.de/sap(bD1wdCZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=831162].
8. Transaction Handling (Sender)
Q: If I have the following configured in a JDBC Sender:
Select Query:
SELECT column FROM TABLENAME WHERE FLAG = "TRUE"
Update Query:
UPDATE TABLENAME SET FLAG = "FALSE" WHERE FLAG = "TRUE"
How do I know that the JDBC adapter will not update newly added rows (rows that were
added between the time that the SELECT and UPDATE queries were executed) that were
not read in the initial SELECT query?
A: The SELECT and the UPDATE are run in the same DB transaction, i.e. both statements
have the same view on the database.
Make sure that both statements use the same WHERE clause. An additional
requirement for the correct operation of this scenario is the configuration of
an appropriate transaction isolation level on the database
(i.e., repeatable_read or serializable). You might also consider using a
"SELECT FOR UPDATE" statement instead of a plain SELECT statement to
ensure proper locking on the database. "SELECT FOR UPDATE"
is not supported in MS SQL database. In this case please make use of an
appropriate transaction isolation level on the database. For more details
please contact your DB vendors.
After, see Transaction Handling Issues in [SAP Note 1039779 - JDBC Adapter issues(Escape character,Transaction handling)|https://websmp130.sap-ag.de/sap(bD1wdCZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1039779].
Best Regards.
Pedro Baroni -
Variable in Select statement JDBC sender
Hi All,
I am working on JDBC sender and this scenario is working fine. Now the legacy system has different enviroment for development, quality and production so I need to change the enviroment for each system.
Is there any way I can make it as variable and the movment it system checks it's development of XI system then it should pick up right enviroment for legacy system and that can be used in select statement.
My select statement looks like and highlighted one is the enviroment which needs to be a variable.
select digits(HMOUTLT) as HMOUTLT, hmprodu as HMPRODU, HMCHKOQ as HMCHKOQ, HMCHKiQ as HMCHKIQ, HMWKPER as HMKPER, HMLSDAT as HMLSDAT from bi5filmm.bsimhp where hmprflg = ' ' and rrn(bsimhp) < 3000 and hmextdt = '2007-12-24'.
I am not sure if value mapping can be used here or not.
regards
Riasolved
-
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,
SujathaHi,
>>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 AMHi 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 -
JDBC Sender Communication channel stop working
Hi all,
I'm facing with a strange problem: I have a db to db scenario (SQL server to Oracle) that has been tested and that was working properly.
But when we started again our tests after some days, without doing any change, the flow didn't start anymore. The problem is in the sender jdbc communication channel:
creating it again with a NEW NAME, and changing the configuration the flow starts again. I try to explain the checks that I did:
- from the runtime workbench the adapter looks ok: green and making polling to the db (obviously without select any record even if we were sure that the select condition was satisfied by some records).
- I tried to simulate some changes re-activating the communication channel.
- clear cache
Nothing was working,the only solution was to re-create the cc with a new name (deleting the old one and creating a new one with the same name is not working as well). But we cannot consider this solution in a production system.
I have several scenarios like this and this problem happened three times in some months and every time with the jdbc sender from SQL server (never with the sender from Oracle).
There is someone that has any suggestion?
Thanks in advance,
Luciana AgostiniHi Luciana,
There is nothing that you could do in PI that could help because most of the places where there could be a problem like cache or with adapter statuses you have already looked into . For the sake of a second opinion see what prateek srivastava has to say.
Basically a n/w connection problem or at the SQL db level.
Rgds
joel -
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> -
Execution time difference between SELECT & UPDATE statement in JDBC Sender.
Hi Experts,
In my scenario, I have used the JDBC Sender Adapter with the SELECT and UPDATE statement.
Now the problem is in between the execution of Select and update statement, few more entries are coming in the same DB Table.
So result of this is updation take place for those entries which are not even picked up by the select statement.
Can we avoid this execution time difference between the SELECT & UPDATE statemet on JDBC Sender side???
Thanks & Regards
JageshHi
Use serializable option in additional parameters, now all new entries would also be updated. -
Hello all,
I am trying the JDBC to file Scenario. There are 5 records in a table, i can see the records in the MONI being successfully picked by the sender jdbc adapter, after being picked up i want those records to be deleted. So i write a DELETE statement in the UPDATE SQL Querey but i cannot see those records deleted from the database. i think i need to specify some COMMIT which i am not sure of, can you please provide me your suggestions for deleting records from database.
Thanks in advanceSAP Note if from SAP Service Market place. The link is
https://websmp103.sap-ag.de/notes
And the content of this SAP note is -
<i>Q: If I have the following configured in a JDBC Sender:
Select Query:
SELECT column FROM TABLENAME WHERE FLAG = "TRUE"
Update Query:
UPDATE TABLENAME SET FLAG = "FALSE" WHERE FLAG = "TRUE"
How do I know that the JDBC adapter will not update newly added rows (rows that were added between the time that the SELECT and UPDATE queries were executed) that were not read in the initial SELECT query?
A: The SELECT and the UPDATE are run in the same DB transaction, i.e. both statements have the same view on the database.
Make sure that both statements use the same WHERE clause. An additional requirement for the correct operation of this scenario is the configuration of an appropriate transaction isolation level on the database (i.e., repeatable_read or serializable). You might also consider using a "SELECT FOR UPDATE" statement instead of a plain SELECT statement to ensure proper locking on the database.</i>
Did you check this -
<i>Processing can only be performed correctly when the Transaction Isolation Level is set to repeatable_read or serializable.</i>
Regards,
Moorthy -
Hi All,
Is there a way to submit SQL statement with dynamic parametr to the JDBC sender?
I need to get the current date of the PI machine and use it in the "where" cluase of the "Query SQL Statement" dynamically in the "Proccessing" tab of the JDBC sender
Thanks,
RannyWhat I can do is , Suggest you a way for your reqt.
Create a Synchronous Scenario ....
Sender -> XI -> Receiver(JDBC) will Give Response on the basis of your query
On Receiver (JDBC) Side , create `your query like your reqt with Date parameter in mapping Tranformation.
Regards
Prabhat Sharma
Maybe you are looking for
-
I just got the 7th generation nano and am having problems getting it to sync with itunes. I already have an itunes library with several playlists. My main laptop (a Toshiba) is suddenly no longer recognizing my ipod, so I downloaded iTunes on anoth
-
This has been hit on in other threads, but I still have not found an answer to my issue. Whenever I run Adobe Acrobat 8 Pro from the Start menu, or double click on a .pdf file I get the Microsoft Visual C++ Runtime Library Error, runtime Error. Thi
-
Recommended way to handle a serious number of assets?
Hi, at my company we are developing a number of commercial games for mobile devices. I can't give many details about the project due to agreements with potential publishers but I would like to emphasize that this is a large, serious project, with a l
-
Lenovo IdeaCentre A720 use as a Touch Monitor 4 a Mac Laptop - ???
Hi I am wanting to purchase an A720 but have two queries I was hoping could be answered before I do. 1) Appreciate the Lenovo is an all in one PC but can it be used as a touch monitor for another pc. I.e a working touch monitor for a windows 8 lapt
-
IOS strips exif from uploaded photos. Any way around this?
Works on desktops and [cough] Android. I've tried 6 browsers and same results. Seems to be a big limitation. I get the security, but perhaps they could offer to strip it as a setting. Flickr people complain about it too.