Skip to Content
author's profile photo Former Member
Former Member

Color cell

I am getting suceess in this code, but i am getting same color on Filed ' Sunday ' in index 7, i need the color only on index 2.

how to solve this ?

READ TABLE GT_BPSTAB INTO WA_BPSTAB INDEX 2 .

IF SY-SUBRC = 0.

MOVE 'SUNDAY' TO LS_COLOR_CELL-FNAME.

MOVE '1' TO LS_COLOR_CELL-COLOR-COL.

MOVE '1' TO LS_COLOR_CELL-COLOR-INT.

MOVE '0' TO LS_COLOR_CELL-COLOR-INV.

APPEND LS_COLOR_CELL TO LT_COLOR_CELL.

WA_BPSTAB-COLOR_CELL[] = LT_COLOR_CELL[].

MODIFY GT_BPSTAB FROM WA_BPSTAB INDEX 2.

CLEAR WA_BPSTAB.

ENDIF.

CLEAR : LS_COLOR_CELL-FNAME,LS_COLOR_CELL-COLOR-COL,LS_COLOR_CELL-COLOR-INT,LS_COLOR_CELL-COLOR-INV.

READ TABLE GT_BPSTAB INTO WA_BPSTAB INDEX 7 .

IF SY-SUBRC = 0.

MOVE 'MONDAY' TO LS_COLOR_CELL-FNAME.

MOVE '6' TO LS_COLOR_CELL-COLOR-COL.

MOVE '0' TO LS_COLOR_CELL-COLOR-INT.

MOVE '0' TO LS_COLOR_CELL-COLOR-INV.

APPEND LS_COLOR_CELL TO LT_COLOR_CELL.

WA_BPSTAB-COLOR_CELL[] = LT_COLOR_CELL[].

MODIFY GT_BPSTAB FROM WA_BPSTAB INDEX 7.

ENDIF.

CLEAR : LS_COLOR_CELL-FNAME,LS_COLOR_CELL-COLOR-COL,LS_COLOR_CELL-COLOR-INT,LS_COLOR_CELL-COLOR-INV.

READ TABLE GT_BPSTAB INTO WA_BPSTAB INDEX 7 .

IF SY-SUBRC = 0.

MOVE 'TUESDAY' TO LS_COLOR_CELL-FNAME.

MOVE '5' TO LS_COLOR_CELL-COLOR-COL.

MOVE '0' TO LS_COLOR_CELL-COLOR-INT.

MOVE '0' TO LS_COLOR_CELL-COLOR-INV.

APPEND LS_COLOR_CELL TO LT_COLOR_CELL.

WA_BPSTAB-COLOR_CELL[] = LT_COLOR_CELL[].

MODIFY GT_BPSTAB FROM WA_BPSTAB INDEX 7.

ENDIF.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 24, 2006 at 08:50 AM

    Hi,

    Please add the bold line in your code and check.

    <b>refresh LT_COLOR_CELL.</b>

    READ TABLE GT_BPSTAB INTO WA_BPSTAB INDEX 2 .

    IF SY-SUBRC = 0.

    MOVE 'SUNDAY' TO LS_COLOR_CELL-FNAME.

    MOVE '1' TO LS_COLOR_CELL-COLOR-COL.

    MOVE '1' TO LS_COLOR_CELL-COLOR-INT.

    MOVE '0' TO LS_COLOR_CELL-COLOR-INV.

    APPEND LS_COLOR_CELL TO LT_COLOR_CELL.

    WA_BPSTAB-COLOR_CELL[] = LT_COLOR_CELL[].

    MODIFY GT_BPSTAB FROM WA_BPSTAB INDEX 2.

    CLEAR WA_BPSTAB.

    ENDIF.

    CLEAR : LS_COLOR_CELL-FNAME,LS_COLOR_CELL-COLOR-COL,LS_COLOR_CELL-COLOR-INT,LS_COLOR_CELL-COLOR-INV.

    <b>refresh LT_COLOR_CELL.</b>

    READ TABLE GT_BPSTAB INTO WA_BPSTAB INDEX 7 .

    IF SY-SUBRC = 0.

    MOVE 'MONDAY' TO LS_COLOR_CELL-FNAME.

    MOVE '6' TO LS_COLOR_CELL-COLOR-COL.

    MOVE '0' TO LS_COLOR_CELL-COLOR-INT.

    MOVE '0' TO LS_COLOR_CELL-COLOR-INV.

    APPEND LS_COLOR_CELL TO LT_COLOR_CELL.

    WA_BPSTAB-COLOR_CELL[] = LT_COLOR_CELL[].

    MODIFY GT_BPSTAB FROM WA_BPSTAB INDEX 7.

    ENDIF.

    CLEAR : LS_COLOR_CELL-FNAME,LS_COLOR_CELL-COLOR-COL,LS_COLOR_CELL-COLOR-INT,LS_COLOR_CELL-COLOR-INV.

    <b>refresh LT_COLOR_CELL.</b>

    READ TABLE GT_BPSTAB INTO WA_BPSTAB INDEX 7 .

    IF SY-SUBRC = 0.

    MOVE 'TUESDAY' TO LS_COLOR_CELL-FNAME.

    MOVE '5' TO LS_COLOR_CELL-COLOR-COL.

    MOVE '0' TO LS_COLOR_CELL-COLOR-INT.

    MOVE '0' TO LS_COLOR_CELL-COLOR-INV.

    APPEND LS_COLOR_CELL TO LT_COLOR_CELL.

    WA_BPSTAB-COLOR_CELL[] = LT_COLOR_CELL[].

    MODIFY GT_BPSTAB FROM WA_BPSTAB INDEX 7.

    ENDIF.

    Please reward points if it helps.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 24, 2006 at 08:56 AM

    Try with Refreshing the table LT_COLOR_CELL after the clear for LS_COLOR_CELL at index 2. As it is now Sunday stays for all of the lines.

    Regards,

    Anders

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.