Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

coloring the statement

Former Member
0 Kudos

hi guru's,

i am getting the color for my out put text but that is up to the

text only. my requiement is to color the entire line for the particular text ..means till the line end.

cheers,

sravan.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

I believe you are talking about inverse color..i.e Background color....

In yours case you can have a Empty string to be printed to cover the left line space...sp as to get complete line as Inversed colored....

12 REPLIES 12

Former Member
0 Kudos

Hi,

you can use it like:

write 'Hello world!' color 1. "colors through 1-7

this is for list processing.

hope helps.

deniz.

MarcinPciak
Active Contributor
0 Kudos

If you use WRITE with COLOR addition it will color only this text which is being outputed.

If you want to use color for entire line use FORMAT statement:


"after this statement everything will be colored until color changes
FORMAT COLOR COL_HEADING.
    write: ...
"now if you want to rest color use
 FORMAT RESET INTENSIFIED ON.
"here no color will be used
 write:....

"and again after this everything will be color
FORMAT COLOR COL_HEADING.

Former Member
0 Kudos

Hi,

I believe you are talking about inverse color..i.e Background color....

In yours case you can have a Empty string to be printed to cover the left line space...sp as to get complete line as Inversed colored....

0 Kudos

i was written the code as shown below

format color 4.

write....

format color off.

but still i am getting up to the output text only.

my requirement is only on foreground not background.

cheers,

kumar.

0 Kudos

any updates.....

cheers,

kumar.

0 Kudos

Hi Kumar

Try this . Increase the length to change how much it is colored.

Does this solve your issue ?

WRITE (125) 'Hi' COLOR 1.

Regards

0 Kudos

hi,

we need to write for every statement ...

but i want for bunch of write stements.

instead of adding color for every write statement.. is there any other way to do that... ??

cheers,

kumar.

0 Kudos

Hi

Try this

FORMAT COLOR COL_HEADING .
WRITE /(125) 'Hi' .
WRITE /(15) 'Hi'.
WRITE /(120) 'Hi'.
FORMAT COLOR OFF.

Regards

0 Kudos

hi ravi !

thanks for ur response.but i know this .In my Function Module requirement Line Size was dynamic.how can i handle this ?

cheers,

kumar.

0 Kudos

Hi

When you meant "Line size was dynamic" Did you mean something like this as i did not properly understand your question

DATA : SIZE TYPE I,
       COL  TYPE I.
DO 10 TIMES.

  SIZE = SY-INDEX.

  FORMAT COLOR COL_HEADING .

  WRITE AT /COL(SIZE) 'Hi' .

  FORMAT COLOR OFF.

ENDDO.

Regards

0 Kudos

hi ravi,

In my case output text also dynamic....

how can achieve this?

cheers,

kumar

0 Kudos

Hi Kumar,

Did you mean the text in the write stmt is dynamic

DATA : SIZE       TYPE I,
       COL        TYPE I,
       TEXT       TYPE STRING,
       SIZE_CHAR  TYPE CHAR05.

DO 10 TIMES.

  SIZE = SY-INDEX + 20.

  SIZE_CHAR = SY-INDEX.

  CONCATENATE 'This is Line' SIZE_CHAR INTO TEXT.

  FORMAT COLOR COL_HEADING .

  WRITE AT /COL(SIZE) TEXT.

  FORMAT COLOR OFF.

ENDDO.

Regards