Hello guys,
I have created a transformation and I'm facing a problem to format the output of numeric attributes.
My requirement is: the decimal separator needs to be comma (",") instead dot (".") and the XML output needs to be with 2 decimals places (as is in structure definition).
My dictionary structure:
Field Name | Type | Lenght | Decimals |
CLIENT | CHAR | 10 | 0 |
EMPRES | CHAR | 14 | 0 |
INDCNP | NUMC | 1 | 0 |
TICKET | CHAR | 50 | 0 |
ACAO | CHAR | 8 | 0 |
TAREFA | CHAR | 15 | 0 |
DATENV | CHAR | 10 | 0 |
HORENV | CHAR | 5 | 0 |
USUENV | CHAR | 15 | 0 |
USUBPO | CHAR | 30 | 0 |
REQMSG | STRING | 0 | 0 |
INDIDE | NUMC | 1 | 0 |
DATPRO | CHAR | 10 | 0 |
HORPRO | CHAR | 5 | 0 |
NREQID | NUMC | 15 | 0 |
NREQDP | CHAR | 15 | 0 |
MESCOM | NUMC | 2 | 0 |
ANOCOM | NUMC | 4 | 0 |
CODFOL | NUMC | 4 | 0 |
NROPFL | CHAR | 6 | 0 |
IDEMPR | CHAR | 15 | 0 |
VLANFL | DEC | 11 | 2 |
NROHRA | DEC | 3 | 2 |
My simple transformation:
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates" xmlns:ddic="http://www.sap.com/abapxml/types/dictionary" xmlns:def="http://www.sap.com/abapxml/types/defined">
<tt:root name="ROOT" type="?"/>
<tt:root name="RECORD" line-type="ddic:Z8H_ADP_TSK_LAUNCHES_DELETE"/>
<tt:template name="XALIAS0">
<root>
<tt:loop ref=".RECORD">
<record>
<client tt:value-ref="CLIENT"/>
<empres tt:value-ref="EMPRES"/>
<indcnp tt:value-ref="INDCNP"/>
<ticket tt:value-ref="TICKET"/>
<acao tt:value-ref="ACAO"/>
<tarefa tt:value-ref="TAREFA"/>
<datenv tt:value-ref="DATENV"/>
<horenv tt:value-ref="HORENV"/>
<usuenv tt:value-ref="USUENV"/>
<usubpo tt:value-ref="USUBPO"/>
<reqmsg tt:value-ref="REQMSG"/>
<indide tt:value-ref="INDIDE"/>
<datpro tt:value-ref="DATPRO"/>
<horpro tt:value-ref="HORPRO"/>
<nreqid tt:value-ref="NREQID"/>
<nreqdp tt:value-ref="NREQDP"/>
<mescom tt:value-ref="MESCOM"/>
<anocom tt:value-ref="ANOCOM"/>
<codfol tt:value-ref="CODFOL"/>
<nropfl tt:value-ref="NROPFL"/>
<idempr tt:value-ref="IDEMPR"/>
<vlanfl tt:value-ref="VLANFL"/>
<nrohra tt:value-ref="NROHRA"/>
</record>
</tt:loop>
</root>
</tt:template>
</tt:transform>
My output:
<root>
</record>
</root>
If anyone have suggestions, will be welcome.
Thanks in advance.