Skip to Content
avatar image
Former Member

report

how to display the data each row in different colors in classical report.pls send corresponding code.

Thanks in advance.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Aug 22, 2007 at 06:11 AM

    you can use maximum of 7 colurs only to display in the report.

    presss F1 on the WRITE statement and check the COLOR addition.

    Regards,

    Amit

    Reward all helpful replies.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2007 at 06:47 AM

    Hi,

    Try with the following simple code.

    DO 10 TIMES.

    WRITE / sy-index color col_normal.

    WRITE / sy-index color col_group.

    WRITE / sy-index color col_total.

    WRITE / sy-index color col_normal.

    sum = sum + sy-index.

    WRITE sum COLOR COL_TOTAL.

    ENDDO.

    ULINE.

    WRITE sum UNDER sum COLOR COL_GROUP.

    Reward points for useful points.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2007 at 07:25 AM

    Hi,

    Try like this:

    DATA: BEGIN OF TP OCCURS 10, ID, NR(8), TEXT(255), END OF TP.

    DATA: LENGTH TYPE I VALUE 8, " Length of list

    TESTSTRING(15) TYPE C VALUE '012345678901234',

    WIDTH TYPE I. " Width of list

    DATA: TXT_REPORT LIKE DOKHL-OBJECT.

    START-OF-SELECTION.

    PERFORM HEADING.

    PERFORM OUTPUT_BODY.

    FORM HEADING.

    FORMAT INTENSIFIED OFF. " Remove any INTENSIFIED

    ULINE AT (WIDTH). " Upper frame border

    FORMAT COLOR COL_HEADING INTENSIFIED." Title color

    WRITE: / SY-VLINE. " Left border

    WRITE: 'No |Colour |intensified |intensified off|',

    'inverse' NO-GAP.

    WRITE: AT WIDTH SY-VLINE. " Right border

    ULINE AT (WIDTH). " Line below titles

    FORMAT COLOR OFF.

    ENDFORM.

    FORM OUTPUT_BODY.

    DO LENGTH TIMES.

    PERFORM WRITE_LINE USING SY-INDEX.

    ENDDO.

    ENDFORM.

    FORM WRITE_LINE USING COUNT TYPE I.

    DATA: HELP(14) TYPE C,

    COUNT1 TYPE I.

    COUNT1 = SY-INDEX - 1.

    WRITE: / SY-VLINE NO-GAP.

    WRITE: (4) COUNT1 COLOR COL_KEY INTENSIFIED NO-GAP.

    WRITE: SY-VLINE NO-GAP.

    CASE COUNT1.

    WHEN '0'.

    HELP = 'COL_BACKGROUND'.

    WHEN '1'.

    HELP = 'COL_HEADING'.

    WHEN '2'.

    HELP = 'COL_NORMAL'.

    WHEN '3'.

    HELP = 'COL_TOTAL'.

    WHEN '4'.

    HELP = 'COL_KEY'.

    WHEN '5'.

    HELP = 'COL_POSITIVE'.

    WHEN '6'.

    HELP = 'COL_NEGATIVE'.

    WHEN '7'.

    HELP = 'COL_GROUP'.

    ENDCASE.

    WRITE: HELP COLOR COL_KEY INTENSIFIED NO-GAP.

    WRITE: SY-VLINE NO-GAP.

    WRITE: TESTSTRING COLOR = COUNT1 INTENSIFIED NO-GAP.

    WRITE: SY-VLINE NO-GAP.

    WRITE: TESTSTRING COLOR = COUNT1 INTENSIFIED OFF NO-GAP.

    WRITE: SY-VLINE NO-GAP.

    WRITE: TESTSTRING COLOR = COUNT1 INVERSE NO-GAP.

    WRITE AT WIDTH SY-VLINE NO-GAP.

    ENDFORM.

    Regards,

    Bhaskar

    Add comment
    10|10000 characters needed characters exceeded