CONTROL:ZPLM
屏幕结构:STR
LISTBOX:STR-DOKAR
内表数据:ITAB
利用PROCESS ON VALUE-REQUEST来给LISTBOX赋值
REPORT ZTEST.
TYPE-POOLS VRM.
CONTROLS:ZPLM TYPE TABLEVIEW USING SCREEN '0100'.
***内表
DATA:BEGIN OF ITAB OCCURS 0,
DOKNR TYPE DOKNR,
DOKAR TYPE DOKAR,
END OF ITAB.
DATA:BEGIN OF WA,
DOKAR TYPE DOKAR,
END OF WA,
ITAB1 LIKE STANDARD TABLE OF WA.
***屏幕结构
DATA:STR LIKE ITAB.
***取数
SELECT DOKNR INTO TABLE ITAB FROM DRAW UP TO 10 ROWS.
SELECT DOKAR INTO TABLE ITAB1 FROM TDWA.
CALL SCREEN 100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'MAIN'.
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module READ_TABLE INPUT
*&---------------------------------------------------------------------*
MODULE READ_TABLE INPUT.
MODIFY ITAB FROM STR INDEX ZPLM-CURRENT_LINE.
ENDMODULE. " READ_TABLE INPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.
DATA:OK_CODE LIKE SY-UCOMM,
SAVE_OK LIKE OK_CODE.
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*---------------------------------------------------------------------*
* MODULE SET_LISTBOX INPUT
*---------------------------------------------------------------------*
MODULE SET_LISTBOX INPUT.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'DOKAR'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = ITAB1
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
ENDMODULE. "SET_LISTBOX INPUT
100屏幕的逻辑流
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
LOOP AT ITAB INTO STR WITH CONTROL ZPLM.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP AT ITAB.
MODULE READ_TABLE.
ENDLOOP.
MODULE USER_COMMAND_0100.
PROCESS ON VALUE-REQUEST.
FIELD STR-DOKAR MODULE SET_LISTBOX.
阅读(529) | 评论(0) | 转发(0) |