on 10-31-2009 8:56 AM
hello all,
I have to display a report in alv in web dynpro abap.
In that I have to display two fields and both the fields are locations of different months.
If the location is different than the previous one then i have to display cell with the new location in red color or highlighted.
How can I achieve this.???
Only for the changed ones it has to be highlighted or different color..... I repeat.
Happy Coding.
IF want to display 2 locations , one corresponding to location of previous month and other corresponding to location of curr month ,and if 2 are not same then current month location should be highlighted or displaying in red color . If this is what u want to do then try following .
1] In context where ur data to be display exist - In LIST NODE along with attribute Location_previous_month , Location_current_month add attribute "COLOR" TYPE WDUI_TEXTVIEW_SEM_COL .
2] Find out the column which has to be marked with a different colour based on its content ( Location_ Current_ Month in your case ) . Assign the context attribute "COLOUR" to the "Cell Design Fieldname" attribute of the respective column. This can be done while setting Column attributes for each of the ALV Columns
IF find any problem in implementing above step then go thro' this link :
3] In the method to fill the data to be displayed .
CREATE INTERNAL TABLE OF TYPE List node
FILLINTERNAL TABLE CREATED ABOVE ( SAY ITAB ) WITH VALUES FOR LOCATION_ CURRENT_ MONTH , LOCATION_PREVIOUS_MONTH .
FILL COLOR VALUE FOR EACH ROW OF ITAB AS FOLLOW
LOOP AT ITAB INTO LS_ITAB .
IF LS_ITAB-LOCATION_CURRENT_MONTH <> LS-ITAB- LOACTION_PREVIOUS_MONTH .
COLOR = 06 ." 06 IS COLOR CODE
ENDIF .
4] BIND THIS INTERNAL TABLE WITH NODE LIST_NODE .
DATA NODE_LS_NODE TYPE REF TO IF_WD_CONTEXT_NODE .
NODE_LS_NODE = WD_CONTEXT->GET_CHILD_NODE( NAME = 'LIST_NODE' ) .
NODE_LS_NODE->BIND_TABLE ( EXPORTING
NEW_TAB = ITAB ).
Hope thid will help .
THKS ,
RUSHIKESH
Edited by: RUSHI123 on Oct 31, 2009 8:59 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.