cancel
Showing results for 
Search instead for 
Did you mean: 

Converting SQL Server text field containing XML string to XI XML via JDBC

Former Member
0 Kudos

Hello

My client has a SQL Server database containing a field of type Text which contains an XML string e.g.

<DispatchJob> <DispatchDateTime>2003-09-29T13:29:15</DispatchDateTime> <AssignedFSE>F118</AssignedFSE> <DispatchJobPurchase> <DealerID>14C5</DealerID> <DateOfPurchase>1997-10-01T00:00:00</DateOfPurchase> </DispatchJob>

I am using JDBC to access this but could someone please recommend the best and easiest solution for converting this string to XI XML for subsequent mapping to BAPI or IDOC or ABAP Proxy and transmission to SAP. There are other fields as well in the database table so thoughts at the moment are to use a normal graphical message mapping followed by an XSL mapping. Will an XSL mapping be able to do this and if so is that the best solution?

Also I need to do the reverse of this and take fields coming from SAP via BAPI,IDOC etc. and convert them to a single database table field as an XML string also via the JDBC adapter. What is the best way to do this. Could it be done simply with functions in the graphical mapping e.g. concatenate?

Thank you in advance.

Trevor

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Would suggest you to used XSLT, that's really easy.

The weblog:

/people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping

and website: http://www.w3schools.com/xsl/default.asp

would be helpful.

Thanks

Luis

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

XSLT, java or abap mappings will do the trick

Graphical mapping will not be able to handle this easily

so I'd recommned other methods

Regards,

michal

Former Member
0 Kudos

Hi Michal

Thanks for the prompt reply.

I was anticipating XSLT for reading from the SQL Server database and converting the XML string.

But how would you convert the individual fields from SAP into a single field as an XML string for storing in the SQL Server database? What approach would you use?

Regards

Trevor

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

the same apporach - XSLT is very good for that (from the developer point of view)

Regards,

michal