Skip to Content
avatar image
Former Member

alv

Hi everyone,

In case of ALV if at all the field is charcter type and if i write a condition like

<code>

LOOP AT IT_FINAL_BAS.

IF IT_FINAL_BAS-BUKRS LE '1000'.

IT_FINAL_BAS-COLOR = 'C21'.

ELSEIF IT_FINAL_BAS-BUKRS GT '1000' AND IT_FINAL_BAS-BUKRS LE '2000'.

IT_FINAL_BAS-COLOR = 'C41'.

ELSEIF IT_FINAL_BAS-BUKRS GT '2000' AND IT_FINAL_BAS-BUKRS LE '3000'.

IT_FINAL_BAS-COLOR = 'C71'.

ELSEIF IT_FINAL_BAS-BUKRS GT '3000'.

IT_FINAL_BAS-COLOR = 'C51'.

ELSE.

IT_FINAL_BAS-COLOR = 'C61'.

ENDIF.

MODIFY IT_FINAL_BAS INDEX SY-TABIX.

ENDLOOP.

</code>

Will there be any problem in writing like this.

Thanks,

satish

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Aug 17, 2007 at 01:12 PM

    Hi Satish,

    It should not be a proble, did u get any error...

    change the color character to 4 digits,

    IT_FINAL_BAS-COLOR = <b>'C210'.</b>

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi chandra,

      Like i got to know that if we do like that it may create problems sometimes.

      Is that any issue regarding that.

      thnks,

      satish