Skip to Content
-2

Change cell color alv oo(cl_salv_table)

Dec 04, 2017 at 10:19 AM

43

avatar image
Former Member
The colorof the cells don't change, can someone help me pleae?TYPES:BEGINOF s_join,
*id cliente

         kunnr   TYPE vbak-kunnr,
*ragione sociale

         name1   TYPE kna1-name1,
*numero ordine

         bstnk   TYPE vbak-bstnk,
*posizione

         posnr   TYPE vbap-posnr,
*data creazione

         erdat   TYPE vbak-erdat,
*codice materiale

         matnr   TYPE vbap-matnr,
*desrizione materiale

         arktx   TYPE vbap-arktx,
*id ordine

         vbeln   TYPE vbak-vbeln,
*data consegna

         vdatu   TYPE vbak-vdatu,
*quantità

         kwmeng  TYPE vbap-kwmeng,
*unita di misura

         kmein   TYPE vbap-kmein,
*campo del colore

         t_color TYPE lvc_t_scol,ENDOF s_join .DATA:
*      Creazione internal tables per vbak e vbap

  t_vbak  TYPETABLEOF vbak,

  t_vbap  TYPETABLEOF vbap,
*dichiaro le workarea delle due tebelle

  wa_vbak TYPE vbak,

  wa_vbap TYPE vbap.
*&---------------------------------------------------------------------*DATA:
*creo una tabella per la struttura di join

  t_join  TYPETABLEOF s_join,
*dichiaro  la workare della tabella di join

  wa_join TYPE s_join.......
** Color Structure for columns **DATA: ls_s_color TYPE lvc_s_scol.FORM set_color.DATA not_found TYPEREFTO cx_salv_not_found.TRY.LOOPAT t_join INTO wa_join .IF wa_join-kwmeng LT10000.

          ls_s_color-fname     ='KWMENG'.

          ls_s_color-color-col =7.

          ls_s_color-color-int =1.

          ls_s_color-color-inv =0.APPEND ls_s_color TO wa_join-t_color.CLEAR  ls_s_color.ENDIF.

        ls_s_color-fname ='KUNNR'.

        ls_s_color-color-col =5.

        ls_s_color-color-int =1.

        ls_s_color-color-inv =0.APPEND ls_s_color TO wa_join-t_color.CLEAR  ls_s_color.
*        wa_join-t_color = lt_s_color.MODIFY t_join FROM wa_join.CLEAR  wa_join. 

* CLEAR lt_s_color.ENDLOOP.CATCH cx_salv_not_found INTO not_found." error handlingENDTRY.ENDFORM.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Sandra Rossi Dec 04, 2017 at 10:51 AM
0

So, your question is about the class CL_GUI_ALV_GRID, and coloring individual cells. You need to pass the name of the color component of your ALV table via the parameter IS_LAYOUT of method SET_TABLE_FOR_FIRST_DISPLAY, component INFO_FNAME = 'T_COLOR' (the name I see in your code).

Share
10 |10000 characters needed characters left characters exceeded