Application Development and Automation 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: 
Read only

Problem in ALV's

Former Member
0 Likes
474

Can any body halp me ..

i am using alv in my report i want to calc. subtotals for a field based on date field...i am using reuse_alv_list_display.

but i am not getting sub-totals... and also the <b>sigma</b> icon is also i am not getting....

4 REPLIES 4
Read only

Former Member
0 Likes
451

Hello,

U need to pass the Sort table to the FM.

REFRESH IT_SORT.

CLEAR: G_S_SORT,G_S_SORT.

G_S_SORT-SPOS = 1.

G_S_SORT-FIELDNAME = 'FIELD'.

G_S_SORT-UP = 'X'.

G_S_SORT-DOWN = ' '.

<b> G_S_SORT-SUBTOT = 'X'.</b> G_S_SORT-EXPA = ' '.

APPEND G_S_SORT TO IT_SORT.

If useful reward.

Vasanth

Read only

0 Likes
451

i did that one... still the sub totals are not comming and also sigma is not comming in output.....

Read only

rahulkavuri
Active Contributor
0 Likes
451

hi first u need to use sort to get subtotals, award points if found helpful

DATA: WA_SORT TYPE SLIS_SORTINFO_ALV, "SORT work area

IT_SORT TYPE SLIS_T_SORTINFO_ALV, "SORT ITAB

PERFORM SORT_LIST.

FORM SORT_LIST.

WA_SORT-FIELDNAME = 'VBELN'.

WA_SORT-TABNAME = 'IT_VBAK'.

WA_SORT-SPOS = 1.

WA_SORT-UP = 'X'.

WA_SORT-SUBTOT = 'X'.

APPEND WA_SORT TO IT_SORT.

CLEAR WA_SORT.

WA_SORT-FIELDNAME = 'NETWR'.

WA_SORT-TABNAME = 'IT_VBAK'.

WA_SORT-UP = 'X'.

WA_SORT-SPOS = 2.

WA_SORT-SUBTOT = 'X'.

APPEND WA_SORT TO IT_SORT.

CLEAR WA_SORT.

ENDFORM. "SORT_LIST

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = SY-REPID

IT_FIELDCAT = IT_FIELDCAT

IS_LAYOUT = LAYOUT

IT_SORT = IT_SORT

I_CALLBACK_PF_STATUS_SET = 'STATUS'

IT_EXCLUDING = I_FCODE_EXTAB

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

IT_EVENTS = IT_EVENTS[]

Read only

0 Likes
451

i did it still... the report which i am modyfing is std report..RIIMR020 i have copied it in Z report and i am modyfing....