SAP 实例 10 List Box with value list from input help
*&---------------------------------------------------------------------*
*& Report DEMO_DROPDOWN_LIST_BOX *
*&---------------------------------------------------------------------* REPORT demo_dropdown_list_box. * Dynpro Interfaces TABLES sdyn_conn.
DATA ok_code TYPE sy-ucomm. * Local class definition CLASS dynpro_utilities DEFINITION.
PUBLIC SECTION.
CLASS-METHODS value_help.
ENDCLASS. * Local class implementation CLASS dynpro_utilities IMPLEMENTATION.
METHOD value_help.
TYPES: BEGIN OF carrid_line,
carrid TYPE spfli-carrid,
carrname TYPE scarr-carrname,
END OF carrid_line.
DATA carrid_list TYPE STANDARD TABLE OF carrid_line.
SELECT carrid, carrname
FROM scarr
INTO CORRESPONDING FIELDS OF TABLE @carrid_list.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CARRID'
value_org = 'S'
TABLES
value_tab = carrid_list
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
...
ENDIF.
ENDMETHOD.
ENDCLASS. * Event Blocks and Dialog Modules START-OF-SELECTION.
CALL SCREEN 100. MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
ENDMODULE. MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE. MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'SELECTED'.
MESSAGE i888(sabapdemos) WITH sdyn_conn-carrid.
ENDCASE.
ENDMODULE. MODULE create_dropdown_box INPUT.
dynpro_utilities=>value_help( ).
ENDMODULE.
Description
The static dynpro number of dynpro 100 is 100. The screen contains a single input field, namely the component SDYN_CONN-CARRID. Its attribute dropdown is "Listbox", the output length is 20, the attribute value list is empty, and it is assigned function code SELECTED. The functions BACK, EXIT, and CANCEL are defined in the GUI status with the function type E. The screen flow logic is as follows:
- PROCESS BEFORE OUTPUT.
MODULE status_0100.
PROCESS AFTER INPUT.
MODULE cancel AT EXIT-COMMAND.
MODULE user_command_0100.
PROCESS ON VALUE-REQUEST.
FIELD sdyn_conn-carrid MODULE create_dropdown_box.
The user is not allowed to enter values in the screen field. When the user selects the input field on dynpro 100, the system displays a list box. The Value list attribute is empty, so the system launches the input mechanism. In this case, the event block PROCESS ON VALUE-REQUEST is defined in the screen flow logic which overrides all other mechanisms. The system fills a two-column internal table in the corresponding dialog module and passes it to the input help using the function module F4IF_INT_TABLE_VALUE_REQUEST. The system inserts the two columns of the table into the list box.
If the user chooses a row from the list box, the event PAI is triggered with the function code SELECTED, and the value in the first column of the internal table is copied to the input field.
最新文章
- Front End Developer Questions 前端开发人员问题(三)JavaScript部分
- UIView的setNeedsDisplay和setNeedsLayout
- Apache Server Status主机状态查看
- org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter与org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
- iOS之通过PaintCode快速实现交互动画的最方便方法 未解问题
- MyEclipse无法启动调试:Cannot connect to VM
- js运动 多物体运动含Json 但是里面数值不一样
- C++学习笔记(九):作用域和命名空间
- 重大发现Android studio 如何简单快速修改package name
- asp.net 后台使用js弹窗失效问题
- 运用Unity实现AOP拦截器
- 蓝桥杯-加法变乘法-java
- 苹果新的编程语言 Swift 语言进阶(十五)--协议
- ASP.NET MVC]WebAPI应用支持HTTPS的经验总结
- Django content-type 使用
- java操作elasticsearch实现基本的增删改查操作
- sql server字符串的类型
- 名字&;值
- linux下查看当前登陆的用户数目
- SAS8.1安装步骤(附图)