Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV grid display

Former Member
0 Kudos
120

Hi , I am new to ALVs, can anyone pls send me some docs on report programming in ALV. Hoping for early replies,

thanks,

Hema.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
99

hi,

To put default values to parameters or select-options use this..

parameter: p_matnr like mara-matnr default 'test1'..

select-options: s_matnr for mara-matnr default 'test1' to 'test2'.

or u can do it in INITIALIZATION event assigning values to it.

INITIALIZATION.

p_matnr = 'test3'.

s_matnr-low = 'test4'.

s_matnr-high = 'test5'.

s_matnr-sign = 'I'.

s_matnr-option = 'BT'.

append s_matnr.

if you want to display those 2 fields only, create your own fieldcatalog. and pass it to it_fieldcat export parameter in the reuse...... FMs.

3 REPLIES 3

Former Member
0 Kudos
100

hi,

To put default values to parameters or select-options use this..

parameter: p_matnr like mara-matnr default 'test1'..

select-options: s_matnr for mara-matnr default 'test1' to 'test2'.

or u can do it in INITIALIZATION event assigning values to it.

INITIALIZATION.

p_matnr = 'test3'.

s_matnr-low = 'test4'.

s_matnr-high = 'test5'.

s_matnr-sign = 'I'.

s_matnr-option = 'BT'.

append s_matnr.

if you want to display those 2 fields only, create your own fieldcatalog. and pass it to it_fieldcat export parameter in the reuse...... FMs.

Former Member
0 Kudos
99

hi, refer this sample program.

Please refer the code below and for summation use gs_fieldcat-do_sum = 'X':

ALV data declarations

data: it_sortcat type slis_sortinfo_alv occurs 1,

wa_sort like line of it_sortcat.

perform build_sortcat.

&----


*& Form build_sortcat

&----


Build Sort catalog

-


FORM build_sortcat .

wa_sort-spos = 1.

wa_sort-fieldname = 'EBELN'.

wa_sort-SUBTOT = 'X'. "subtotals any totals column by this field

gd_sortcat-tabname

APPEND wa_sort TO it_sortcat.

wa_sort-spos = 2.

wa_sort-fieldname = 'EBELP'.

gd_sortcat-tabname

APPEND wa_sort TO it_sortcat.

ENDFORM. " build_sortcat

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = gd_repid

i_callback_top_of_page = 'TOP-OF-PAGE'

is_layout = gd_layout

it_fieldcat = fieldcatalog[]

it_sort = it_sortcat

i_save = 'X'

tables

t_outtab = it_ekko

exceptions

program_error = 1

others = 2.

bye,\

madhu.

Former Member
0 Kudos
99

hi,

To display sub-totals in ALV , Use SORT Tables of TYPE Slis_sortinfo_alv.

x_sort-fieldname = 'BUKRS'.

x_sort-spos = '1'.

x_sort-up = 'X'.

x_sort-group = '*'.

x_sort-subtot = 'X'.

APPEND x_sort TO t_sort.

To display Sub-total lines only , use TOTLINES_ONLY in the fieldcatalog to 'X'.

.