03-24-2010 1:46 PM
Hi ,
In the ALV Output Material and Quantity is coming side by side.
I need to do for the Same Material ,The sum of Quantity should come .
How to write this code in ALV .
Thanks in advance.
03-24-2010 1:55 PM
use
WA_SORT-TABNAME = 'IT_OUTPUT'.
WA_SORT-FIELDNAME = 'MATNR'.
WA_SORT-UP = 'X'.
WA_SORT-GROUP = 'X'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO IT_SORT.
CLEAR WA_SORT.
also while building field cat
use
WA_FIELDCAT-DO_SUM = 'X'. for the field you want to sum
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
I_GRID_TITLE = 'Project SO Details (FAS)'(003)
IS_LAYOUT = GS_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
IT_SORT = IT_SORT
IT_FILTER = IT_FILTER
I_DEFAULT = 'X'
I_SAVE = 'A'
TABLES
T_OUTTAB = IT_OUTPUT
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.
Try this
Edited by: Sachin Bidkar on Mar 24, 2010 2:56 PM
03-24-2010 1:50 PM
03-24-2010 1:55 PM
use
WA_SORT-TABNAME = 'IT_OUTPUT'.
WA_SORT-FIELDNAME = 'MATNR'.
WA_SORT-UP = 'X'.
WA_SORT-GROUP = 'X'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO IT_SORT.
CLEAR WA_SORT.
also while building field cat
use
WA_FIELDCAT-DO_SUM = 'X'. for the field you want to sum
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
I_GRID_TITLE = 'Project SO Details (FAS)'(003)
IS_LAYOUT = GS_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
IT_SORT = IT_SORT
IT_FILTER = IT_FILTER
I_DEFAULT = 'X'
I_SAVE = 'A'
TABLES
T_OUTTAB = IT_OUTPUT
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.
Try this
Edited by: Sachin Bidkar on Mar 24, 2010 2:56 PM
08-19-2016 10:35 AM
ALV Output sales order ,Material and Quantity is coming side by side.
I need to do for the Same sales oreder ,different no Material ,The sum of Quantity should come
i am building my field catalog using
wa_fcat-fieldname = 'ERDAT'.
wa_fcat-tabname = 'IT_FINAL'.
wa_fcat-seltext_m = 'DATE'.
append wa_fcat to it_fcat .
clear wa_fcat .
03-24-2010 2:17 PM
03-25-2010 5:29 AM
When you are building your feild catalog as below for example
w_fcat1-tabname = 'ITBSET8'. "internal table name
w_fcat1-fieldname = 'EDUCE'. "name of the feild
w_fcat1-seltext_m = 'Edu. Cess (Rs.)'. "name of the feild as you need when th display
w_fcat1-outputlen = 15.
w_fcat1-datatype = 'CURR'.
w_fcat1-do_sum = 'X'.
08-19-2016 10:24 AM
ALV Output sales order ,Material and Quantity is coming side by side.
I need to do for the Same sales oreder ,different no Material ,The sum of Quantity should come
i am building my field catalog using
wa_fcat-fieldname = 'ERDAT'.
wa_fcat-tabname = 'IT_FINAL'.
wa_fcat-seltext_m = 'DATE'.
append wa_fcat to it_fcat .
clear wa_fcat .