Monday, May 16, 2016

xml tag checking using call transformation in ABAP (t-code: XSLT_TOOL)



Transforming data from xml tag to internal table with checking (whether the tag exits or not)

<tt:cond s-check="not-initial(ref('QUANTITY'))">
<Quantity tt:value-ref="QUANTITY"/>
</tt:cond>

<tt:cond s-check="initial(ref('QUANTITY'))">
<Quantity tt:value-ref="QUANTITY"/>
</tt:cond>


Transforming data from xml tag to internal table without checking-

 <Quantity tt:value-ref="QUANTITY"/>


Quantity  = xml tag
QUANTITY = internal table field

xml parsing T-code using Call Transformation


XML parsing using call transformation

CALL TRANSFORMATION t-code : XSLT_TOOL

  CALL TRANSFORMATION Z_TransformationName
          SOURCE XML xmlstr_src
          RESULT
          in_asn = it_table. (internal table)



go to link for details:  

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2011fbe7-3285-2e10-b281-fec5ef0c225b?QuickLink=index&overridelayout=true&51552492473450