Help with jdbc to file scenario
Hi guys,
I want to do a JDBC to file scenario. I need to do a SELECT * query from my table.
An external application does the updation into my tables. I needed XI to connect to my JDBC system whenever there is an update in the tables and post it as a file.
Please guide me on this guys
Varun
as pointed out have a indicator in ur table that is updated by the external system for setting that the record is read when the jdbc is polled. this would be help for avoiding reading the same records again and again whioch results in duplication. u can follow this blog (reve engg )
/people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
Similar Messages
-
JDBC-XI-FILE scenario. How to extract data from more than one table in JDBC
Hi,
I was asked a question like in JDBC-XI-FILE scenario........ How to extract data from more than one tables (i.e from JDBC system) ?? What is the logic to do the same ??
I am not sure whether this is a valid question..........but any help in this regards is highly appreciated.
Regards
KumarHI,
Yes it can be possible ,please see the following links
JDBC Receiver with Oracle Stored Procedures
configuring jdbc adapter with multiple tables
RFC -> XI -> JDBC Scenario Updating Multiple Tables
/people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes
JDBC Adapter multiple Selects
https://www.sdn.sap.com/irj/sdn/advancedsearch?query=jdbc%20with%20multiple%20tables&cat=sdn_all
Regards
Chilla.. -
File - to - JDBC- to - File Scenario using Stored Procedure
Hi,
I want to do File - to - JDBC - to - File scenario, because I'm getting data in a file format and that data i want to load in a database. Database level i have a stored procedure. if any exceptions. my stored procedure will give the Response. so, now i want to store that resposne in a file..
for this. what are the steps we have to use. is this scenario will comes in Synch ronous or Asynchronous ? and I have searched the web blogs also. al the blogs are related to Http or Soap with JDBC . so, please give me some input help about this...
how many data types we have to create... any body having step step procedure for this...
regards
JainHi,
You will need a BPM in your design as Sender File adapter does not support Synchronous messaging. Refer my answer in this thread (page 2) and have your design accordingly....instead of RFC you will have a file adapter as the ultimate receiver.
Re: BPM FILE--> JDBC--> RFC
Just take care of below things:
1) JDBC message format is as per the guidelines
[Message format for sending req to JDBC|http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm]
2) check for the format of your source and target file format (if it is a Flat-file with a xml structure that XI can parse then no need of FCC but if it is a CSV file then you will need FCC)
Regards,
Abhishek
Edited by: abhishek salvi on Apr 14, 2009 7:32 PM -
Dear Bhavesh,
I am doing a File to JDBC to File Scenario from your reference blog https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3928. [original link is broken] [original link is broken] [original link is broken] [original link is broken] This scenario is same as File to RFC to File scenario I believe. The only change I found is in Message Interface.
The Message Interface used here are:
1. OB File Request
2. OB Abs File Request
3. IB File Response
4. IB Abs File Response
5. Abs Syn File Request File Response
6. Abs Syn JDBC Request JDBC Response.
I am able to get the response from JDBC but while mapping to file I am getting mapping error. In fact I have followed ur Blog as it is.
The IP steps are:
Receive Step , Syn Send (Abs Syn File Request File Response) Step , Send Step.
Could you please help me out, if you have time .
Thanks in advance.
ShaikHi ,
Sorry for pointing you the thread.
I have created the IR as it is in File RFC File Scenario, but I have created Abs Syn Message Interface for JDBC request and Response.
I have two Abs sync Message Interface and two mapping programs, namely
Source Interface:
Abs Sync Message Interface
File Request
File Response
Target Interface:
Abs Sync Message Interface
JDBC Request
JDBC Response
Mapping Interface:
File Request to JDBC Request
JDBC Response to File Response. -
I need help with a PDF file that is an image, the "Read Out Loud' option does not work, please help!
You mean an image such as a scanned document?
If that is the case, the file doesn't contain any text for Reader Out Loud to read. In order to fix that, you would need an application such as Adobe Acrobat that does Optical Character Recognition to convert the images to actual text.
You can also try to export the file as a Word document or something else using ExportPDF which I believe offers OCR and is cheaper than Acrobat. -
Hey Experts,
I have a scenario from JDBC to File (xml) scenario.
The problem is that the data is being picked up from the data base and is sent through the sender JDBC channel to the receiver file adapter channel where the file content conversion is done. But when I check the output text file, it is empty. When I go to SXMB_MONI to check if there is any error, every thing is fine with a checkered flag on the message. My sender and the receiver data types are the same.
Here is the scenario:
DT_sender and DT_receiver ---> row
NAME
ID
GRADE
payload from the sender channel is:
<MT_DB2FILE_SENDER>
< row>
<NAME>CNCN</NAME>
<ID>222</ID>
<GRADE>A</GRADE>
</MT_DB2FILE_SENDER>
When the content conversion is done with the parameters :
Recordset structure : row,1
row.fieldNames : NAME,ID,GRADE
row.fieldSeparator : \t
row.endSeparator: 'nl'
The text file that is generated is empty. I have tried out all the posts that are related to this topic. But I could not find the suitable answer. ANy help would be greatly appreciated.
Regards.Hey
I m a little confused here
In your earlier reply,you posted
<?xml version="1.0" encoding="UTF-8" ?>
<ns0:MT_DB2FILE_RECEIVER xmlns:ns0="http://jdbc2jdbc" />
and now you are posting this
<?xml version="1.0" encoding="utf-8" ?>
- <MT_DB2FILE_SENDER>
- <row>
<NAME>CHAD</NAME>
<ID>204</ID>
<GRADE>A</GRADE>
</row>
- <row>
<NAME>TYLER</NAME>
<ID>204</ID>
<GRADE>A</GRADE>
</row>
- <row>
<NAME>AMER</NAME>
<ID>204</ID>
<GRADE>A</GRADE>
</row>
- <row>
<NAME>BASHIR</NAME>
<ID>204</ID>
<GRADE>A</GRADE>
</row>
- <row>
<NAME>WENBIN</NAME>
<ID>206</ID>
<GRADE>A</GRADE>
</row>
- <row>
<NAME>lilian</NAME>
<ID>139</ID>
<GRADE>A</GRADE>
</row>
</MT_DB2FILE_SENDER>
The above looks like a sender structure to me.
Could you please confirm this is exactly the payload you are getting in sxmb_moni under Technical routing .
Thanks
Aamir -
Jdbc to file scenario - base mapping error
hello all,
i am facing a similar issue discussed in this thread,
Re: JDBC to FILE scenatio: How to map the resultSet?
1. i changed the document name and namespace
2. i checked for the occurence of the filed elements
3. i tried using the documentname and namespce both from the MONI and MAPPING TEST TAB...but still the same base mapping runtime exception error.
Please advice.
Thanks
i have been following theAarthi,
Can you give us the following details,
1. select query that you are using in your JDBC sender adapter
2.the Document Name and namespace that you have given in the JDBC adapter
3. the source datatype that you have created for your JDBC side along with the occurence of each element.
This will help us nail the causwe for your problem.
Regards,
bhavesh -
Soap with attachment To File scenario
Hi All,
In my scenario I need to read data on webservice with file in attachments. Webservice in will have two values- data in payload and file in attachments. And on the target side two files one XML with data and one attachment must be created on the file directory.
Can any one help me how this task can be implemented in XI
Thanks in advance.
Regards,
VikramHi,
some links about this topic:
SOAP to file scenario
Send a file usring SOAP adapter
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d23cbe11-0d01-0010-5287-873a22024f79
Hope it helps.
Regards
Patrick -
Reg:JDBC to FILE Scenario
Hi All,
My scenario is JDBC to File.
In receiver file communication channel I will be using the Conversion Agent tool and the file name should reflect either the value of the Field say <NAME>TEST</NAME> ,then my output file name will be TEST.CSV or the Busines Service name ie BS_TEST ,then it should be BS_TEST.CSV
Please suggest me on this.
Thanks in Advance,
Lavanya.BHi,
Check this blog for using the Busines Service name as your file name:
/people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
the same you can use the Variables from Payload to get the field name as file name check [this|http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm] link and go to variable subsitution section second option If the variable refers to an element in XML schema, add the prefix payload:
Sachin -
JDBC to file scenario - Time limit exceeded
Hi All,
I am getting timelimit exceeded error in the inbound queues when I am processing the interface JDBC-XI-file. I have tried many options like registering the queues, changed the integration engine configuraion parameters for timeout , checked the memory space. When less data is being sent like 50kb then it is executing successfully. With large data the messages are getting stuck in the queues and then giving the timeout error.
Also when I am checking in sm50 it showing that some rfc is going on hold.
Please suggest .
Thanks,
AparnaThanks for the reply Pragati.
What will be the UDF code for RFC lookup in case of passing the data in Queue. I am currently using the below code for gettng single value.
Also is it possible to get multiple output values which can be mapped to different target fields. Currently I am using different rfc lookups for different target fields. So if I can combine them into single rfc lookup them this may effect the performance.
//write your code here
String content = "";
MappingTrace importanttrace;
importanttrace = container.getTrace();
// Create document builder to create DOM XML document
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = null;
factory.setNamespaceAware(false);
factory.setValidating(false);
try {
// Create XML document using document builder
builder = factory.newDocumentBuilder();
} catch (Exception e) {
importanttrace.addWarning("Error creating DocumentBuilder - " + e.getMessage());
return null;
// filling the string with our RFC-XML (with values)
String m ="<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns1:ZFI_GET_COCODE xmlns:ns1=\"urn:sap-com:document:sap:rfc:functions\"><COMPANYID>" + a + "</COMPANYID></ns1:ZFI_GET_COCODE>";
RfcAccessor accessor = null;
ByteArrayOutputStream out = null;
Payload result = null;
try
// 1. Determine a channel (Business system, Communication channel)
Channel channel = LookupService.getChannel("BS_SAP_DEC210","CC_RECEIVER_RFC_test");
// 2. Get a RFC accessor for a channel.
accessor = LookupService.getRfcAccessor(channel);
// 3. Create a xml input stream representing the function module request message.
InputStream inputStream = new ByteArrayInputStream(m.getBytes());
// 4. Create xml payload
XmlPayload payload = LookupService.getXmlPayload(inputStream);
// 5. Execute lookup
result = accessor.call(payload);
/*InputStream in = result.getContent();
out = new ByteArrayOutputStream(1024);
byte[] buffer = new byte[1024];
for (int read = in.read(buffer); read > 0; read = in.read(buffer)) {
out.write(buffer, 0, read);
content = out.toString();
if (result == null) {
importanttrace.addWarning("result of RFC call is null");
catch(LookupException e)
importanttrace.addWarning("Error while lookup " + e.getMessage() );
Document docResponse = null;
InputStream in = result.getContent();
String res = "";
try {
docResponse = builder.parse(in);
if (docResponse == null) {
importanttrace.addWarning("docResponse is null");
res = docResponse.getElementsByTagName("COMPANY_CODE").item(0).getFirstChild().getNodeValue();
if (res == null) {
importanttrace.addWarning("res is null");
catch (Exception e) {
importanttrace.addWarning("Error when parsing RFC Response - " + e.getMessage());
try {
// Free resources, close the accessor..
if (accessor != null) {
try {
accessor.close();
} catch (LookupException e) {
importanttrace.addWarning( "Error while closing accessor " + e.getMessage());
} catch (Exception e) {
importanttrace.addWarning("Result value not found in DOM - " + e);
// return the result obtained above
return res;
Thanks. -
[Need help with a swf file]
Hello,
I need help with a flash demo that I am creating. I have a
main swf file that contains links to other sub swfs that I have
created. What I really want this to do is... when I click on one of
the link on the browser, the other swf have to load in the window.
I tried to code it with .loadMovie,.... but for some weird reason,
it is not showing up.
Can anyone help me on this?
Thanksyou might have a security violation and you do have a
load-target issue. remove that "_parent": there's no 2nd parameter
in the loadMovie() method.
if you want to replace the main swf with that url, loading
into _root is fine. otherwise, you want to use a different
target. -
I'm Starting in Java programing and need some help.
Based in the information of txt file, I need to split a file.txt into "n" .txt files, depending of the blocks thats the file containt. It's delimited by """".
And put the name between "UZ0RN0" the second field
Example:
"01APR02","UZ0RN0","******************************************
EMHA PNR.UZ0RN0 CR01APR 0419Z MEX BY GS BT
MEX GS BT 01APR 0421Z 385310 MX
"01APR02","TSCS44","******************************************
etc.
My question is how do I split a file into parts eg split test.txt into UZ0RN0.txt, TSCS44.txt, etc.
Pls help. Where do I start? I just need help with the the manage of the java.nio.channels.FileChannel to generate several files
Thanks a lot.Ok Thats is the final code:
This program divide a file.txt in "n" files.txt's according of the block's that the file.txt contain and catch the name of the second tokent to name the new file.txt
import java.io.*;
import java.nio.*;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
public class FileCopy {
public static void main(String[] args) {
if(args.length==0) {
System.out.println("No existe archivo a copiar. Application usage is: \n" +
"java -classpath. Filecopy \" filepath\"" );
System.exit(1);
File fromFile = new File(args[0]);
if(!fromFile.exists()) {
System.out.println("Archivo a copiar. " + fromFile.getAbsolutePath()
+ ", no existe.");
System.exit(1);
FileInputStream inFile = null;
try{
inFile = new FileInputStream(fromFile);
} catch(FileNotFoundException e) {
e.printStackTrace(System.err);
//assert false;
FileChannel inChannel = inFile.getChannel();
try{
int SizeFile = (int)inChannel.size();
ByteBuffer buf = ByteBuffer.allocate(SizeFile);
int length = 0;
int lengthArch = 0;
int NoArch = 0;
int NoComilla = 0;
String str = new String("");
try{
while ((length = inChannel.read(buf)) != -1 ) {
buf.rewind();
for (int i=0; i<length; i++) {
lengthArch++;
byte b = buf.get();
//Delimita caracter. Cada bloque tiene 6 "'s
if ( b == 34 ) {
NoArch++;
NoComilla++;
//Definir nombre del archivo
if (NoComilla==3) {
if ( b!=34) {
str += (char)b;
//Imprime archivo
if (NoComilla==6) {
fromFile = fromFile.getAbsoluteFile(); //Asegura una ruta absoluta
File parentDir = new File(fromFile.getParent()); //Obtiene el directorio
File bFile = new File(parentDir,str + ".txt"); //Genera nuevo archivo
str = ("");
File toFile1 = createFile(bFile);
FileOutputStream outFile1 = null;
try{
outFile1 = new FileOutputStream(toFile1);
} catch(FileNotFoundException e) {
e.printStackTrace(System.err);
//assert false;
FileChannel outChannel1 = outFile1.getChannel();
// Write the files
try {
inChannel.transferTo(((i + 1) - lengthArch),lengthArch,outChannel1);
outFile1.close(); // Close the output stream & the channel
System.out.println("Archivo " + (NoArch/6) +": " + ((i +1) - lengthArch) + " long " + lengthArch);
} catch(IOException e) {
e.printStackTrace(System.err);
System.exit(1);
lengthArch = 0;
NoComilla = 0;
//System.out.print((char)b);
buf.clear();
System.out.println("Tamano del archivo de Origen " + SizeFile);
System.out.println("EOF " + (NoArch/6) + " Archivos copiados.");
catch(IOException e) {
e.printStackTrace(System.err);
System.exit(1);
inFile.close();
} catch(IOException e) {
e.printStackTrace(System.err);
System.exit(1);
System.exit(0);
// Metodo para crear un achivo y en caso de que exista hacer *+_backup.*
public static File createFile(File aFile) {
aFile = aFile.getAbsoluteFile(); //Asegura una ruta absoluta
File parentDir = new File(aFile.getParent()); //Obtiene el directorio
String name = aFile.getName(); //Obtiene el nombre del archivo
int period = name.indexOf('.'); //Busca el separador de la extension
if(period == -1) //Si no es
period = name.length(); //Lo coloca al final del String
String nameAdd = "_backup"; //Agrega "Backup" al nombre
//Crea el objeto archivo que es unico
File backup = new File(name.substring(0,period)
+ name.substring(period));
while (backup.exists()) { //Si el nombre ya existe....
name = backup.getName(); //Obtiene el nombre actual del archivo
period += nameAdd.length(); //Agrega el separador
backup = new File(parentDir, name.substring(0,period) //agrega backup de nuevo
+ nameAdd + name.substring(period));
return backup;
This is the example of the file with 2 blocks
"01APR02","UZ0RN0","******************************************
EMHA PNR.UZ0RN0 CR01APR 0419Z MEX BY GS BT
385310 MX
***1.ALCANTARA/JORGEALBERTO
FONE-MEX/N000
RCVD-PAX
TKT -T/OK
1 MX 7M 01APR MEXMTY HK 1 650A 815A
AB * FLT 7 7A
RCVD-PAX
MEX GS BT 01APR 0419Z 385310 MX
AB | FLT 7 7A
RCVD-PAX
MEX GS BT 01APR 0421Z 385310 MX
"01APR02","TSCS44","******************************************
.... PNR.TSCS44 CR25MAR 1834Z HDQ BY RM 1S
***1.1BRAVO/OCTAVIO
FONE-MTY1-81503300*A/A528
RLOC-HDQ1SJOXMWV/D4C2/86511574/MTY/1S/T/MX
/MXN
G FX-OSI YY 86511574 / VILLATOURS CENTRO P
CC D4C2
OSI MX TKNA 13235822315830
SSRSEATMXHS1MTYMEX0070K28MAR.16B
SSRSEATMXHS1MEXMTY0007K01APR.09B
1 MX 70K 28MAR MTYMEX HK 1 645A 815A
2 MX 7K 01APR MEXMTY HK 1 650A 815A
X3 SSRSEATMXNN1MTYMEX0070K28MAR.16B
RCVD-
HDQ RM 1S 25MAR 2205Z
X3 SSRSEATMXNN1MEXMTY0007K01APR.09B
RCVD-
HDQ RM 1S 25MAR 2231Z
X3 SSRSEATMXKK1MTYMEX0070K28MAR.16BN
X3 SSRSEATMXKK1MEXMTY0007K01APR.09BN
RCHDQ1SJOXMWV/D4C2/86511574/MTY/1S/T/MX
/MXN
HDQ RM 1S 26MAR 0055Z
Chao/Bye -
Problem with IDOC TO FILE Scenario
Hi Experts,
I am doing IDOC TO FILE Scenario.
I have done all the configuration.I have cretaed RFC,PORT,LS and Partner profile at both R/3 and
XI Side.
when I am trying to generate IDOC using we19 and I put the r/3 port,partner in sender and XI
port and partner in receiver it gives me error as "Port 'SAPCU6_100' does not exist in the table
of port descriptions.
Please help me.....
RegardsHI Saras,
Please go through the below weblog which has all the stpes which is required for ur scenario...I think screen by screen help u to debug ur problem and it will help u to find out the msitake which u have made.
File To IDOC - Part1 (SLD and Design):
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/2007/05/11/fileToIDOC&
File To IDOC - Part2 (Configuration):
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/2007/05/11/fileToIDOC-Part2+(Configuration)&
File To IDOC - Part3 (Steps required in XI and R3):
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/2007/05/11/fileToIDOC-Part3(StepsrequiredinXIandR3)&
Thnx
Chirag -
Need help with .cr2 RAW-files
Hi,
I've installed Aperture 2.1.2, and the newest RAW compability update (2.5).
However, when I try to work with RAW files from my Canon EOS 1000D camera (nothing big, I know), all I see is "Unsupported image format".
I really need help with this quick. The RAW files are in .cr2 format.as a last resort ...
this is the update that added support for 1000d ... however the 3 releases post this should have it too ...
http://www.apple.com/downloads/macosx/apple/application_updates/digitalcameraraw compatibilityupdate22.html
but you can roll back your raw compatibility and see if that works ... then progressively go forward to current and see if/where the problem lies ...
you could try a re-install of 2.5 ...
http://support.apple.com/downloads/DigitalCamera_RAW_Compatibility_Update_25
info on rolling back the update is in this thread:
http://discussions.apple.com/thread.jspa?messageID=9097867 -
Begging for help with podcast xml file
Hey All,
I have a podcast on iTunes. I am hosting the xml file and podcast mp3s on a friends server so Im not using any service. Everything is working and Ive sucessfully added 4 podcasts so far, and it shows up correctly in iTunes on my PC.
However my podcasts do not showup correct in the iTunes store website, or on idevices. Meaning, I number my shows 001_"NAME" 002_"NAME" etc. Yet in the iTunes store they show up out of order. So my last show is not at the top its at the bottom, and they are all mixed up (like 002, 001, 004, 003 instead of 4,3,2,1) Also the publish date is the same on two of them (and not what i have in the xml file) and doesnt show up at all on the other two. I assume this is a problem with the xml file, yet I dont see any problems with it. But it seems odd that it all works correctly in the actual iTunes program. Ive tried different code, but im very much a noob at it, and everything i find online is from 5 - 10 years ago or wants you to host your podcasts with their site and I dont need that.
Here is the link to the show on the iTunes website so you can see what i mean: http://itunes.apple.com/us/podcast/your-reality-recap/id501295325
If anybody can, would you mind checking out the code in my xml file and letting me know if you see anything thats causing this issue?
I zipped the xml file and put it here: http://www.ericcurto.com/podcast/YRR.zip
I would be truly greatfuly for any help with this. Ive been trying to fix this for days and dont know what else to do.
Thanks!
EricYour feed is at http://www.ericcurto.com/podcast/YourRealityRecap.xml (please always post the feed URL, not its contents or a copy).
I don't see the issues you mention. The order in the Store and when subscribing is what I would expect:
The order in the Store depends on clicking the header to the column: the default is the first one. Some of the dates are a day out - this is quite commmon and is probably a time zone issue (it may be different where you are - I'm in the UK). I don't know why you are seeing a garbled order unless you've clicked on one of the other columns in the Store.
Maybe you are looking for
-
I'm wondering why Mac OS X's built-in Inkwell (handwriting recognition) doesn't activate when Magic Trackpad is connected. Yes, I realise that originally Inkwell activates when a graphics tablet is connected, but I think the Magic Trackpad is sensiti
-
I want to delete all of icloud and reinstall it. How?
For more than a week, iCloud has been deleting all of my emails as soon as received. I have spent MANY hours on the phone to Apple support. I'm told they can fix it within 7 business days!!! Can't I just wipe the system and start fresh?
-
Hi Guys! I have an Imac with Mac OS X version 10.5.8 and bought a wireless keyboard. Unfortunately I can´t use the volume buttons on the keyboard. I have checked almost everything, does anyone have any good idea?
-
How can I synchronize my hotmail email to my Iphone 4 ?
ANY idea ?
-
Why doesn't my phone ring when I've got screen lock activated?
This has been driving me crazy and I need to know how to fix it. I like to have the screen lock activated on my phone (otherwise it will be in my purse calling people without me even touching it) but when I get an incoming call my phone doesn't ring,