2008 Dec 17 6:50 AM
I am generating an ALV report with proper data.
The sort function and filter works fine.
But when i click Sum button ( E ) it ends up with an error - dump.
code :
perform fill_catalog1 using :
'MATNR' 'ITAB' 'MATERIAL NUMBER' ,
'WERKS' 'ITAB' 'PLANT' ,
'TOTAL' 'ITAB' 'TOTAL STOCK'.
FORM FILL_CATALOG1 USING P_FIELDNAME TYPE ANY
P_REF_TABLE TYPE ANY
P_SCRTEXT TYPE ANY.
CLEAR : WA_FLD_CATALOG.
WA_FLD_CATALOG-FIELDNAME = P_FIELDNAME.
WA_FLD_CATALOG-TABNAME = P_REF_TABLE.
WA_FLD_CATALOG-SELTEXT_S = P_SCRTEXT.
WA_FLD_CATALOG-SELTEXT_M = P_SCRTEXT.
WA_FLD_CATALOG-SELTEXT_L = P_SCRTEXT.
WA_FLD_CATALOG-OUTPUTLEN = 15.
APPEND WA_FLD_CATALOG TO IT_FLD_CATALOG.
ENDFORM. " fill_catalog1
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = ZX"Program name
it_fieldcat = it_fld_catalog
i_save = 'X'
TABLES
t_outtab = it_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
Question 1) Any help with sum button in the above code for total of a particular column(total stock)?
Question 2) subtotals , group by plant in ALV
Is it possible to subtotal based on plant and display in the ALV list output along with plant details.what should be done ?
plant1 mat1 amt
plant1 mat2 amt
plant1 mat3 amt
subtoatl plant 1 : amt
plant2 mat4 amt
plant 2 mat5 amt
subtotal plant2 amt
2008 Dec 17 6:55 AM
hI
WA_FLD_CATALOG-FIELDNAME = P_FIELDNAME.
WA_FLD_CATALOG-TABNAME = P_REF_TABLE.
WA_FLD_CATALOG-SELTEXT_S = P_SCRTEXT.
WA_FLD_CATALOG-SELTEXT_M = P_SCRTEXT.
WA_FLD_CATALOG-SELTEXT_L = P_SCRTEXT.
WA_FLD_CATALOG-OUTPUTLEN = 15.
WA_FLD_CATLOG_DO_SUM = 'X' "Display column total
APPEND WA_FLD_CATALOG TO IT_FLD_CATALOG.Ranga
I am generating an ALV report with proper data.
The sort function and filter works fine.
But when i click Sum button ( E ) it ends up with an error - dump.
code :
perform fill_catalog1 using :
'MATNR' 'ITAB' 'MATERIAL NUMBER' ,
'WERKS' 'ITAB' 'PLANT' ,
'TOTAL' 'ITAB' 'TOTAL STOCK'.
FORM FILL_CATALOG1 USING P_FIELDNAME TYPE ANY
P_REF_TABLE TYPE ANY
P_SCRTEXT TYPE ANY.
CLEAR : WA_FLD_CATALOG.
WA_FLD_CATALOG-FIELDNAME = P_FIELDNAME.
WA_FLD_CATALOG-TABNAME = P_REF_TABLE.
WA_FLD_CATALOG-SELTEXT_S = P_SCRTEXT.
WA_FLD_CATALOG-SELTEXT_M = P_SCRTEXT.
WA_FLD_CATALOG-SELTEXT_L = P_SCRTEXT.
WA_FLD_CATALOG-OUTPUTLEN = 15.
APPEND WA_FLD_CATALOG TO IT_FLD_CATALOG.
ENDFORM. " fill_catalog1
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = ZX"Program name
it_fieldcat = it_fld_catalog
i_save = 'X'
TABLES
t_outtab = it_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
Question 1) Any help with sum button in the above code for total of a particular column(total stock)?
Question 2) subtotals , group by plant in ALV
Is it possible to subtotal based on plant and display in the ALV list output along with plant details.what should be done ?
plant1 mat1 amt
plant1 mat2 amt
plant1 mat3 amt
subtoatl plant 1 : amt
plant2 mat4 amt
plant 2 mat5 amt
subtotal plant2 amt
2008 Dec 17 6:55 AM
hI
WA_FLD_CATALOG-FIELDNAME = P_FIELDNAME.
WA_FLD_CATALOG-TABNAME = P_REF_TABLE.
WA_FLD_CATALOG-SELTEXT_S = P_SCRTEXT.
WA_FLD_CATALOG-SELTEXT_M = P_SCRTEXT.
WA_FLD_CATALOG-SELTEXT_L = P_SCRTEXT.
WA_FLD_CATALOG-OUTPUTLEN = 15.
WA_FLD_CATLOG_DO_SUM = 'X' "Display column total
APPEND WA_FLD_CATALOG TO IT_FLD_CATALOG.Ranga
2008 Dec 17 6:56 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |