下面介绍一个不常用的ABAP函数 BKK_POPUP_DISPLAY_LIST,看函数名字就知道,这个函数可以弹出个窗口并在窗口中显示list。
例子代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
REPORT ztest_output_table. DATA: return LIKE rsnewleng-fcode. DATA: BEGIN OF itab OCCURS 0, posnr(6), ettyp(10), END OF itab. itab-posnr = 1. itab-ettyp = 'aa'. APPEND itab. itab-posnr = 2. itab-ettyp = 'bb'. APPEND itab. CALL FUNCTION 'BKK_POPUP_DISPLAY_LIST' EXPORTING i_callback_program = sy-repid "程序名 i_callback_write_form = 'FRM_WRITE_CONTENTS' "输出表内容的form名 i_title = 'test' i_start_column = 25 i_start_row = 15 i_end_column = 60 i_end_row = 20 IMPORTING answer = return. *&---------------------------------------------------------------------* *& Form frm_write_contents *&---------------------------------------------------------------------* FORM frm_write_contents. LOOP AT itab. WRITE : / itab-posnr,' ',itab-ettyp . ENDLOOP. ENDFORM. "l_server_info_contents |
显示结果:
以上。
发表评论