Skip to Content
0
Former Member
Jan 19, 2011 at 09:18 AM

Subtotal Text in ALV Grid and hiding empty row

76 Views

Hello,

ive got a ALV-Grid with a few fields .. Total on one field subtotal on VKORG, category or some other fields .

after subtotal of one of the 2 named fields i'm reading the literal to the given fields and writing them in the table which is displayed and do a refresh.

i can show the field literal in the alv by adding it into the field cat but than its displayed even if its not filled.

i just want to display that column after filling it - the subtotal of the 2 columns.

and i want to add the text of the literal to the subtotal line. so if the alv grid is closed to display the totals. i want to see what the subtotal is for.

for displaying i use

CALL METHOD lcl_alv_grid->set_table_for_first_display

EXPORTING

is_layout = gs_layout

is_variant = gs_variant

it_toolbar_excluding = gt_exclude

i_save = x_save

i_default = 'X'

CHANGING

it_outtab = it_alvlist[]

it_fieldcatalog = gt_field_cat.

for refresh

lv_lvc_s_stbl-row = 'X'.

lv_lvc_s_stbl-col = 'X'.

lv_soft_refresh = 'X'.

CALL METHOD lcl_alv_grid->refresh_table_display

EXPORTING

is_stable = lv_lvc_s_stbl

i_soft_refresh = lv_soft_refresh

EXCEPTIONS

finished = 1

OTHERS = 2.

get the selected column to read literal

CALL METHOD lcl_alv_grid->get_selected_columns

IMPORTING

et_index_columns = it_col_tab

EXCEPTIONS

OTHERS = 1.

Hope you can help me and understand my problem