1 REPORT y4_b4_test8.
2 DATA:lt_ekko TYPE zheaders,
3 lt_ekko2 TYPE zheaders,
4 gt_ekko TYPE zheaders,
5 gs_ekko TYPE zheader,
6 gt_ekpo TYPE zitems,
7 gs_ekpo TYPE zitem,
8 xml_xstring TYPE xstring,
9 xml_string TYPE string,
10 lo_oref TYPE REF TO cx_st_error,
11 lv_message TYPE char200. "输出参数
12
13 "行结构
14 gs_ekpo-buzei = '001'.
15 gs_ekpo-bschl = '22'.
16 gs_ekpo-kostl = '55555' .
17 gs_ekpo-hkont = '99999' .
18 gs_ekpo-matnr = 'MM01' .
19 gs_ekpo-werks = '1710' .
20 APPEND gs_ekpo TO gt_ekpo.
21 APPEND gs_ekpo TO gt_ekpo.
22
23 "头结构
24 gs_ekko-bukrs = '1310'.
25 gs_ekko-gjahr = '2022'.
26 gs_ekko-belnr = '2022042610'.
27 gs_ekko-item = gt_ekpo.
28 APPEND gs_ekko TO gt_ekko.
29 APPEND gs_ekko TO gt_ekko.
30
31 DATA: lv_em TYPE string,
32 lv_em1 TYPE string,
33 p_gv_xml TYPE string.
34
35 "数据
36 lv_em = 'test' .
37
38 CALL TRANSFORMATION id
39 OPTIONS value_handling = 'MOVE' "防止内表中有N类型dump
40 SOURCE connet = lv_em
41 data = gt_ekko
42 RESULT XML p_gv_xml.
43
44 CALL TRANSFORMATION id
45 SOURCE XML p_gv_xml
46 RESULT connet = lv_em1
47 data = lt_ekko2.