DATA: GT_M0323 LIKE ZOJT01_T0323 OCCURS 0 WITH HEADER LINE.
" 필수 선택 옵션 추가
PARAMETERS M_1 LIKE GT_M0324-ZGUBUN OBLIGATORY.
" 1. 기본 SELECT-OPTION
SELECT-OPTIONS S_DATE FOR GT_DATA-ZDATE.
" 2. TO 가 사라짐
SELECT-OPTIONS S_DATE FOR GT_DATA-ZDATE NO INTERVALS.
" 3. MULTIPLE이 사라짐
SELECT-OPTIONS S_DATE FOR GT_DATA-ZDATE NO-EXTENSION.
GC_X TYPE C VALUE 'X'.
GR_RANGE FOR MARA-MATNR.
DEFINE _CLEAR.
CLEAR: &1, &1[].
END-OF-DEFINITION.
= CLEAR: GT_DATA, GT_DATA[] 같은 의미
프로그램을 실행하면 화면에 보이는 필드들을 초기화하고, 사용자가 입력한 값에 대한 결과를 반환하는 사용자 이벤트에 대해 기술
INITIALIZATION.
p_1 = 'AA'.
"AUTHORITY 체크 기능
AT SELECTION-SCREEN.
AUTHORITY-CHECK OBJECT 'Z_TEST'
ID 'CARRID' FIELD P_CARRID
ID 'ACTVT' FIELD '03'.
IF SY-SUBRC = 4.
MESSAGE E000 WITH 'You need a authority'.
ENDIF.
" START-OF-SELECTION
" 아래 코드의 핵심은 실행버튼 눌렀을 때 밑에 PROGRESS BAR가 진행되는 것.
DATA: G_TOTAL TYPE I,
G_CNT TYPE I,
G_INDEX TYPE I.
DATA: GT_SFLIGHT TYPE TABLE OF SFLIGHT WITH HEADER LINE.
START-OF-SELECTION.
SELECT * INTO CORRESPONDING FIELDS OF TABLE GT_SFLIGHT FROM SFLIGHT.
DESCRIBE TABLE GT_SFLIGHT LINES G_TOTAL.
LOOP AT GT_SFLIGHT.
G_CNT = G_CNT + 1.
PERFORM PROGRESS_INDICATOR USING G_CNT G_TOTAL ' PROGRESSING... '.
ENDLOOP.
WRITE 'SUCCESS'.
" END-OF-SELECTION
" START-OF-SELECTION에서 데이터를 읽어봐 END-OF-SELECTION에서 데이터를 화면에 뿌려줌
DATA: GS_STR TYPE SCARR,
GT_ITAB TYPE TABLE OF SCARR.
START-OF-SELECTION.
SELECT * INTO CORRESPONDING FIELDS OF TABLE GT_ITAB FROM SCARR.
END-OF-SELECTION.
LOOP AT GT_ITAB INTO GS_STR.
WRITE: / GS_STR-CARRID, GS_STR-CARRNAME.
ENDLOOP.
FORM PROGRESS_INDICATOR USING VALUE(P_CUR) VALUE(P_TOTAL) VALUE(P_TEXT).
DATA: LV_TEXT(50) TYPE C, LV_IDX(3) TYPE N.
LV_IDX = ( P_CUR / P_TOTAL ) * 100.
CONCATENATE LV_IDX ' % : ' P_TEXT INTO LV_TEXT.
CALL FUNCTION
'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = LV_IDX
TEXT = LV_TEXT
EXCEPTIONS
OTHERS = 0.
ENDFORM.
조회 화면에서 조회 조건 입력 값을 입력한 후 사용자가 실행하면 데이터를 화면에 뿌려줌.
" TOP-OF-PAGE
" 글머리 작성하기
TOP-OF-PAGE.
WRITE: SY-TITLE, 60 'PAGE NO: ', SY-PAGNO.
ULINE.
WRITE: / 'ENJOY ABAP', SY-DATUM.
ULINE.
START-OF-SELECTION.
DO 50 TIMES.
WRITE / SY-INDEX.
ENDDO.
"END-OF-PAGE
"명시된 line-count, line-size를 넘어가면 수행
TOP-OF-PAGE.
WRITE: 'Top of Page'.
ULINE.
END-OF-PAGE.
ULINE.
WRITE: /30 'Page No:', SY-PAGNO.
START-OF-SELECTION.
DO 20 TIMES.
WRITE / SY-INDEX.
ENDDO.
START-OF-SELECTION.
WRITE 'FIRST LIST'.
FORMAT HOTSPOT ON COLOR 7.
WRITE : / 'CLICK THIS LINE'.
FORMAT HOTSPOT OFF COLOR OFF.
AT LINE-SELECTION.
WRITE: 'SECONDARY LIST '.
WRITE:/ 'SY-UCOMM =', SY-UCOMM.
" AT PF<NN>
" 키보드 f키 눌렀을 때 실행
START-OF-SELECTION.
WRITE 'Function Key Test PF5, PF6, PF7'.
AT PF5.
PERFORM WLIST.
AT PF6.
PERFORM WLIST.
AT PF7.
PERFORM WLIST.
FORM WLIST.
WRITE:
/ 'You selected below Function Key',
/ 'SY-UCOMM = ', SY-UCOMM.
ENDFORM.
GUI Status 생성(SET PF-STATUS)
[p.580]
- 표준 리포트 프로그램에서 제공하는 메뉴를 삭제하거나 기능을 추가
- ABAP프로그램 영역과 독립적으로 존재
- T-CODE:SE41에서 생성하여 화면에 동적으로 추가
- EXCLUDING옵션을 사용하여 메뉴 중 일부 비활성화 가능
" TOP-OF-PAGE DURING LINE-SELECTION
" 하위 페이지 HEADING 설정
TOP-OF-PAGE.
WRITE 'First List TOP-OF-PAGE'.
ULINE.
TOP-OF-PAGE DURING LINE-SELECTION.
WRITE 'SECONDARY LIST TOP-OF-PAGE'.
ULINE.
AT LINE-SELECTION.
PERFORM WRITE_LIST.
START-OF-SELECTION.
WRITE: 'DOUBLIE-CLICK THIS LINE'.
FORM WRITE_LIST.
WRITE: 'SECONDARY LIST',
/' SY-PFKEY:', SY-PFKEY.
ENDFORM.
DATA: GT_DATA TYPE TABLE OF SFLIGHT WITH HEADER LINE.
TOP-OF-PAGE.
WRITE:/50 'Report Format' CENTERED.
WRITE:/48 '------------------' CENTERED.
SKIP.
START-OF-SELECTION.
" 1번째 네모 블럭 위의 뚜껑과 양옆
WRITE:/(51) SY-ULINE, 53(68) SY-ULINE,
/ SY-VLINE NO-GAP, 51 SY-VLINE NO-GAP, 53 SY-VLINE NO-GAP, 120 SY-VLINE NO-GAP.
WRITE: 2(9) 'Report No' NO-GAP CENTERED, SY-VLINE NO-GAP.
WRITE: 12(9) '00001' NO-GAP CENTERED, SY-VLINE NO-GAP.
WRITE: 54(11) 'Report Date' NO-GAP CENTERED, SY-VLINE NO-GAP.
WRITE: 66(10) SY-DATUM NO-GAP CENTERED, 120 SY-VLINE NO-GAP.
WRITE:/(51) SY-ULINE, 53(68) SY-ULINE.
SKIP.