cancel
Showing results for 
Search instead for 
Did you mean: 

XML mapped directly into dbtable

Former Member
0 Kudos

Hi guys,

I've one doubt related to xml mapping. I've searched and read lots of posts on the forum about XML, but the doubt is still remaining...

Imagine I have a XML response to an webservice and I'd like to pass it to an dbtable.

I know I can use DOM to parse the xml, and I've even seen I can build a table based on hierarchies nodes, but what I'd like to know is if it's possible to pass all the content from the XML directly to my dbtable.

Why do I want to do this? Because the xml which is sent is really huge, and if I'd have to parse it, there would be tons of abap code.... So, I'd like to pass it directly to my table...

I could validate the xml with a DTD and then if there were no errors, I would pass it directly to the dbtable...

Is there any way of doing it?

I'm really thankful for your answers....

Accepted Solutions (0)

Answers (1)

Answers (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

If you are looking at passing the whole XML response into a field in the target, this would be simple.

Convert the InputStream ( In Java Mapping) into a string and pass it to the String.

You can use this code to convert InputStream to string,

In this code, <b>in</b> is the inputstream to the execute() of java mapping,


BufferedReader inp = new BufferedReader(new InputStreamReader(in));
StringBuffer buffer = new StringBuffer();
String line="";
while ((line = inp.readLine()) != null) {
buffer.append(line);
}
String  source=buffer.toString();

is this what you are looning at?

Regards,

Bhavesh

Former Member
0 Kudos

Hi Bhavesh,

thanks for the quick reply...

The idea is not to pass the whole xml into a field... imagine the xml with thousands of fields, what I'd like was, to map the xml directly to a table which has all these fields and dependencies... I know that with XI or even BC, the process would be terribly simple, the thing is that this applications can't be used....

I think my only solution will be to parse the file and mannualy introduce the fields into the tables....

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

><i>I know that with XI or even BC, the process would be terribly simple, the thing is that this applications can't be used.... :|</i>

Unfortunately, I am not able to get the entire flow of your requirment? You are not using XI? Can you give us the entire flow?

Thanks,

Bhavesh