Skip to Content
0
Former Member
Jul 19, 2016 at 02:24 PM

Add attributes to an existing element

286 Views

Hi everyone,

I want to integrate SAP TM with the third party via web service in order to determine the distance and duration for a shipment.

I generated the service consumer in SAP from the wsdl of the third party.


My operations are well created and I was able to call some of them and I had a response from the third party.


My problem is on a specific operation, where the element type is not defined in the wsdl.

I have to specify the type to call the service, but it's dynamic.

I have the choice between 3 types that I can use, and the responses from the third party is different, depending on which type I called.


Here is the xml generated by SAP :

<v1:ReportTypes>

<v1:ReportType/>

</v1:ReportTypes>

Here is the xml I need to build to call the service :

<v1:ReportTypes>

<v1:ReportType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="v1:DetailReportType"/>

</v1:ReportTypes>

My first guess is to use a transformation program and XSLT to transform the xml.

I already created an XSL that is doing what I want, but I don't know how or where to use is in SAP.

In fact, I don't even know if it's the right technical choice.

Do I have to use the already existing transformation programs associated with my ReportType object ?

or

Do I have to created a new transformation program using XSLT_TOOL transaction ?

or

Do I have to use ABAP ?

Is there anyone that could help me ?

Thanks a lot !