제공해주신소스를 바탕으로 작성했는데 똑같이..
그런데 실행할려니 아래의 두가지 오류가 뜨네요.
1.
SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE itab.
이문장을 실행할수 없다고 하네요. 두번째 그림에 영어로 에러내용이 보입니다.
2 첫번째 그림의 오류가 뜹니다. screen 100를 실행하니...
screen 100의 로직입니다.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
MODULE fil_table_control.
PROCESS AFTER INPUT.
MODULE cancel.
MODULE read_table_control.
MODULE USER_COMMAND_0100.
보시고 원인과 해결방법 부탁합니다.
혹 해결하는 도움이 될까 해서 작업하는 화면을 캡쳐해서 보여드립니다.
하기 쉽지 않네요. 처음하는 부분이 어렵고 세부적인 부분이 없이 많이 해깔리고 해맸습니다.
<작성소스>
*&---------------------------------------------------------------------*
*& Module Pool Z16_002
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
PROGRAM z16_002.
CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
DATA: okcode TYPE sy-ucomm,
save_ok TYPE sy-ucomm.
DATA: itab TYPE TABLE OF demo_conn,
fill TYPE i.
TABLES demo_conn.
DATA: line TYPE i,
limit TYPE i.
SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE itab.
CALL SCREEN 100.
*----------------------------------------------------------------------*
* MODULE status_0100 OUTPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
DESCRIBE TABLE itab LINES fill.
flight-lines = fill.
ENDMODULE. "status_0100 OUTPUT
*----------------------------------------------------------------------*
* MODULE fil_table_control OUTPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE fil_table_control OUTPUT.
READ TABLE itab INTO demo_conn INDEX flight-current_line.
ENDMODULE. "fil_table_control OUTPUT
*----------------------------------------------------------------------*
* MODULE cancel INPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE. "cancel INPUT
*----------------------------------------------------------------------*
* MODULE read_table_control INPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE read_table_control INPUT.
lines = sy-loopc.
MODIFY itab FROM demo_conn INDEX flights-current_line.
ENDMODULE. "read_table_control INPUT
*----------------------------------------------------------------------*
* MODULE user_command_0100 INPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'NEXT_LINE'.
flight-top_line = flight-top_line + 1.
limit = fill - lines + 1.
IF flights-top_line > limit.
flights-top_line = limit.
ENDIF.
WHEN 'PREV_LINE'.
flight-top_line = flight-top_line - 1.
IF flights-top_line < 0.
flights-top_line = 0.
ENDIF.
WHEN 'NEXT_PAGE'.
flight-top_line = flight-top_line + lines.
limit = fill - lines + 1.
IF flights-top_line > limit.
flights-top_line = limit.
ENDIF.
WHEN 'PREV_PAGE'.
flight-top_line = flight-top_line - lines.
IF flights-top_line < 0.
flights-top_line = 0.
ENDIF.
WHEN 'LAST_PAGE'.
flight-top_line = fill - lines + 1.
WHEN 'FIRST_PAGE'.
flight-top_line = 0.
ENDCASE.
ENDMODULE. "read_table_control INPUT
전부 오타 문제 입니다. 소스를 그대로 사용하거나, 아니면 활성화 하면서 하나씩 찾아보세요.
밑에 영문에 다 나옵니다.
님의 소스를 변경한 것입니다. 참고하세요.
PROGRAM z16_002.
CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm.
DATA: itab TYPE TABLE OF demo_conn,
fill TYPE i.
TABLES demo_conn.
DATA: line TYPE i,
limit TYPE i.
SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE itab.
CALL SCREEN 100.
*----------------------------------------------------------------------*
* MODULE status_0100 OUTPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
DESCRIBE TABLE itab LINES fill.
flights-lines = fill.
ENDMODULE. "status_0100 OUTPUT
*----------------------------------------------------------------------*
* MODULE fil_table_control OUTPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE fil_table_control OUTPUT.
READ TABLE itab INTO demo_conn INDEX flights-current_line.
ENDMODULE. "fil_table_control OUTPUT
*----------------------------------------------------------------------*
* MODULE cancel INPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE. "cancel INPUT
*----------------------------------------------------------------------*
* MODULE read_table_control INPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE read_table_control INPUT.
line = sy-loopc.
MODIFY itab FROM demo_conn INDEX flights-current_line.
ENDMODULE. "read_table_control INPUT
*----------------------------------------------------------------------*
* MODULE user_command_0100 INPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'NEXT_LINE'.
flights-top_line = flights-top_line + 1.
limit = fill - line + 1.
IF flights-top_line > limit.
flights-top_line = limit.
ENDIF.
WHEN 'PREV_LINE'.
flights-top_line = flights-top_line - 1.
IF flights-top_line < 0.
flights-top_line = 0.
ENDIF.
WHEN 'NEXT_PAGE'.
flights-top_line = flights-top_line + line.
limit = fill - line + 1.
IF flights-top_line > limit.
flights-top_line = limit.
ENDIF.
WHEN 'PREV_PAGE'.
flights-top_line = flights-top_line - line.
IF flights-top_line < 0.
flights-top_line = 0.
ENDIF.
WHEN 'LAST_PAGE'.
flights-top_line = fill - line + 1.
WHEN 'FIRST_PAGE'.
flights-top_line = 0.
ENDCASE.
ENDMODULE. "read_table_control INPUT