ABAP顾问
分类:
2008-05-18 21:39:27
REPORT z_barry_sm50.
TYPE-POOLS: slis.
DATA: sla TYPE slis_layout_alv ,
i_repid LIKE sy-repid .
DATA: cpu LIKE tskh_dummy-with_cpu.
DATA: BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE wpinfo.
DATA: END OF itab.
START-OF-SELECTION.
PERFORM getdata.
PERFORM outdata.
*&---------------------------------------------------------------------*
*& Form GETDATA
*&---------------------------------------------------------------------*
FORM getdata.
CALL FUNCTION 'TH_WPINFO'
EXPORTING
with_cpu = cpu
TABLES
wplist = itab
EXCEPTIONS
send_error = 1
OTHERS = 2.
ENDFORM. " GETDATA
*&---------------------------------------------------------------------*
*& Form outdata
*&---------------------------------------------------------------------*
FORM outdata.
sla-colwidth_optimize = 'X'.
sla-zebra = 'X'.
i_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = i_repid
i_structure_name = 'WPINFO'
is_layout = sla
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. " outdata