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: 

report

Former Member
0 Kudos
83

how to display each coloum in different colors in normal classical report ( not in alv classical report ).

4 REPLIES 4

Former Member
0 Kudos
61

You can use the COLOR addtion to each write statement:

WRITE v_var COLOR col_head.

for more info,please read the documentation for the statement 'WRITE' and check the formatting options.

Former Member
0 Kudos
61

check this sample code.


tables : mara.
data : begin of itab occurs 0,
       matnr like mara-matnr,
       mtart like mara-mtart,
       matkl like mara-matkl,
       end of itab.

select matnr mtart matkl into table itab from mara up to 10 rows.

loop at itab.
format color 2.
write : / itab-matnr.
format color 3.
write : itab-mtart.
format color 4.
write : itab-matkl.
endloop.

regards

shiba dutta

muhammed_nishad
Participant
0 Kudos
61

hai,

hope you require this in write statement. please check this code .

&----


*& Report ZEX03

*&Program For Getting Flight Booking Details Of A Person.

*&Programmer Name : Muhammed Nishad J

*&Coded on : 17.09.2007

*&Package : ZTEST

&----


REPORT zex03 LINE-SIZE 66 LINE-COUNT 34(2) .

--


Start Of Code--

--


Data Declaration--

--Structure For Holding Booking Details--


TABLES:

sbook.

DATA:

BEGIN OF st_sbook,

carrid LIKE sbook-carrid,

connid LIKE sbook-connid,

fldate LIKE sbook-fldate,

customid LIKE sbook-customid,

forcuram LIKE sbook-forcuram,

forcurkey LIKE sbook-forcurkey,

END OF st_sbook,

wa_sbook LIKE st_sbook.

-End of Structure Declaration--


--


End Of Data Declaration--

PARAMETERS :

carrid TYPE sbook-carrid,

connid TYPE sbook-connid,

fldate TYPE sbook-fldate.

--


Initialization Block--

INITIALIZATION.

carrid = 'AA'.

connid = '0017'.

--


End Initialization Block--

--


At Selection Screen OutPut Event--

AT SELECTION-SCREEN OUTPUT.

IF fldate IS INITIAL.

MESSAGE ' Enter Fldate' TYPE 'S'.

ENDIF.

--


End Of At Selection Screen OutPut Event--

--


Start of Selection Event--

START-OF-SELECTION.

-----Printing the details--


--


Code For Displaying Header Details Using Text Elements--

WRITE:/.

skip.

  • ULINE AT 1(66).

WRITE: sy-uline.

WRITE: 1 sy-vline.

WRITE:2(10) text-001 COLOR 6, 11 '|'.

WRITE:12(10) text-002 ,22 '|' .

WRITE:23(10) text-003, 33 '|'.

WRITE:34(10) text-004, 44 '|'.

WRITE:45(10) text-005, 55 '|'.

WRITE:56(10) text-006 ,66 '|'.

WRITE: sy-uline.

----End of Code For Displaying Header Details--


----Code For Selecting Booking Details--


SELECT carrid connid fldate customid forcuram forcurkey

INTO wa_sbook FROM sbook

WHERE carrid = carrid AND

connid = connid." AND

"fldate = fldate.

-----Display currency to INR--


wa_sbook-forcurkey = 'INR'.

----End of Display Currency To INR--


----Code For Displaying Item Details--


WRITE:/1 sy-vline , 2(10) wa_sbook-carrid COLOR 6.

WRITE:11 sy-vline, 12(10) wa_sbook-connid .

WRITE:22 sy-vline, 23(10) wa_sbook-fldate YYMMDD.

WRITE:33 sy-vline, 34(10) wa_sbook-customid.

WRITE:44 sy-vline, 45(10) wa_sbook-forcuram.

WRITE:55 sy-vline, 56(10) wa_sbook-forcurkey ,66 sy-vline.

WRITE: sy-uline.

----End of Code For Displaying Item Details--


ENDSELECT.

--


End of Selection Event--

END-OF-SELECTION.

--


Top of Page Event--

TOP-OF-PAGE.

WRITE:'This An Example For Demonstrating Event In ABAP Reporting'.

END-OF-PAGE.

WRITE:'Page No: ', sy-pagno .

write:/'Programmer Name : Muhammed Nishad J'.

--


End Of Code--

varma_narayana
Active Contributor
0 Kudos
61

Hi..

in ABAP you can display 7 colors which are numbered from 1 TO 7.

Example:

Write:/ wa-ebeln COLOR 1,

WA-LIFNR COLOR 2,

WA-AEDAT COLOR 3.

<b>reward if Helpful.</b>