맨 아래 소스를 실행한 후 결과를 보니 아무 테이타가 나오지 않네요.
con1이라는 컨트롤도 만들고 이름도 con1로 지정했습니다.
*&---------------------------------------------------------------------*
*& Module INIT_CON OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE INIT_CON OUTPUT.
CREATE OBJECT CON1_REF
EXPORTING CONTAINER_NAME = 'CON1'.
CREATE OBJECT GRID1
EXPORTING
I_PARENT = CON1_REF.
ENDMODULE. " INIT_CON OUTPUT
위 내용에 뭔가 빠진것 같기도 하고..
SET_TABLE_FOR_FIRST_DISPLAY 메소드를 넣어야 되는것으로 아는데
어떻게 하는지 몰라서요. 제가 잘 못 알고 있으면 다른 방법으로 알려주세요.
해결방법을 기다리겠습니다.
아래 내용은 참고할 전체소스입니다.
REPORT Z_PUR_DELI NO STANDARD PAGE HEADING
LINE-SIZE 170
LINE-COUNT 70
MESSAGE-ID ZMSY.
TABLES: EKKO, EKPO, T024E, T024, LFA1, MAKT.
DATA: BEGIN OF ITAB OCCURS 0,
EBELN LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
BEDAT LIKE EKKO-BEDAT,
EKORG LIKE EKKO-EKORG,
EKOTX LIKE T024E-EKOTX,
EKGRP LIKE EKKO-EKGRP,
EKNAM LIKE T024-EKNAM,
LIFNR LIKE EKKO-LIFNR,
NAME1 LIKE LFA1-NAME1,
MATNR LIKE EKPO-MATNR,
MENGE LIKE EKPO-MENGE,
ELIKZ LIKE EKPO-ELIKZ,
END OF ITAB.
DATA : CON1_REF TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
DATA : GRID1 TYPE REF TO CL_GUI_ALV_GRID.
DATA: OK_CODE TYPE SY-UCOMM.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS: P_BUKRS TYPE EKKO-BUKRS.
SELECT-OPTIONS: P_EKORG FOR EKKO-EKORG,
P_EKGRP FOR EKKO-EKGRP,
P_BEDAT FOR EKKO-BEDAT.
SELECTION-SCREEN END OF BLOCK B1.
*&---------------------------------------------------------------------*
*& INITIALIZATION.
*&---------------------------------------------------------------------*
INITIALIZATION.
P_BEDAT-SIGN = 'I'.
P_BEDAT-OPTION = 'BT'.
P_BEDAT-HIGH = SY-DATUM.
APPEND P_BEDAT.
*&---------------------------------------------------------------------*
*& START-OF-SELECTION
*&---------------------------------------------------------------------*
START-OF-SELECTION.
IF P_BUKRS EQ SPACE.
MESSAGE I001(00) WITH '회사코드값을 입력하세요.'.
EXIT.
ENDIF.
IF P_EKORG EQ SPACE.
MESSAGE I001(00) WITH '구매조직값을 입력하세요.'.
EXIT.
ENDIF.
IF P_EKGRP EQ SPACE.
MESSAGE I001(00) WITH '구매그룹값을 입력하세요.'.
EXIT.
ENDIF.
IF P_BEDAT EQ SPACE.
MESSAGE I001(00) WITH '발주일값을 입력하세요.'.
EXIT.
ENDIF.
SELECT PO~EBELN PO~EBELP KO~BEDAT KO~EKORG TE~EKOTX
KO~EKGRP T~EKNAM KO~LIFNR L~NAME1 PO~MATNR
M~MAKTX PO~MENGE PO~ELIKZ
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM ( ( ( ( ( EKPO AS PO INNER JOIN EKKO AS KO
ON PO~EBELN = KO~EBELN )
INNER JOIN T024E AS TE
ON KO~EKORG = TE~EKORG )
INNER JOIN T024 AS T
ON KO~EKGRP = T~EKGRP )
INNER JOIN LFA1 AS L
ON KO~LIFNR = L~LIFNR )
INNER JOIN MAKT AS M
ON PO~MATNR = M~MATNR )
WHERE KO~LOEKZ EQ ' '.
CALL SCREEN 100.
IF NOT ITAB[] IS INITIAL.
LOOP AT ITAB.
WRITE: / ITAB-EBELN,
ITAB-EBELP,
ITAB-BEDAT,
ITAB-EKORG,
ITAB-EKOTX,
ITAB-EKGRP,
ITAB-EKNAM,
ITAB-LIFNR,
ITAB-NAME1,
ITAB-MATNR,
ITAB-MENGE,
ITAB-ELIKZ.
ULINE.
ENDLOOP.
ELSE.
MESSAGE I001 WITH '데이터가 존재하지 않습니다.'.
ENDIF.
END-OF-SELECTION.
*&---------------------------------------------------------------------*
*& TOP-OF-PAGE
*&---------------------------------------------------------------------*
TOP-OF-PAGE.
FORMAT COLOR COL_HEADING INTENSIFIED OFF.
ULINE.
WRITE:/ '구매납품완료 실적조회결과' CENTERED.
ULINE.
* SKIP 1.
FORMAT RESET.
END-OF-PAGE.
*&---------------------------------------------------------------------*
*& Module INIT_CON OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE INIT_CON OUTPUT.
CREATE OBJECT CON1_REF
EXPORTING CONTAINER_NAME = 'CON1'.
CREATE OBJECT GRID1
EXPORTING
I_PARENT = CON1_REF.
ENDMODULE. " INIT_CON OUTPUT
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'G100'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
WHEN 'BACK' OR 'CANC' OR 'EXIT'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
아래 구문은 없네요.
최소한 아래의 CHANGING 에 있는 값은 넘겨줘야 합니다.
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
CHANGING
IT_OUTTAB = '출력할 인터널테이블'
IT_FIELDCATALOG = '필드카탈로그'.