on 08-15-2008 4:30 PM
Hi,
I have a smartform table and I want to change the background colour of one cell depending on the contents of each line.
For example, in my internal table I have the following records:
Yellow
Red
Green
In my smartform I have a table which loops at my internal table. I want the 'Yellow' line to have the background colour of yellow, the 'Red' line to have a background colour of red etc.
I've looked in my smartstyle sheet to see if I could create a paragraph format or character format with the different colours as backgrounds but I can only change the text colour using those.
I've created different line types with the cell coloured in, but can't insert an IF command before the table line in the 'Main Area' of the table. I can insert an IF command inside the line cell but that doesn't help me as I need to create a different line using the line type with the correct colour.
Can anyone see a solution to this?
Thanks,
Gill
You can try with Creating Three line types: One with Yellow, one with Red and One with Green.
Ana depends on the condition you can call the suitable line.
I have tried to remove / change entire background color.
Here you can look at my WIKI https://wiki.sdn.sap.com/wiki/display/Snippets/DynamicBackgroundColorsinSmartForms
Regards,
Naimesh Patel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use the Condition tab of the Line type to know which line you have to use.
Take a flag field in the internal table. (ITAB-FLAG)
Before coming to the TABLE node, fill the flag as per the requirement to show yellow, red or green.
ITAB-FLAG = 1 " Green
ITAB-FLAG = 2 " Yellow
ITAB-FLAG = 3 " Red
Use that field in the condition tab.
For Green line:
ITAB-FLAG EQ 1
and so on.
Regards,
Naimesh Patel
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.