728x90
반응형
인터널테이블에 아래 필드 추가
celltab type lvc_t_styl
cellcol type lvc_t_scol
레이아웃에 추가
- 이때 테이블에 추가한 필드이름과 동일해야함
ps_layo-stylefname = 'CELLTAB'. ps_layo-ctab_fname = 'CELLCOL'.
그리고 필요한 곳에
PERFORM SET_CELLTAB USING GS_S0100-CELLTAB: '필드명' GC_X.
*&---------------------------------------------------------------------*
*& Form SET_CELLTAB
*&---------------------------------------------------------------------*
FORM SET_CELLTAB USING PT_CELLTAB TYPE LVC_T_STYL
PV_FNAME
PV_DISABLE.
DELETE PT_CELLTAB WHERE FIELDNAME = PV_FNAME.
INSERT VALUE #( FIELDNAME = PV_FNAME
STYLE = COND #( WHEN PV_DISABLE = GC_X THEN CL_GUI_ALV_GRID=>MC_STYLE_DISABLED
ELSE CL_GUI_ALV_GRID=>MC_STYLE_ENABLED )
) INTO TABLE PT_CELLTAB.
ENDFORM.
PERFORM fill_cellcol USING ls_0100-cellcol: 'QTY_DIFF' 6.
*&---------------------------------------------------------------------*
*& Form fill_cellcol
*&---------------------------------------------------------------------*
FORM fill_cellcol USING pt_cellcol TYPE lvc_t_scol
pv_fname
pv_col.
INSERT VALUE #( fname = pv_fname
color-col = pv_col
color-int = 1
color-inv = 1
) INTO TABLE pt_cellcol.
ENDFORM.
색상참고: https://blogs.sap.com/2013/08/23/example-for-cell-colors-in-alv/
728x90
반응형
'ABAP' 카테고리의 다른 글
ON CHAIN-REQUEST (0) | 2023.03.01 |
---|---|
프로그램 호출시 새창으로 호출하기 (ABAP4_CALL_TRANSACTION) (0) | 2023.03.01 |
BDC Program Logic (0) | 2023.03.01 |
MESSAGE (0) | 2023.03.01 |
ALV Refresh시 Layout 재설정 (SET_FRONTEND_LAYOUT) (0) | 2023.03.01 |
댓글