我有未知结构的XML,我想在它上面应用ST(简单转换),以"某种方式"将XML中的内容转换为ABAP结构.
现在我有以下测试报告:
report ztbu_st_with_copy.
data: lf_xml type string.
concatenate '<tab><obj>'
'<id>A1</id>'
'<first>Erste</first>'
'<second>Zweite</second>'
'</obj><obj>'
'<id>B2</id>'
'<item>'
'<here>Tady</here>'
'<there>Tam</there>'
'</item>'
'</obj>'
'</tab>'
into lf_xml.
types: begin of ys_obj,
id type string,
rest type string,
end of ys_obj,
yt_obj type standard table of ys_obj.
data: lt_obj type yt_obj.
call transformation ztbu_st_copy_test
source xml lf_xml
result root = lt_obj.
uline.
data: ls_obj like line of lt_obj.
loop at lt_obj into ls_obj.
write: / sy-tabix, ls_obj-id.
endloop.
uline.
Run Code Online (Sandbox Code Playgroud)
我跟随ST转换ZTBU_ST_COPY_TEST(上面调用的那个):
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<tt:root …Run Code Online (Sandbox Code Playgroud)