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

Sap ABAP Classical report

Former Member
0 Likes
1,796

color-test.jpg

Hello Expert's

I am developing an Classical report in SC2 dev system and for the cells with particular block name i am suggested add some colors. Please check the attached image i.e RTO should have red color, INVEX should have green...etc.

I have added those colors with statement :

WHEN 'RTO'.
FORMAT COLOR COL_TOTAL INTENSIFIED OFF.

WHEN 'INVEX'.
FORMAT COLOR COL_NORMAL INTENSIFIED ON.

The issue is a small bit of the color is coming outside of the cell and its displaying in the cell next to it and its very annoying to look.

Please check 2nd attachment.

Can anyone have any idea of why it's happening like this?

Thanks.

color.jpg

3 REPLIES 3
Read only

Dominik_Tylczynski
SAP Champion
SAP Champion
1,540

I can't see your entire report, thus can't tell you exactly what you need to change. However I'd suggest the following patter that worked for me several times:

WHEN 'RTO'.
FORMAT COLOR COL_TOTAL INTENSIFIED OFF.
WRITE: / ...
FORMAT COLOR OFF.
WHEN 'INVEX'.
FORMAT COLOR COL_NORMAL INTENSIFIED ON.
WRITE: / ...
FORMAT COLOR OFF.

The idea is to switch on color formatting, write what you need to write and then immediately switch off color formatting. This way the color formatting won't affect next WRITE statement.

HTH

Dominik Tylczynski

Read only

Sandra_Rossi
Active Contributor
1,540

Your code has a bug. But if you post the whole code, probably people won't be able to compile it and so won't be able to debug so it will be very difficult to help you. Maybe you need tips to debug the code yourself?

Read only

venkateswaran_k
Active Contributor
1,540

Hi

It happens when the adjacent columns are overlapping - where your vertical line | is intersecting inbetween

Better you specify the column position in your code for each column. - that makes clear

Example :

  LOOP AT it_final INTO wa_final.    WRITE :  /1  wa_final-matnr COLOR 2,
             20 wa_final-ersda COLOR 3,
             37 wa_final-ernam,
             50 wa_final-laeda ,
             70 wa_final-mtart ,
             85 wa_final-matkl ,
             95 wa_final-meins,
             115   wa_final-lgort COLOR 4,
             130   wa_final-werks COLOR 5.
  ENDLOOP.

Regards,

Venkat