on 11-17-2005 12:13 PM
Hi,
I have an ALV-report which initially shows subtotals only. The users want to see specific colors in specific cells of the subtotals if possible.
Is it?
Regards
Thomas
Hi Thomas,
1 You are right.
It seems it is not possible
to
colour the line of SUBTOTAL
(Not the normal data lines)
thru the conventional facility
provided by ALV Functions.
2. Using raw home logic,
one can color it as mentioned in the last answer.
but not thru the functionality provided by SAP for
alv purpose.
This answer may not help your answer,
but probably it will clarify our doubts
and probably the DIFFERENT answers
which many have replied.
Regards,
Amit Mittal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm sorry!
I thought the right answer was in this last messages. But I don't seem to make it work. I can't catch the event.
Do any of you have an example that works?
I'm using the class CL_GUI_ALV_GRID (not list or tree and not FM REUSE_ALV....) with method set_table_for first_display. I have implemented the event-handler which works fine with the DOUBLE_CLICK event, but not with END_OF_LIST. I have also tried event SUBTOTAL_TEXT - just to see if it could reveal anything usefull.
I have tried the BCALV-examples but they seems not to work either.
Regards
Thomas
Hi Thomas,
It's not possible to color sub total cells.We can give colors to cell level, column level and row level.
But we cant do coloring for totals. If you want to put your own button and handling may be you can do it. To do that you need to do lot more things.
To my knowledge we cant do it. If I am wrong some body can correct me.
Thanks & Regards,
Siir.
hi If it is normal alv u can do it in different ways.
in end-of-list event
read the report and modify the line where ever subtotals
appear.
i will give a simple code have a look
*-End of list
X_EVENTS_DATA-NAME = 'END_OF_LIST'.
X_EVENTS_DATA-FORM = 'LIST_MODIFY_OUPUT'.
APPEND X_EVENTS_DATA TO IT_EVENTS_DATA.
in the form
READ LINE SY-INDEX INDEX SY-LSIND.
IF SY-SUBRC = 0.
MODIFY LINE SY-INDEX INDEX SY-LSIND
FIELD FORMAT IT_DISPLAY-TOTAL COLOR 4 INVERSE.
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check this link.
http://www.geocities.com/mpioud/Abap_programs.html
http://www.geocities.com/mpioud/Z_ALV_LINE_COLOR.html
It is about colouring a cell and colouring a line.If so,kindly reward points by clicking the star on the left of reply.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Follow this link...
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid.htm
I hope it will work you.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas
example on ALV with line color
http://www.geocities.com/mpioud/Z_ALV_LINE_COLOR.html
example on ALV with cell color
http://www.geocities.com/mpioud/Z_ALV_CELL_COLOR.html
http://help.sap.com/saphelp_erp2004/helpdata/en/fa/efb529f8a611d2b48d006094192fe3/frameset.htm
http://help.sap.com/saphelp_erp2004/helpdata/en/fa/efb529f8a611d2b48d006094192fe3/frameset.htm
reward points for helpfull answers and close the thread if your question is solved.
regards,
venu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thomas,
While building the Field Catalog, For the Subtotal field, have a stmt
waFieldcatalog-fieldname = 'SUBTOTAL'
<b>waFieldCatalog-emphasize = 'X'.</b>
append waFieldCatalog to ifieldCatalog
Thanks
Kam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas,
Please check the Demo program ERGP2120.
It has this feature.
Step1: define you internal table like below
DATA: BEGIN OF mylist OCCURS 20, " Internal table for preparing
zuordnung(8) TYPE c,
belegnr(10) TYPE c,
ba(2) TYPE c,
bldatum TYPE d,
bs(2) TYPE c,
s(4) TYPE c VALUE ' ',
wrg(4) TYPE c,
betrag TYPE p DECIMALS 2,
colinfo TYPE slis_t_specialcol_alv,
END OF mylist.
Step2:
LOOP AT lt_mylist.
REFRESH gt_color.
CLEAR gt_color.
IF lt_mylist-betrag > 500000.
CLEAR gt_color.
gt_color-fieldname = 'BETRAG'.
gt_color-color-col = cl_gui_resources=>list_col_positive.
gt_color-color-int = 0.
APPEND gt_color.
ELSEIF lt_mylist-betrag < 100000.
CLEAR gt_color.
gt_color-fieldname = 'BETRAG'.
gt_color-color-col = cl_gui_resources=>list_col_negative.
gt_color-color-int = 0.
APPEND gt_color.
ENDIF.
lt_mylist-colinfo[] = gt_color[].
MODIFY lt_mylist.
ENDLOOP.
Thanks,
Ramakrishna
Message was edited by: Ramakrishna Prasad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi coloring the cells..
delcare a field in ur internal table.
cellcolor type lvc_t_scol.
data: ls_cellcolor type lvc_s_scol.
and then for that
while populating the totals
ls_cellcolor-fname = 'TOTAL' .
ls_cellcolor-color-col = '7' .
ls_cellcolor-color-int = '1'
APPEND ls_cellcolor TO IT_FINAL-cellcolor
u can get different color for that cell.
regards
vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Vijay,
Do you mean it is possible to do it with the ALV-calculated subtotals in the same way as with the detail-lines?
I'm asking about coloring af subtotal-<u>line</u> - <b>not</b> a subtotal-<u>column</u>!
-> Ramakrishna - the program ERGP2120 is not found in the SAP-system I'm working with. (46c)
Regards
Thomas
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.