Application Development and Automation 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: 
Read only

coloring the statement

Former Member
0 Likes
1,694

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
Read only

Former Member
0 Likes
1,647

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
Read only

Former Member
0 Likes
1,647

Hi,

you can use it like:

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

this is for list processing.

hope helps.

deniz.

Read only

MarcinPciak
Active Contributor
0 Likes
1,647

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.

Read only

Former Member
0 Likes
1,648

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....

Read only

0 Likes
1,647

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.

Read only

0 Likes
1,647

any updates.....

cheers,

kumar.

Read only

0 Likes
1,647

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

Read only

0 Likes
1,647

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.

Read only

0 Likes
1,647

Hi

Try this

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

Regards

Read only

0 Likes
1,647

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.

Read only

0 Likes
1,647

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

Read only

0 Likes
1,647

hi ravi,

In my case output text also dynamic....

how can achieve this?

cheers,

kumar

Read only

0 Likes
1,647

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