今天在用 F4IF_INT_TABLE_VALUE_REQUEST函数写选择屏幕的自定义帮助的时候,发现了个问题,那就是 F4IF_INT_TABLE_VALUE_REQUEST中参数value_tab中的数据类型必须是数据字典类型,否则,在选择屏幕中
按下F4后,内表中的内容不会显示出来。
1 REPORT Z_TEST. 2 3 DATA :F TYPE STR. 4 PARAMETERS: VAR TYPE str . 5 PARAMETERS: SEL(4) TYPE C. 6 AT SELECTION-SCREEN ON VALUE-REQUEST FOR VAR. 7 PERFORM SELECTION. 8 FORM SELECTION. 9 "这里的类型必须是数据字典类型,否则内表中的内容在选择屏幕中无法显示 10 DATA:BEGIN OF ITAB OCCURS 0, 11 COL1 TYPE char10 , 12 COL2 TYPE cHAR10 , 13 END OF ITAB. 14 DATA:FIELD_TAB TYPE DFIES OCCURS 0 WITH HEADER LINE. 15 16 DO 5 TIMES. 17 ITAB-COL1 = SY-INDEX. 18 ITAB-COL2 = SY-INDEX + 1. 19 APPEND ITAB. 20 ENDDO. 21 CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' 22 EXPORTING 23 * DDIC_STRUCTURE = ' ' 24 RETFIELD = 'COL1' 25 * PVALKEY = ' ' 26 DYNPPROG = SY-REPID 27 DYNPNR = SY-DYNNR 28 DYNPROFIELD = 'COL1' 29 * STEPL = 0 30 WINDOW_TITLE = 'WINDOW--TITLE' 31 * VALUE = '' 32 VALUE_ORG = 'S'“C表示cell,S表示structure 33 * MULTIPLE_CHOICE = 'X'"多项选择,用于SELECT-OPTIONS 34 * DISPLAY = 'F'"C则只能显示,不能选择 35 CALLBACK_PROGRAM = sy-repid 36 * CALLBACK_FORM = ' ' 37 * MARK_TAB = 38 * IMPORTING 39 * USER_RESET = 40 TABLES 41 VALUE_TAB = ITAB 42 * FIELD_TAB = FIELD_TAB 43 * RETURN_TAB = 44 * DYNPFLD_MAPPING = 45 EXCEPTIONS 46 PARAMETER_ERROR = 1 47 NO_VALUES_FOUND = 2 48 OTHERS = 3 49 . 50 IF SY-SUBRC <> 0. 51 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO 52 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. 53 ENDIF. 54 55 ENDFORM.
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/19696.html