Google Search - Blog...........

ABAP - Simple ALV Total Display Program.

REPORT zdemo_alvgrid .

type-pools: slis.
*Data Declaration
data: BEGIN OF itab occurs 0,
F1 TYPE I,
F2 TYPE I,
F3 TYPE I,
END OF itab.

data: it_fieldcatalog type slis_t_fieldcat_alv ,
wa_fieldcatalog type slis_fieldcat_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid.

itab-f1 = '1'.
itab-f2 = '10'.
itab-f3 = '1234'.
append itab.

itab-f1 = '2'.
itab-f2 = '400'.
itab-f3 = '4321'.
append itab.

itab-f1 = '3'.
itab-f2 = '5120'.
itab-f3 = '0766'.
append itab.

itab-f1 = '4'.
itab-f2 = '620'.
itab-f3 = '3245'.
append itab.

itab-f1 = '5'.
itab-f2 = '9430'.
itab-f3 = '564'.
append itab.

itab-f1 = '6'.
itab-f2 = '1098'.
itab-f3 = '14'.
append itab.

itab-f1 = '7'.
itab-f2 = '140'.
itab-f3 = '4325'.
append itab.


wa_fieldcatalog-fieldname = 'F1'.
wa_fieldcatalog-reptext_ddic = 'field1'.
append wa_fieldcatalog to it_fieldcatalog .
clear wa_fieldcatalog .

wa_fieldcatalog-fieldname = 'F2'.
wa_fieldcatalog-reptext_ddic = 'field2'.
wa_fieldcatalog-do_sum = 'X'.
append wa_fieldcatalog to it_fieldcatalog .
clear wa_fieldcatalog .

wa_fieldcatalog-fieldname = 'F3'.
wa_fieldcatalog-reptext_ddic = 'field3'.
wa_fieldcatalog-do_sum = 'X'.
append wa_fieldcatalog to it_fieldcatalog .
clear wa_fieldcatalog .

* gd_layout-
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'.

gd_repid = sy-repid.

call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = gd_repid
is_layout = gd_layout
it_fieldcat = it_fieldcatalog[]
tables
t_outtab = itab .


ALSO READ:

- Simple ALV Grid/List With Save Layout.

- Checkbox In ALV Program.

- ALV Header With Logo.

- Including Line After Subtotal In ALV Display.

..... Back To Index On ALV List/ Grid Display.

..... Back To MAIN INDEX.


No comments:

Post a Comment