1.获取屏幕参数值 FUN: RS_SCRP_GET_SCREEN_INFOS
call function 'RS_SCRP_GET_SCREEN_INFOS' exporting dynnr = '1000' progname = 'ZSDA008_SO_HEADER' tables fieldlist = lt_field_list exceptions dynpro_does_not_exist = 1 no_field_list = 2 cancelled = 3 others = 4 . if sy-subrc <> 0. * implement suitable error handling here endif.
2.屏幕生成过程
lv_dynpro = sy-repid. lv_dynpro+40(4) = '0100'. lt_flow_logic-line = 'process before output.'. append lt_flow_logic. lt_flow_logic-line = 'module status_0100.'. append lt_flow_logic. lt_flow_logic-line = 'process after input.'. append lt_flow_logic. lt_flow_logic-line = 'module exit_screen at exit-command.'. append lt_flow_logic. lt_flow_logic-line = 'module user_command_0100.'. append lt_flow_logic. lt_flow_logic-line = 'process on value-request.'. append lt_flow_logic. lt_flow_logic-line = 'field tlow module t_low_help.'. append lt_flow_logic. syntax-check for dynpro lt_screen_header lt_field_list lt_flow_logic lt_attrib message lv_message_text line lv_screen_line word lv_incorrectword. if sy-subrc <> 0. endif. generate dynpro lt_screen_header lt_field_list lt_flow_logic lt_attrib id lv_dynpro message lv_message_text line lv_screen_line word lv_incorrectword. "#EC CI_GENERATE if sy-subrc <> 0. endif.
3.程序附件
ZEXP_SCREEN_TEST
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
![](https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif)
*&---------------------------------------------------------------------* *& Report ZEXP_SCREEN_TEST *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* report zexp_screen_test. tables:sscrfields. data:lv_message_text type string, lv_screen_line type string, lv_incorrectword type string, lv_fields type i, lv_max_length type i, ls_field_list type d021s, lt_field_list type table of d021s with header line, lt_flow_logic type table of d022s with header line, lt_screen_header type table of d020s with header line, ls_header type d020s, lv_dynpro type char44, lt_attrib type table of d023s with header line, lo_ref type ref to data, lo_line type ref to data, lt_fields type lvc_t_fcat, lt_fields_temp type lvc_t_fcat, ls_fields type lvc_s_fcat. data:begin of etab occurs 0, check type c, posnr type posnr, deflg type c, htetr like vbap-netwr, vbelv like likp-vbeln, sktxt type char50, rqtxt type char50, jsdat like sy-datum, zdays type posnr, hkdat like sy-datum, ysetr type netwr, bezei type char80, ernam type char15, erdat type datum, end of etab. field-symbols:<fs_tab> type any table, <fs> type any. data:tlow type vbeln_va, tlow1 type vbeln_vl, thigh type vbeln_va, thigh1 type vbeln_va, tpush type char10. "controls:imptb type tableview using screen 0100. start-of-selection. assign tlow to <fs>. perform build_screen_fields. lv_dynpro = sy-repid. lv_dynpro+40(4) = '0100'. lt_flow_logic-line = 'process before output.'. append lt_flow_logic. lt_flow_logic-line = 'module status_0100.'. append lt_flow_logic. lt_flow_logic-line = 'process after input.'. append lt_flow_logic. lt_flow_logic-line = 'module exit_screen at exit-command.'. append lt_flow_logic. lt_flow_logic-line = 'module user_command_0100.'. append lt_flow_logic. lt_flow_logic-line = 'process on value-request.'. append lt_flow_logic. lt_flow_logic-line = 'field tlow module t_low_help.'. append lt_flow_logic. syntax-check for dynpro lt_screen_header lt_field_l