ALV 指示燈 編寫   

1,在內表中申請一個字段。 該字段必須為大寫

   如 data: begin of wa_out occurs 10,
        ICON LIKE icon-id ,  "1:Red 2:Yellow 3:Green    為指示燈字段
        SELFL TYPE C ,
        ebeln like ekko-ebeln,
        ebelp like ekpo-ebelp,
        lifnr like ekko-lifnr,
        ekorg like ekko-ekorg,
       end of wa_out.

2對該字段賦值 

       wa_out-icon = '2'.  "一定要用分號

3 layout 輸出

     gs_layout-lights_tabname = 'IT_OUT'.
     gs_layout-lights_fieldname = 'ICON'.            "字段名為大寫

4 it_fieldcat 設定

    fieldcat-icon = 'X'                                             "該屬性設為啟用