Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

Simple Transformation - Format Output

$
0
0

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 NameTypeLenghtDecimals
CLIENTCHAR100
EMPRESCHAR140
INDCNPNUMC10
TICKETCHAR500
ACAOCHAR80
TAREFACHAR150
DATENVCHAR100
HORENVCHAR50
USUENVCHAR150
USUBPOCHAR300
REQMSGSTRING00
INDIDENUMC10
DATPROCHAR100
HORPROCHAR50
NREQIDNUMC150
NREQDPCHAR150
MESCOMNUMC20
ANOCOMNUMC40
CODFOLNUMC40
NROPFLCHAR60
IDEMPRCHAR150
VLANFLDEC112
NROHRADEC32

 

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>
<client>134566</client>

<empres>0000000</empres>

<indcnp>1</indcnp>

<acao>Gravar</acao>

<tarefa>EXCLUI_LAN</tarefa>

<datenv>03/02/2014</datenv>

<horenv>17:02</horenv>

<usuenv>RENAN</usuenv>

<usubpo>WEBSERVICE</usubpo>

<indide>2</indide>

<nreqid>000000000016591</nreqid>

<mescom>03</mescom>

<anocom>2013</anocom>

<codfol>0040</codfol>

<vlanfl>3635.0</vlanfl>

</record>

</root>


If anyone have suggestions, will be welcome.

Thanks in advance.


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>