REPORT zparmeters1. TYPE-POOLS:slis. TABLES vbak. SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001. PARAMETER p1 TYPE char1 AS CHECKBOX USER-COMMAND flag. PARAMETER p2 TYPE char10. PARAMETER p3 TYPE char1 RADIOBUTTON GROUP g1 MODIF ID f1. PARAMETER p4 TYPE char1 RADIOBUTTON GROUP g1 MODIF ID f1. PARAMETER p5 TYPE char1 RADIOBUTTON GROUP g1 MODIF ID f1. PARAMETER p6 TYPE char1 RADIOBUTTON GROUP g2 MODIF ID f1. PARAMETER p7 TYPE char1 RADIOBUTTON GROUP g2 MODIF ID f1. SELECTION-SCREEN END OF BLOCK b1. SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001. PARAMETER p8 TYPE string VISIBLE LENGTH 20. PARAMETER p9 TYPE char5 AS LISTBOX VISIBLE LENGTH 10. PARAMETER p10 TYPE char12 MATCHCODE OBJECT user_comp. SELECT-OPTIONS p11 FOR vbak-vbeln NO INTERVALS DEFAULT 10 TO 20. SELECTION-SCREEN END OF BLOCK b2. *屏幕初始值 INITIALIZATION. *界面显示后的事件 AT SELECTION-SCREEN OUTPUT. LOOP AT SCREEN. IF p1 = ''. IF screen-group1 = 'F1'. screen-active = 0. MODIFY SCREEN. ENDIF. ENDIF. ENDLOOP. START-OF-SELECTION. PERFORM getdata. *&---------------------------------------------------------------------* *& Form GETDATA *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM getdata . DATA tables TYPE TABLE OF ztcategory. "数据字典分类表 DATA layout TYPE slis_layout_alv. "Layout布局对象 DATA wa TYPE slis_fieldcat_alv. "字段对象 DATA list TYPE TABLE OF slis_fieldcat_alv."字段集合 SELECT * INTO CORRESPONDING FIELDS OF TABLE tables FROM ztcategory ORDER BY zeid ASCENDING. wa-key = 'x'."是否是主键 wa-fieldname = 'ZEID'."编号 wa-ref_fieldname = 'ZEID'. "参考字段编号 wa-ref_tabname = 'ZTCATEGORY'. "参考数据表 wa-seltext_m = '编号'. wa-just = 'C'. APPEND wa TO list. CLEAR wa. wa-fieldname = 'ZECREATEDATE'."创建日期 wa-ref_fieldname = 'ZECREATEDATE'. "参考字段 wa-ref_tabname = 'ZTCATEGORY'. "参考数据表 wa-seltext_m = '创建日期'. APPEND wa TO list. wa-fieldname = 'ZECREATETIME'."创建时间 wa-ref_fieldname = 'ZECREATETIME'. wa-ref_tabname = 'ZTCATEGORY'. wa-seltext_m = '创建时间'. APPEND wa TO list. wa-fieldname = 'ZECODE'. wa-ref_fieldname = 'ZECODE'. wa-ref_tabname = 'ZTCATEGORY'. wa-seltext_m = '状态码'. wa-just = 'C'. APPEND wa TO list. wa-fieldname = 'ZECATNAME'. wa-ref_fieldname = 'ZECATNAME'. wa-ref_tabname = 'ZTCATEGORY'. wa-seltext_m = '分类名称'. wa-just = 'L'. APPEND wa TO list. wa-fieldname = 'ZESORT'. wa-ref_fieldname = 'ZESORT'. wa-ref_tabname = 'ZTCATEGORY'. wa-seltext_m = '数字排序'. wa-just = 'C'. APPEND wa TO list. wa-fieldname = 'ZESTATUS'. wa-ref_fieldname = 'ZESTATUS'. wa-ref_tabname = 'ZTCATEGORY'. wa-seltext_m = '当前状态'. wa-just = 'L'. APPEND wa TO list. wa-fieldname = 'ZEREMARK'. wa-ref_fieldname = 'ZEREMARK'. wa-ref_tabname = 'ZTCATEGORY'. wa-seltext_m = '描述说明'. wa-just = 'L'. APPEND wa TO list. wa-fieldname = 'ZECONTENT'. wa-ref_fieldname = 'ZECONTENT'. wa-ref_tabname = 'ZTCATEGORY'. wa-seltext_m = '状态描述'. wa-just = 'L'. APPEND wa TO list. *=================================================================== layout-zebra = 'X'. layout-colwidth_optimize = 'X'. layout-detail_popup = 'X'. layout-colwidth_optimize = 'X'. layout-detail_titlebar = '客户状态分类详细'. layout-f2code = '&ETA'. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING * I_INTERFACE_CHECK = ' ' * I_BYPASSING_BUFFER = ' ' * I_BUFFER_ACTIVE = ' ' I_CALLBACK_PROGRAM = sy-repid * I_CALLBACK_PF_STATUS_SET = ' ' * I_CALLBACK_USER_COMMAND = ' ' * I_CALLBACK_TOP_OF_PAGE = ' ' * I_CALLBACK_HTML_TOP_OF_PAGE = ' ' * I_CALLBACK_HTML_END_OF_LIST = ' ' * I_STRUCTURE_NAME = * I_BACKGROUND_ID = ' ' * I_GRID_TITLE = * I_GRID_SETTINGS = IS_LAYOUT = layout IT_FIELDCAT = list * IT_EXCLUDING = * IT_SPECIAL_GROUPS = * IT_SORT = * IT_FILTER = * IS_SEL_HIDE = * I_DEFAULT = 'X' * I_SAVE = ' ' * IS_VARIANT = * IT_EVENTS = * IT_EVENT_EXIT = * IS_PRINT = * IS_REPREP_ID = * I_SCREEN_START_COLUMN = 0 * I_SCREEN_START_LINE = 0 * I_SCREEN_END_COLUMN = 0 * I_SCREEN_END_LINE = 0 * I_HTML_HEIGHT_TOP = 0 * I_HTML_HEIGHT_END = 0 * IT_ALV_GRAPHICS = * IT_HYPERLINK = * IT_ADD_FIELDCAT = * IT_EXCEPT_QINFO = * IR_SALV_FULLSCREEN_ADAPTER = * IMPORTING * E_EXIT_CAUSED_BY_CALLER = * ES_EXIT_CAUSED_BY_USER = TABLES t_outtab = tables * EXCEPTIONS * PROGRAM_ERROR = 1 * OTHERS = 2 . IF sy-subrc <> 0. * Implement suitable error handling here ENDIF. ENDFORM. " GETDATA
标签:SELECTION,char1,TYPE,SCREEN,选择,abap,MODIF,屏幕,PARAMETER From: https://www.cnblogs.com/hua900822/p/17267029.html