report z_alv_data_display .
data : begin of itab occurs 100,
belnr like bsas-belnr,
budat like bsas-budat,
dmbtr like bsas-dmbtr,
xblnr like bsas-xblnr,
end of itab.
data i_repid like sy-repid.
data i_lines like sy-tabix.
type-pools: slis.
data: int_fcat type slis_t_fieldcat_alv,
is_layout type slis_fieldcat_alv.
data: wa_fieldcat like line of int_fcat.
selection-screen: begin of block b1.
parameters : ddate like bsas-bldat,
glact like bsas-hkont.
selection-screen:end of block b1.
start-of-selection.
select bldat dmbtr belnr budat hkont xblnr from bsas
into (itab-bldat, itab-dmbtr, itab-belnr, itab-budat, itab-hkont, itab-xblnr) where bldat eq ddate and hkont eq glact.
append itab.
endselect.
select bldat dmbtr belnr budat hkont xblnr from bsis
into (itab-bldat, itab-dmbtr, itab-belnr, itab-budat, itab-hkont, itab-xblnr) where bldat eq ddate and hkont eq glact.
append itab.
endselect.
end-of-selection.
i_repid = sy-repid.
is_layout-col_pos = 1.
is_layout-fieldname = 'BELNR'.
is_layout-tabname = 'ITAB'.
is_layout-seltext_l = 'Document No'.
append is_layout to int_fcat.
clear is_layout.
is_layout-col_pos = 2.
is_layout-fieldname = 'BLDAT'.
is_layout-tabname = 'ITAB'.
is_layout-seltext_l = 'Document Dt'.
append is_layout to int_fcat.
clear is_layout.
is_layout-col_pos = 3.
is_layout-fieldname = 'BUDAT'.
is_layout-tabname = 'ITAB'.
is_layout-seltext_l = 'Posting Dt'.
append is_layout to int_fcat.
clear is_layout.
is_layout-col_pos = 4.
is_layout-fieldname = 'HKONT'.
is_layout-tabname = 'ITAB'.
is_layout-seltext_l = 'GL Act No'.
append is_layout to int_fcat.
clear is_layout.
is_layout-col_pos = 5.
is_layout-fieldname = 'DMBTR'.
is_layout-tabname = 'ITAB'.
is_layout-seltext_l = 'Amt(Lcl Curncy)'.
append is_layout to int_fcat. clear is_layout.
is_layout-col_pos = 6.
is_layout-fieldname = 'XBLNR'.
is_layout-tabname = 'ITAB'.
is_layout-seltext_l = 'Reference'.
append is_layout to int_fcat.
clear is_layout.
*----------------------------------------------------------
* Call for ALV list display
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
I_CALLBACK_PROGRAM = 'Z_ALV_SIMPLE_EXAMPLE_WITH_ITAB' i_callback_program = i_repid
it_fieldcat = int_fcat[]
i_save = 'A' tables
t_outtab = itab[]
exceptions program_error = 1
others = 2. if sy-subrc <> 0.
write: / 'Returncode', sy-subrc,
'from FUNCTION REUSE_ALV_LIST_DISPLAY'.
endif.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment