REPORTztry2.
TABLES:ce1gds1,coep.
TYPE-POOLS:slis.
DATA: t_layout TYPE slis_layout_alv,
g_repid LIKE sy-repid,
t_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
DATA: BEGIN OF t_out OCCURS 0,
ww111 LIKE ce1gds1-ww111,"Project order
erlos LIKE ce1gds1-erlos, "Revenue
vv030 LIKE ce1gds1-vv030, "Other income
vv708 LIKE ce1gds1-vv708, "Tpersonnel costs
vv145 LIKE ce1gds1-vv145, "Zpersonnel costs
vv960 LIKE ce1gds1-vv960, "Raw/service material
vv142 LIKE ce1gds1-vv142, "Software costs
vv720 LIKE ce1gds1-vv720, "Depreciation
vv143 LIKE ce1gds1-vv143, "Moverhead
vv131 LIKE ce1gds1-vv131, "Subcon overhead
vv121 LIKE ce1gds1-vv121, "Adm.O.H
vv111 LIKE ce1gds1-vv111, "Sales O.H
vvk20 LIKE ce1gds1-vvk20, "Other costs
vv144 LIKE ce1gds1-vv144, "Other expense
vv722 LIKE ce1gds1-vv722, "Assessment
END OF t_out.
DATA: t_tmp LIKE t_out OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF t_coep OCCURS 0,
objnr LIKE coep-objnr,
kstar LIKE coep-kstar,
wkgbtr LIKE coep-wkgbtr,
END OF t_coep.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_kokrs FOR ce1gds1-kokrs OBLIGATORY NO-EXTENSION,
s_gjahr FOR ce1gds1-gjahr OBLIGATORY NO-EXTENSION,
s_perde FOR ce1gds1-perde OBLIGATORY NO-EXTENSION.
SELECTION-SCREEN:END OF BLOCK b1.
START-OF-SELECTION.
PERFORM get_data.
PERFORM display_data.
FORM get_data.
select * into corresponding fields of table t_out
from ce1gds1
where perde in s_perde
and gjahr in s_gjahr
and ww111''.
ENDFORM.
"get_data
FORM display_data.
g_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = g_repid
i_internal_tabname = 'T_OUT'
i_inclname = g_repid
CHANGING
ct_fieldcat= t_fieldcat.
*********
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_interface_check= ' '
i_callback_program = g_repid
i_grid_title = 'Project income and lose report'
is_layout
= t_layout
it_fieldcat= t_fieldcat[]
i_default
= 'X'
i_save
= 'A'
TABLES
t_outtab = t_out.
ENDFORM.
"display_data
上面代码我在两个程式中运行,一个可以正常显示,一个就报2楼错误,当把CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' 改成自定义时,则可以正常显示
|