上图显示的报表的源码不是全部的
TYPE-POOLS ole2 .
TABLES : faglflext,bkpf,t001.
TYPES : BEGIN OF t_faglflext ,
racct LIKE faglflext-racct,
rtcur LIKE faglflext-rtcur,
rbukrs LIKE faglflext-rbukrs,
drcrk LIKE faglflext-drcrk,
hslvt LIKE faglflext-hslvt,
hsl01 LIKE faglflext-hsl01,
hsl02 LIKE faglflext-hsl02,
hsl03 LIKE faglflext-hsl03,
hsl04 LIKE faglflext-hsl04,
hsl05 LIKE faglflext-hsl05,
hsl06 LIKE faglflext-hsl06,
hsl07 LIKE faglflext-hsl07,
hsl08 LIKE faglflext-hsl08,
hsl09 LIKE faglflext-hsl09,
hsl10 LIKE faglflext-hsl10,
hsl11 LIKE faglflext-hsl11,
hsl12 LIKE faglflext-hsl12,
hsl13 LIKE faglflext-hsl13,
hsl14 LIKE faglflext-hsl14,
hsl15 LIKE faglflext-hsl15,
hsl16 LIKE faglflext-hsl16,
RACHA(6) TYPE N, racha(10) TYPE n, pno TYPE char5 , "編號 END OF t_faglflext.
DATA: i_faglflext TYPE TABLE OF t_faglflext WITH HEADER LINE,
i_cl_faglflext TYPE TABLE OF t_faglflext WITH HEADER LINE,
i_cl_single TYPE TABLE OF t_faglflext WITH HEADER LINE. "单科目累计
DATA: g_pno TYPE char5,
g_pno_c TYPE char5,
g_hsl LIKE faglflext-hsl16,
g_hsl_c LIKE faglflext-hsl16,
g_5x LIKE faglflext-hsl16,
g_6x LIKE faglflext-hsl16,
g_5x_c LIKE faglflext-hsl16,
g_6x_c LIKE faglflext-hsl16.
TYPES : BEGIN OF w_list,
pno TYPE char5 , "編號
txt01 LIKE ekpo-txz01,
wleft TYPE c, "靠左输出对齐
tabix LIKE sy-tabix , "序列號
rbukrs LIKE faglflext-rbukrs,
racct LIKE faglflext-racct,
hslvt LIKE faglflext-hslvt , "年初數
hslvc LIKE faglflext-hslvt , "期末數
tline LIKE sy-tabix, "列印数据顺序号
END OF w_list.
DATA: i_list TYPE TABLE OF w_list WITH HEADER LINE.
DEFINE fill_list.
i_list-pno = &1.
i_list-txt01 = &2.
i_list-tabix = &3.
i_list-wleft = &4.
i_list-tline = &5.
APPEND i_list.
CLEAR i_list.
END-OF-DEFINITION.
DATA: field_a(50),
g_times TYPE i.
DATA : v_tabix TYPE sy-tabix.
FIELD-SYMBOLS: <fm> TYPE any.
RANGES:r_racct FOR faglflext-racct,
r_racct_del FOR faglflext-racct,
r_racct_sgl FOR faglflext-racct.
DATA: g_butxt(50) TYPE c,
g_budat LIKE sy-datum,
g_waers LIKE t001-waers,
g_yemon(14) TYPE c.
DATA: p_name LIKE rlgrap-filename VALUE 'C:.xls' .
DATA: ffname LIKE p_name .
DATA: g_desktop(100).
DATA: sheetname(10) VALUE 'exp ',c_row TYPE i,
scnt TYPE i,
val(20), wb(2),
rows(10) TYPE c,
cols(10) TYPE c,
msgtxt(50) TYPE c.
DATA: excel_obj TYPE ole2_object,
workbook_obj TYPE ole2_object,
sheet_obj TYPE ole2_object,
cell_obj TYPE ole2_object,
font_obj TYPE ole2_object.
DATA: m TYPE p VALUE 5, "行
n TYPE p. "列
DATA p_ok TYPE char1.
DATA: g_auth TYPE c.
DATA: g_title TYPE char20 VALUE '1'.