2008 Apr 07 12:29 PM
i have following columns
item code apr may jun
101 100 200 300
102 200 100 100
103 300 400 500
i want total of three fileds like below
item code apr may jun
101 100 200 300
102 200 100 100
103 300 400 500
______________
600 700 900
i have written following code to display data
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ITEM_CODE'.
ls_fieldcat-tabname = 'IT_OUTPUT'.
ls_fieldcat-seltext_m = 'Item Code'.
APPEND ls_fieldcat TO p_alv_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'TSL01'.
ls_fieldcat-tabname = 'IT_OUTPUT'.
ls_fieldcat-seltext_m = 'Apr'.
APPEND ls_fieldcat TO p_alv_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'TSL02'.
ls_fieldcat-tabname = 'IT_OUTPUT'.
ls_fieldcat-seltext_m = 'MAY'.
APPEND ls_fieldcat TO p_alv_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'TSL03'.
ls_fieldcat-tabname = 'IT_OUTPUT'.
ls_fieldcat-seltext_m = 'JUN'.
APPEND ls_fieldcat TO p_alv_fieldcat.
what additional code i have to write to display totals of each column as mentioned above
Kindly guide me on the same
2008 Apr 07 12:31 PM
Hello,
Make this change:
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'TSL03'.
ls_fieldcat-tabname = 'IT_OUTPUT'.
ls_fieldcat-seltext_m = 'JUN'.
ls_fieldcat-do_sum = 'X'.
APPEND ls_fieldcat TO p_alv_fieldcat.
Cheers,
Vasanth
i have following columns
item code apr may jun
101 100 200 300
102 200 100 100
103 300 400 500
i want total of three fileds like below
item code apr may jun
101 100 200 300
102 200 100 100
103 300 400 500
______________
600 700 900
i have written following code to display data
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ITEM_CODE'.
ls_fieldcat-tabname = 'IT_OUTPUT'.
ls_fieldcat-seltext_m = 'Item Code'.
APPEND ls_fieldcat TO p_alv_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'TSL01'.
ls_fieldcat-tabname = 'IT_OUTPUT'.
ls_fieldcat-seltext_m = 'Apr'.
APPEND ls_fieldcat TO p_alv_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'TSL02'.
ls_fieldcat-tabname = 'IT_OUTPUT'.
ls_fieldcat-seltext_m = 'MAY'.
APPEND ls_fieldcat TO p_alv_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'TSL03'.
ls_fieldcat-tabname = 'IT_OUTPUT'.
ls_fieldcat-seltext_m = 'JUN'.
APPEND ls_fieldcat TO p_alv_fieldcat.
what additional code i have to write to display totals of each column as mentioned above
Kindly guide me on the same
2008 Apr 07 12:31 PM
Hello,
Make this change:
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'TSL03'.
ls_fieldcat-tabname = 'IT_OUTPUT'.
ls_fieldcat-seltext_m = 'JUN'.
ls_fieldcat-do_sum = 'X'.
APPEND ls_fieldcat TO p_alv_fieldcat.
Cheers,
Vasanth
2008 Apr 07 12:32 PM
Hi,
give
ls_fieldcatalog-do_sum = 'X'.
for the fields u need..
Regards,
JMB
2008 Apr 09 4:43 AM
Hi Friend,
we have control break events...like
AT NEW <FIELD>.
ENDAT.
ON CHANGE OF <FIELD>
ENDON.
U CAN USE THESE EVENTS.. then ur problem is solved...
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |