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: 

color font

Former Member
0 Kudos
102

hi,

How to create color in classical & interactive reports for every single character.(i need a full coding.)

5 REPLIES 5

Former Member
0 Kudos
75

Hi Jey,

WELCOME TO SDN!!!

Please check this code.

DATA lt_mara TYPE mara OCCURS 0 WITH HEADER LINE.

SELECT * FROM mara INTO TABLE lt_mara.

LOOP AT lt_mara.
  WRITE:/2 lt_mara-matnr COLOR 3,
         30 lt_mara-matkl COLOR 1,
         40 lt_mara-mtart COLOR 5.

ENDLOOP.

Interactive Report

DATA: lt_mara TYPE mara OCCURS 0 WITH HEADER LINE,
      lt_mard TYPE mard OCCURS 0 WITH HEADER LINE.

SELECT * FROM mara INTO TABLE lt_mara.


LOOP AT lt_mara.
  WRITE:/2 lt_mara-matnr COLOR 3,
         30 lt_mara-matkl COLOR 1,
         40 lt_mara-mtart COLOR 5.
  HIDE lt_mara-matnr.

ENDLOOP.

AT LINE-SELECTION.

  SELECT *
  FROM mard
  INTO TABLE lt_mard
  WHERE matnr = lt_mara-matnr.

  LOOP AT lt_mard.
    WRITE:/ lt_mard-matnr COLOR 4,
            lt_mard-werks COLOR 6,
            lt_mard-lgort COLOR 7.
  ENDLOOP..

Best regards,

raam

Former Member
0 Kudos
75

Hi,

Syntax:

WRITE: / P_VBELN COLOR 5,

P_VKORG COLOR 5.

Regards,

Ruthra

Former Member
0 Kudos
75

Hi,

I'm not sure your meanings, so i just give you some refer:

data: col(10) type c value 'ABCD'.

write: col color 6 INVERSE on.

Hope it helps

Bob

0 Kudos
75

Hi,

if you want to display the values with color just see given below

in write statement

write:/ itab-fname COLOR 1,

itab-fname COLOR 2,

itab-fname COLOR 3.

here we can have upto 7 colors. you can use which ever you want.

Regards.

Sriarm.

peter_ruiz2
Active Contributor
0 Kudos
75

hi jey,

try this



v_len = strlen( mara-matnr ).

v_color = 1.
v_offset = 0.

do v_len times.
  if v_color >7.
    v_color = 1.
  endif.

  v_char = mara-matnr+v_offset(1).

  write: v_char color v_color.

  add 1 to v_offset.
enddo.

regards,

Peter