‎2009 Feb 18 8:09 AM
Hello all,
i am making a query with MKPF and MSEG tables (similar than MB51 t-code). I want to make one thing like the tcode. There when is quantity -2, puts red colour and when it is +2 puts it on green colour.
I want to make the same in my query. To put red and green fields when the quantity was negative or positive. Is this possible?.
Thanks.
‎2009 Feb 18 8:11 AM
want to make the same in my query --> Do you mean in your select or you are tyring to display the o/p ....
‎2009 Feb 18 8:17 AM
hi...
to give such colouring
you can use this thing in your report
if quan > 0.
format color positive.
write: quan.
format color off.
endif.
if quan < 0.
format color negative.
write: quan.
format color off.
endif.
to make this query as TCODE you have to go to se80 and give the name of the report ( in which you have performed query ) there in you can create a TCODE for a report.
‎2009 Feb 18 8:38 AM
Thanks. It's a clue. The second part (to create a t-code) was known by me already. This wasn't my question but the first part yes.
I've tested it, but it doesn't works. When i write the coding into my added query field it tells me the next:
'COLOR POSITIVE" is not expected; only 1 to 7 or the relevant color. IDs (COL_...) are allowed.'
I've tested with 1 to 7 colours too, but nothing. My query added field says:
CLEAR ZCTD.
IF MSEG-SHKZG = 'S'.
ZCTD = MSEG-ERFMG.
ELSE.
ZCTD = - MSEG-ERFMG.
ENDIF.
if ZCTD > 0.
format color 1.
write: ZCTD.
format color off.
endif.
if ZCTD < 0.
format color 2.
write: ZCTD.
format color off.
endif.
Any ideas??
‎2010 Jan 12 3:06 PM
‎2010 Jan 12 3:27 PM
JLS:
If you question wasn't answered....why did you close it?
And this code works perfect for me...
DATA: test TYPE string.
test = -2.
IF test GT 0.
FORMAT COLOR 1.
WRITE:/ test.
FORMAT COLOR OFF.
ELSE.
FORMAT COLOR 5.
WRITE:/ test.
FORMAT COLOR OFF.
ENDIF.
Greetings,
Blag.