事务代码:STRANS
用途:XML/EXCEL 和 ABAP中的内表/结构进行互转
分类:STRANS有两种,分别是Simple Transformation 和XSLT Program
1.Simple Transformation
1.1模版配置
事务码:STRANS 创建模版

模版按照时间内容进行配置
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<tt:root name="对象名"/>
<tt:template>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.labware.com/webservice">
<soapenv:Header/>
<soapenv:Body>
<web:invoke>
<!--Optional:-->
<web:field1>
<tt:value ref="对象名.FIELD1"/>
</web:field1>
<!--Optional:-->
<web:field2>
<tt:value ref="对象名.FIELD2"/>
</web:field2>
</web:invoke>
</soapenv:Body>
</soapenv:Envelope>
</tt:template>
</tt:transform>
调用STRANS:在程序中调用Simple Transformation,可使用关键字CALL TRANSFORMATION
TYPES: BEGIN OF LS_TAB1
FIELD1 TYPE STRING, "返回码
FIELD2 TYPE STRING, "返回信息
END OF LS_TAB1.
DATA: LV_BODYDATA_XML TYPE STRING.
IT_TAB1 TYPE LS_TAB1,
CALL TRANSFORMATION (STRANS名)
SOURCE 对象名 = IT_TAB1
RESULT XML ZXML_BODY.

281

被折叠的 条评论
为什么被折叠?



