on 01-06-2015 6:28 AM
Hello Gurus,
I have a requirement in the table view(not alv) where in i need to color the particular table cell fied based when the field is empty.
let me tell you with an example.
e.g:
Airline flightnumber Currency price
SQ 0400 dem
HQ usd 100
SD 3577 12
SM 0026
The above table is what my output where i need to have colors for the blank fields.
* in the first row i need to have color design for price field
* in the second row i need to have color design for flight number field.
* in the third row i need to have color design for currency field.
* in the 4th row i need to have color design for currency & price field
can some one please help me out.
Thanks in Advance.
Hi Saikanth,
Add as many attributes as the number of columns for which you need to colour in the node which is bound to the table UI element. & bind the corresponding attribute to the "cellDesign" property of the corresponding column.
In your Example, there are 4 columns and 3 columns need to be colored.
So declare a node with 7 attributes (+ any extra attributes required based on the requirement).
Bind these 3 attributes (of the corresponding type) to the cellDesign property of the flightnumber, currency & Price columns respectively.
In the code before binding the table using the BIND_TABLE method, set these fields in the internal table to the color code values as required.
Hope this helps you.
Best Regards,
Sireesha Ch
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is my example
here i have binded 2attributes i.e flight number and airfare....
here i want red color only for airfare which is 6k and green color for flight number 0454 which i have mentioned the same in the coding.
but the problem is the entire row is getting colored for the binded attributes.
if u can see fare 6000 corresponding flight number is colored and similarly happened for the 2nd row.
From your example I can see that you have only one attribute COLOR, which is bound to the both the columns Flight number & Airfare.
Instead, have two variables and bind these to these 2 columns respectively. And in coding assign the corresponding color.
Hope from the below piece of code, you may understand what needs to be done.
IF wa-price = '6000'.
wa-fare_color = 01.
ENDIF.
IF wa-connid = '0454'.
wa-flight_color = 02.
ENDIF.
Regards,
Sireesha Ch
Thanks Guys,
My issue is solved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sai,
You can have attributes in context node for coloring the cells with type WDUI_TABLE_CELL_DESIGN & bind the cell design of editor to respective attributes.
if <cell_1_value> is blank
color_cell_1 = '02',
else.
color_cell_1 = '00'.
endif.
Please refer the below document
coloring Table cells conditionally in Webdynpro ABAP…
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
for the three attributes i had did binding i.e flight number currency and price.
And even i have done the coding earlier that u have mentioned.
But the problem is in every row for all the three attributes the color is changing(if one field is blank and the rest of the fields are not blank.)
i will show you my example
here i have binded 2attributes i.e flight number and airfare....
here i want red color only for airfare which is 6k and green color for flight number 0454 which i have mentioned the same in the coding.
but the problem is the entire row is getting colored for the binded attributes.
if u can see fare 6000 corresponding flight number is colored and similarly happened for the 2nd row.
User | Count |
---|---|
84 | |
24 | |
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.