on 08-08-2007 11:14 AM
hi
in the alv list output
if we display subtotals based on 3 feilds out of 10
we see subtotals (sum) based on the end of each field
now i want to display only the lines which are displayed as subtotals in the output
we have parameter
totals_only(1) type c, " show only totals
in the structrure slis_layout_alv
i have used it but i can see no change in the output
hai
data : GT_SORT TYPE SLIS_T_SORTINFO_ALV,
ABAP List Viewer
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME = 'ITAB1'
IS_LAYOUT = GS_LAYOUT
IT_FIELDCAT = GT_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = GT_SORT[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = GT_EVENTS[]
IT_EVENT_EXIT =
IS_PRINT = GS_PRINT
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITAB1
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
ENDFORM.
DATA SORTING AND SUBTOTAL
DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
CLEAR GS_SORT.
GS_SORT-FIELDNAME = 'FIELD1'.
GS_SORT-SPOS = 1.
GS_SORT-UP = 'X'.
GS_SORT-SUBTOT = 'X'.
APPEND GS_SORT TO GT_SORT.
CLEAR GS_SORT.
GS_SORT-FIELDNAME = 'FIELD2'.
GS_SORT-SPOS = 2.
GS_SORT-UP = 'X'.
*GS_SORT-SUBTOT = 'X'.
APPEND GS_SORT TO GT_SORT.
ENDFORM.
regard
nawa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use the subtotal text in ALV.
Before using the subtotal,. you have to sort the List using the field for which total has to be calculated.
DATA: lt_sort TYPE slis_t_sortinfo_alv.
DATA: lw_sort TYPE slis_sortinfo_alv.
CONSTANTS:
lc_value_x TYPE ebstyp VALUE 'X'.
v_repid = sy-repid.
lw_sort-fieldname = fieldname.
lw_sort-up = lc_value_x.
lw_sort-subtot = lc_value_x.
lw_sort-stext = 'Subttotal'.
APPEND lw_sort TO lt_sort.
*call function to display the report
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_top_of_page = 'TOP_OF_PAGE'
it_fieldcat = ut_fieldcattab
it_sort = lt_sort
TABLES
t_outtab = ct_output_values_tab
EXCEPTIONS
program_error = 1
OTHERS = 2.
Regards,
Yogesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Do like this,
DATA: it_sort TYPE slis_t_sortinfo_alv,
wa_sort-spos = '0'.
wa_sort-fieldname = 'Field for which you want subtotal in CAPITAL'.
wa_sort-tabname = 'Internal Table In capital.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO it_sort.
Pass this table to ALV fm.
Reward if helpful.
Regards
Azad.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.