Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem with simple transformation ABAP to XML

carlos_laborda
Explorer
0 Likes
422

Hi experts:

Below the code of my ST.

My doubt is with the lines including day/month/year (in bold). I have to populate these values with data from the internal table used to create the XML (due date and creation date as the XML file is related with invoices).

Can someone provide some guidance on how to do it?.

Thanks in advance for your help.

Best regards,

Carlos.

<?sap.transform simple?>

<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">

<tt:root name="ROOT"/>

<tt:template>

<peticionServicio xmlns:cyct="CyC-Types-1.0.xsd" xmlns:ic="iso3currency-1.0.xsd"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" lang="ESP" poliza="S0045415"

xsi:noNamespaceSchemaLocation="http://www.creditoycaucion.es/axis/xml-schame/plantilla_general_servicios_esp.xsd">

<fechaSolicitud day="31" month="04" anio="2010" year="00" />

<tipoRespuesta formato="0" modo="0"/>

<tt:loop name="line" ref=".ROOT">

<cancAvisoFaltaPago>

<importeImpagado moneda="EUR">

<tt:value ref="$line.importeImpagado"/>

</importeImpagado>

<fechaVencimientoImpagado day="31" month="04" year="2010" />

<fechaComunicacion day="31" month="04" year="2010" />

<suReferencia>

<tt:value ref="$line.sureferencia"/>

</suReferencia>

<clienteCyc>

<tt:value ref="$line.clienteCyc"/>

</clienteCyc>

<nif>

<tt:value ref="$line.nif"/>

</nif>

<nombre>

<tt:value ref="$line.nombre"/>

</nombre>

<provincia>

<tt:value ref="$line.provincia"/>

</provincia>

</cancAvisoFaltaPago>

</tt:loop>

</peticionServicio>

</tt:template>

</tt:transform>

Hi experts:

Below the code of my ST.

My doubt is with the lines including day/month/year (in bold). I have to populate these values with data from the internal table used to create the XML (due date and creation date as the XML file is related with invoices).

Can someone provide some guidance on how to do it?.

Thanks in advance for your help.

Best regards,

Carlos.

<?sap.transform simple?>

<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">

<tt:root name="ROOT"/>

<tt:template>

<peticionServicio xmlns:cyct="CyC-Types-1.0.xsd" xmlns:ic="iso3currency-1.0.xsd"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" lang="ESP" poliza="S0045415"

xsi:noNamespaceSchemaLocation="http://www.creditoycaucion.es/axis/xml-schame/plantilla_general_servicios_esp.xsd">

<fechaSolicitud day="31" month="04" anio="2010" year="00" />

<tipoRespuesta formato="0" modo="0"/>

<tt:loop name="line" ref=".ROOT">

<cancAvisoFaltaPago>

<importeImpagado moneda="EUR">

<tt:value ref="$line.importeImpagado"/>

</importeImpagado>

<fechaVencimientoImpagado day="31" month="04" year="2010" />

<fechaComunicacion day="31" month="04" year="2010" />

<suReferencia>

<tt:value ref="$line.sureferencia"/>

</suReferencia>

<clienteCyc>

<tt:value ref="$line.clienteCyc"/>

</clienteCyc>

<nif>

<tt:value ref="$line.nif"/>

</nif>

<nombre>

<tt:value ref="$line.nombre"/>

</nombre>

<provincia>

<tt:value ref="$line.provincia"/>

</provincia>

</cancAvisoFaltaPago>

</tt:loop>

</peticionServicio>

</tt:template>

</tt:transform>

1 REPLY 1
Read only

carlos_laborda
Explorer
0 Likes
362

Solved.

It is possible to use tt:attribute to do this without adding the </tag>.