메뉴 건너뛰기

SAP 한국 커뮤니티

REPORT ZALVCOLOR

sapjoy 2010.10.10 04:36 조회 수 : 3212

*?---------------------------------------------------------------------*
*  TITLE        : ALV Line Color 종류 알아보기
*  PROGRAM NAME : ZALVCOLOR
*  AUTHOR       : CHANHOON KIM
*  CREATED ON   : 2010.06.08
*  DESCRIPTION  :
*  REF.PROGRAM  :
*?---------------------------------------------------------------------*
*  MODIFICATION LOG
*  DATE      AUTHOR  DESCRIPTION
*?---------------------------------------------------------------------*
*
*?---------------------------------------------------------------------*

REPORT  ZALVCOLOR.

TYPE-POOLS: SLIS.

DATA: FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA: LAYOUT TYPE SLIS_LAYOUT_ALV.

DATA: BEGIN OF I_OUTPUT OCCURS 0,
        I_TEXT(30) TYPE C,
        I_COLOR(4),
      END OF I_OUTPUT.

DATA: I_NUM(1) TYPE N.
DATA: I_INT(1) TYPE N.
DATA: I_4(1)   TYPE N.

DO 28 TIMES.
  I_4 = 0.
  IF SY-INDEX = 1.
    I_NUM = 1.
    I_INT = 1.
  ELSE.
    I_NUM = I_NUM + 1.
    IF I_NUM = 8.
      I_NUM = 1.
      I_INT = 0.
    ENDIF.
  ENDIF.
  IF SY-INDEX > 14.
    I_4 = 1.
  ENDIF.
  IF SY-INDEX > 21.
    I_INT = 1.
  ENDIF.

  CONCATENATE 'C' I_NUM I_INT I_4 INTO I_OUTPUT-I_COLOR.
  CONCATENATE 'COLOR ' I_OUTPUT-I_COLOR INTO I_OUTPUT-I_TEXT SEPARATED BY SPACE.
  APPEND I_OUTPUT.
  CLEAR I_OUTPUT.
ENDDO.

DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.

CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'I_TEXT'.
LS_FIELDCAT-SELTEXT_L = 'ALV COLOR VIEW'.
LS_FIELDCAT-KEY = 'X'.
LS_FIELDCAT-OUTPUTLEN = '30'.
APPEND LS_FIELDCAT TO FIELDCAT.

LAYOUT-INFO_FIELDNAME = 'I_COLOR'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    I_CALLBACK_PROGRAM = 'Z_SET_COLOR_IN_ALV_OUTPUT'
    IS_LAYOUT          = LAYOUT
    IT_FIELDCAT        = FIELDCAT[]
  TABLES
    T_OUTTAB           = I_OUTPUT[].
번호 제목 글쓴이 날짜 조회 수
391 report zsaptip_009 [1] sapjoy 2010.12.10 3852
390 REPORT Z_3DGRAPH. [1] sapjoy 2010.10.18 3666
389 REPORT zsmw0010 sapjoy 2010.10.12 4315
388 z_exception_test sapjoy 2010.10.11 3521
387 REPORT zmacro_01. sapjoy 2010.10.10 2582
386 REPORT ZTEST_ABAPTPDF sapjoy 2010.10.10 3693
» REPORT ZALVCOLOR sapjoy 2010.10.10 3212
384 REPORT ZTABLE_UTIL sapjoy 2010.10.10 4012
383 REPORT Z_DYNAMIC_SCREEN [1] sapjoy 2010.10.08 3035
382 report zsalv_045 . sapjoy 2010.08.20 4264
381 report zsalv_043 . sapjoy 2010.08.20 2978
380 report zsalv_042 . sapjoy 2010.08.20 3135
379 report zsalv_041 . sapjoy 2010.08.20 2998
378 report zsalv_040 . sapjoy 2010.08.20 2608
377 report zsalv_036 . sapjoy 2010.08.20 3473
376 report zsalv_035 . sapjoy 2010.08.20 2505
375 report zsalv_032 . sapjoy 2010.08.20 2976
374 report zsalv_031 . sapjoy 2010.08.20 2427
373 report zsalv_030 . sapjoy 2010.08.20 2331
372 report zsalv_023 . sapjoy 2010.08.20 2347