cancel
Showing results for 
Search instead for 
Did you mean: 

REUSE_ALV_HIERSEQ_LIST_DISPLAY (Sub totals and Grand totals)

Former Member
0 Kudos

Hello,

I pass these parameters for printing Subtotals, Eventhough i am not able to print the subtotals ..

And how to print grand totals,,

I hope you understand my problem so pls Give me Exact soln for this problem...

data:

T_FCAT TYPE SLIS_T_FIELDCAT_ALV,

W_FCAT TYPE SLIS_FIELDCAT_ALV,

W_KEYINFO TYPE SLIS_KEYINFO_ALV,

IT_SORT TYPE SLIS_T_SORTINFO_ALV,

W_SORT TYPE SLIS_SORTINFO_ALV,

W_LAYOUT TYPE SLIS_LAYOUT_ALV.

W_FCAT-COL_POS = '1'.

W_FCAT-FIELDNAME = 'MATNR'.

W_FCAT-EMPHASIZE = 'C600'.

W_FCAT-OUTPUTLEN = 30.

W_FCAT-SELTEXT_M = 'MATERIAL NO'.

W_FCAT-TABNAME = 'IT_HEADER'.

APPEND W_FCAT TO T_FCAT.

CLEAR W_FCAT.

W_FCAT-COL_POS = '13'.

W_FCAT-FIELDNAME = 'PSQTY'.

W_FCAT-OUTPUTLEN = 20.

W_FCAT-SELTEXT_M = 'Pending So QTY'.

W_FCAT-EMPHASIZE = 'C600'.

W_FCAT-DO_SUM = 'X'.

W_FCAT-EMPHASIZE = 'C500'.

W_FCAT-TABNAME = 'IT_ITEM'.

APPEND W_FCAT TO T_FCAT.

CLEAR W_FCAT.

W_FCAT-COL_POS = '17'.

W_FCAT-FIELDNAME = 'SOQTY'.

W_FCAT-OUTPUTLEN = 20.

W_FCAT-SELTEXT_M = ' So Qty'.

W_FCAT-EMPHASIZE = 'C500'.

W_FCAT-DO_SUM = 'X'.

W_FCAT-TABNAME = 'IT_ITEM'.

APPEND W_FCAT TO T_FCAT.

CLEAR W_FCAT.

W_KEYINFO-HEADER01 = 'MATNR'.

W_KEYINFO-ITEM01 = 'MATNR'.

W_SORT-FIELDNAME = 'MATNR'.

W_SORT-TABNAME = 'IT_HEADER'.

W_SORT-UP = 'X'.

W_SORT-SUBTOT = 'X'.

APPEND W_SORT TO IT_SORT.

CLEAR W_SORT.

W_LAYOUT-TOTALS_TEXT = 'Total'. "TEXT at TOTAL

W_LAYOUT-SUBTOTALS_TEXT = 'Sub'. "TEXT AT SUB Total

CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = SY-REPID

IS_LAYOUT = W_LAYOUT

IT_FIELDCAT = T_FCAT

IT_SORT = IT_SORT

I_TABNAME_HEADER = 'IT_HEADER'

I_TABNAME_ITEM = 'IT_ITEM'

IS_KEYINFO = W_KEYINFO

TABLES

T_OUTTAB_HEADER = INT_HEADER

T_OUTTAB_ITEM = INT_FINAL

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Thanks in Advance...!!!

Regards,

KSReddy

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Repeat the sam sort catalog for the field you want ot display the subtotals.

Regards,

Vamshi.

Former Member
0 Kudos

Hi,

Check the datatype of PSQTY and SOQTY.Its should be CHAR.

The subtotal and grandtotal is available for CHAR fields not QUAN fields,

Jshree

Former Member
0 Kudos

Hi Jshree,

Those Fields are in Char Format..

Regards,

Former Member
0 Kudos

Hi Jshree,

Those Fields are in Char Format.

Problem solved.

Thanks for Helpful Answer...

Regards,

ksreddy..!!!

Edited by: ksreddy on Jan 22, 2012 11:15 AM

madhu_vadlamani
Active Contributor
0 Kudos

HI,

Subtotal feature you will get in standard.How you declared the fields.

Regards,

Madhu.

Former Member
0 Kudos

But the user Required by default subtotals and grand totals.

thanks

Edited by: ksreddy on Jan 19, 2012 9:12 AM