【与AI+】英语day2——面向对象与报表
以下内容由AI生成

一、单词
| Class | /klæs/ | 类 |
| Object | /ˈɑːbdʒɪkt/ | 对象 |
| Instance | /ˈɪnstəns/ | 实例 |
| Method | /ˈmeθəd/ | 方法 |
| Constructor | /kənˈstrʌktər/ | 构造方法 |
| Attribute | /əˈtrɪbjuːt/ | 属性 |
| Parameter | /pəˈræmɪtər/ | 参数 |
| Inheritance | /ɪnˈherɪtəns/ | 继承 |
| Encapsulation | /ɪnˌkæpsjuˈleɪʃən/ | 封装 |
| Polymorphism | /ˌpɑːliˈmɔːrfɪzəm/ | 多态 |
| Interface | /ˈɪntərfeɪs/ | 接口 |
| Friend Class | /frend klæs/ | 朋友类 |
| Abstract Class | /ˈæbstrækt klæs/ | 抽象类 |
| Final Class | /ˈfaɪnl klæs/ | 最终类 |
| Static Attribute | /ˈstætɪk əˈtrɪbjuːt/ | 静态属性 |
| Singleton | /ˈsɪŋɡəltən/ | 单例 |
| Instantiation | /ɪnˌstænʃiˈeɪʃən/ | 实例化 |
| Reference Variable | /ˈrefrəns ˈveriəbl/ | 引用变量 |
| Casting | /ˈkæstɪŋ/ | 类型转换 |
| Event Handler | /ɪˈvent ˈhændlər/ | 事件处理程序 |
| Raising Event | /ˈreɪzɪŋ ɪˈvent/ | 触发事件 |
| ALV | /eɪ el viː/ | ALV 报表工具 |
| Grid | /ɡrɪd/ | 网格 |
| Container | /kənˈteɪnər/ | 容器 |
| Custom Container | /ˈkʌstəm kənˈteɪnər/ | 自定义容器 |
| Docking Container | /ˈdɑːkɪŋ kənˈteɪnər/ | 停靠容器 |
| Splitter Container | /ˈsplɪtər kənˈteɪnər/ | 分割容器 |
| Field Catalog | /fiːld ˈkætəlɔːɡ/ | 字段目录 |
| Layout | /ˈleɪaʊt/ | 布局 |
| Variant | /ˈveriənt/ | 变式 |
| Sorting | /ˈsɔːrtɪŋ/ | 排序 |
| Filter | /ˈfɪltər/ | 筛选 |
| Subtotal | /ˈsʌbtoʊtl/ | 小计 |
| Total | /ˈtoʊtl/ | 合计 |
| Toolbar | /ˈtuːlbɑːr/ | 工具栏 |
| Title Bar | /ˈtaɪtl bɑːr/ | 标题栏 |
| Function Code | /ˈfʌŋkʃən koʊd/ | 功能码 |
| User Command | /ˈjuːzər kəˈmænd/ | 用户命令 |
| Double Click | /ˈdʌbl klɪk/ | 双击 |
| Hotspot Click | /ˈhɑːtspɑːt klɪk/ | 热点点击 |
| Interactive Reporting | /ˌɪntərˈæktɪv rɪˈpɔːrtɪŋ/ | 交互式报表 |
| Color Coding | /ˈkʌlər ˈkoʊdɪŋ/ | 颜色编码 |
| Column Width | /ˈkɑːləm wɪdθ/ | 列宽 |
| Optimize Column | /ˈɑːptɪmaɪz ˈkɑːləm/ | 优化列宽 |
| Display Settings | /dɪˈspleɪ ˈsetɪŋz/ | 显示设置 |
| Print Settings | /prɪnt ˈsetɪŋz/ | 打印设置 |
| Excel Export | /ˈeksəl ˈekspɔːrt/ | 导出到 Excel |
| Pdf Export | /ˌpiː diː ˈef ˈekspɔːrt/ | 导出为 PDF |
| GUI Status | /ɡuːiː ˈsteɪtəs/ | GUI 状态 |
| GUI Title | /ɡuːiː ˈtaɪtl/ | GUI 标题 |
| Excluding Buttons | /ɪkˈskluːdɪŋ ˈbʌtənz/ | 排除按钮 |
| Appending Buttons | /əˈpendɪŋ ˈbʌtənz/ | 追加按钮 |
| Top-of-Page | /tɑːp əv peɪdʒ/ | 页眉 |
| End-of-Page | /end əv peɪdʒ/ | 页脚 |
| Event Handling | /ɪˈvent ˈhændlɪŋ/ | 事件处理 |
| Data Changed | /ˈdeɪtə tʃeɪndʒd/ | 数据变更 |
| Hotspot Click | /ˈhɑːtspɑːt klɪk/ | 热点点击 |
| Toolbar Button | /ˈtuːlbɑːr ˈbʌtən/ | 工具栏按钮 |
| Context Menu | /ˈkɑːntekst ˈmenjuː/ | 上下文菜单 |
| F4 Help | /ef fɔːr help/ | 搜索帮助 |
| Cell Editing | /sel ˈedɪtɪŋ/ | 单元格编辑 |
| Checkbox | /ˈtʃekbɑːks/ | 复选框 |
| Radio Button | /ˈreɪdioʊ ˈbʌtən/ | 单选按钮 |
| Drop-down List | /ˈdrɑːp daʊn lɪst/ | 下拉列表 |
| Color Attribute | /ˈkʌlər əˈtrɪbjuːt/ | 颜色属性 |
| Cell Color | /sel ˈkʌlər/ | 单元格颜色 |
| Row Color | /roʊ ˈkʌlər/ | 行颜色 |
| Column Color | /ˈkɑːləm ˈkʌlər/ | 列颜色 |
| Emphasize Column | /ˈemfəsaɪz ˈkɑːləm/ | 强调列 |
| Technical Field Name | /ˈteknɪkl fiːld neɪm/ | 技术字段名 |
| Output Length | /ˈaʊtpʊt leŋθ/ | 输出长度 |
| Decimals | /ˈdesɪmlz/ | 小数位数 |
| Currency Field | /ˈkɜːrənsi fiːld/ | 货币字段 |
| Quantity Field | /ˈkwɑːntəti fiːld/ | 数量字段 |
| Unit Field | /juːnɪt fiːld/ | 单位字段 |
| Edit Mask | /ˈedɪt mæsk/ | 编辑掩码 |
| Conversion Exit | /kənˈvɜːrʒən ˈeksɪt/ | 转换出口 |
| Hotspot | /ˈhɑːtspɑːt/ | 热点 |
| Light Column | /laɪt ˈkɑːləm/ | 信号灯列 |
| Exception Column | /ɪkˈsepʃən ˈkɑːləm/ | 异常列 |
| Sum | /sʌm/ | 求和 |
| Average | /ˈævərɪdʒ/ | 平均值 |
| Minimum | /ˈmɪnɪməm/ | 最小值 |
| Maximum | /ˈmæksɪməm/ | 最大值 |
| Index | /ˈɪndeks/ | 索引 |
| Key | /kiː/ | 键 |
| Refresh | /rɪˈfreʃ/ | 刷新 |
| Stable | /ˈsteɪbl/ | 稳定的 |
| Performance | /pərˈfɔːrməns/ | 性能 |
| Memory Consumption | /ˈmeməri kənˈsʌmpʃən/ | 内存消耗 |
| Display Mode | /dɪˈspleɪ moʊd/ | 显示模式 |
| Edit Mode | /ˈedɪt moʊd/ | 编辑模式 |
| Read-only | /riːd ˈoʊnli/ | 只读 |
| Selection Mode | /sɪˈlekʃən moʊd/ | 选择模式 |
| Line Selection | /laɪn sɪˈlekʃən/ | 行选择 |
| Column Selection | /ˈkɑːləm sɪˈlekʃən/ | 列选择 |
| Cell Selection | /sel sɪˈlekʃən/ | 单元格选择 |
| OOP ALV | /oʊ oʊ piː eɪ el viː/ | 面向对象 ALV |
| CL_GUI_ALV_GRID | /siː el ɡuːiː eɪ el viː ɡrɪd/ | ALV 网格类 |
| CL_SALV_TABLE | /siː el sælv ˈteɪbl/ | SALV 模型类 |
| CL_GUI_CUSTOM_CONTAINER | /siː el ɡuːiː ˈkʌstəm kənˈteɪnər/ | 自定义容器类 |
| CL_GUI_SPLITTER_CONTAINER | /siː el ɡuːiː ˈsplɪtər kənˈteɪnər/ | 分割容器类 |
| LVC_S_FCAT | /el viː siː es ef kæt/ | ALV 字段目录结构 |
| LVC_S_LAYO | /el viː siː es leɪoʊ/ | ALV 布局结构 |
| LVC_S_STYL | /el viː siː es staɪl/ | ALV 样式结构 |
二、短语
| Create an instance of the ALV grid class | "创建 ALV 网格类的实例" |
| Set the layout structure for the ALV | "为 ALV 设置布局结构" |
| Build the field catalog dynamically | "动态构建字段目录" |
| Handle the double click event | "处理双击事件" |
| Refresh the ALV display after data change | "数据变更后刷新 ALV 显示" |
| Register an event handler method | "注册事件处理方法" |
| Pass the internal table to the ALV grid | "将内表传递给 ALV 网格" |
| Exclude standard toolbar buttons | "排除标准工具栏按钮" |
| Set the output table for display | "设置要显示的输出内表" |
| Define a custom container on the screen | "在屏幕上定义一个自定义容器" |
三、对话
Q: What is the advantage of using OO ALV over classical ALV?
A: OO ALV offers better encapsulation, more flexibility for event handling, and is easier to integrate into complex OOP screens compared to function module ALV.
问:使用面向对象 ALV 比经典 ALV 有什么优势?
答:与函数模块 ALV 相比,OO ALV 提供了更好的封装性、更灵活的事件处理,并且更容易集成到复杂的面向对象屏幕中。
Q: Which main classes are used to create an OO ALV report?
A: The main classes are CL_GUI_CUSTOM_CONTAINER to hold the ALV, and CL_GUI_ALV_GRID itself. Sometimes we use CL_GUI_SPLITTER_CONTAINER for split screens.
问:创建 OO ALV 报表主要使用哪些类?
答:主要的类是用于容纳 ALV 的 CL_GUI_CUSTOM_CONTAINER 和 ALV 网格本身 CL_GUI_ALV_GRID。有时我们也会使用 CL_GUI_SPLITTER_CONTAINER 来分割屏幕。
Q: How do you build the field catalog for an OO ALV grid?
A: You can either build it manually by populating an internal table of type LVC_T_FCAT, or call method 'GET_FIELDCATALOG' from a reference structure. The manual way gives more control.问:你如何为 OO ALV 网格构建字段目录?
答:你可以通过填充类型为 LVC_T_FCAT 的内表手动构建,或者从参考结构调用方法 'GET_FIELDCATALOG'。手动方式提供了更多控制。
Q: How do you handle the 'double click' event in OO ALV?
A: First, I set a handler class with a method for the event. Then I register this handler method using 'SET_HANDLER' for the grid instance. When the user double-clicks, the method is triggered.
问:在 OO ALV 中如何处理双击事件?
答:首先,我设置一个处理类,其中包含处理该事件的方法。然后我使用 'SET_HANDLER' 为该网格实例注册这个处理方法。当用户双击时,该方法就会被触发。
Q: What is the difference between 'REFRESH_TABLE_DISPLAY' and 'SET_TABLE_FOR_FIRST_DISPLAY'?
A: 'SET_TABLE_FOR_FIRST_DISPLAY' is called once to initialize the ALV with data and settings. 'REFRESH_TABLE_DISPLAY' is used after modifying the data internally to update the screen without re-initializing everything.
问:'REFRESH_TABLE_DISPLAY' 和 'SET_TABLE_FOR_FIRST_DISPLAY' 有什么区别?
答:'SET_TABLE_FOR_FIRST_DISPLAY' 只调用一次,用于初始化 ALV 的数据和设置。'REFRESH_TABLE_DISPLAY' 用于在内部修改数据后刷新屏幕显示,而无需重新初始化所有内容。
Q: How can you change the color of a specific row in OO ALV?
A: You need to add a special field to your output internal table, usually of type LVC_T_SCOL. You fill this field with the desired color code for the row, and then set a corresponding layout structure field 'COLORTAB' to 'X'.
问:如何在 OO ALV 中改变特定行的颜色?
答:你需要向输出内表中添加一个特殊字段,通常是 LVC_T_SCOL 类型。用所需的行颜色代码填充这个字段,然后设置对应的布局结构字段 'COLORTAB' 为 'X'。
Q: What is the purpose of the layout structure 'LVC_S_LAYO'?
A: It controls the overall appearance of the ALV grid, such as zebra pattern, column width optimization, title bar text, and whether to display totals or subtotals.
问:布局结构 'LVC_S_LAYO' 的作用是什么?
答:它控制 ALV 网格的整体外观,例如斑马纹、列宽优化、标题栏文本,以及是否显示合计或小计。
Q: Can you explain how to add a custom button to the ALV toolbar?
A: Yes. You handle the event 'TOOLBAR' of the ALV grid. In the event method, you append a button of type 'TB_BUTTON' to the event parameter 'E_OBJECT'->MT_TOOLBAR, setting the function code and icon.
问:你能解释一下如何向 ALV 工具栏添加自定义按钮吗?
答:是的。你需要处理 ALV 网格的 'TOOLBAR' 事件。在事件方法中,向事件参数 'E_OBJECT'->MT_TOOLBAR 追加一个 'TB_BUTTON' 类型的按钮,设置好功能码和图标。
Q: How do you make a column editable in OO ALV?
A: In the field catalog, you set the 'EDIT' flag to 'X' for the specific column. You may also need to set the layout 'EDIT' flag to 'X' to enable global editing mode.
问:如何在 OO ALV 中使某一列可编辑?
答:在字段目录中,将特定列的 'EDIT' 标志设置为 'X'。可能还需要将布局的 'EDIT' 标志设置为 'X' 以启用全局编辑模式。
Q: What is the SALV model and how is it different from CL_GUI_ALV_GRID?
A: SALV is a simpler, more modern OO ALV model based on the 'Thin Model' concept (CL_SALV_TABLE). It requires less coding for basic reports compared to CL_GUI_ALV_GRID, though CL_GUI_ALV_GRID offers more low-level control for complex customizations.问:什么是 SALV 模型?它与 CL_GUI_ALV_GRID 有何不同?
答:SALV 是一个基于"瘦模型"概念 (CL_SALV_TABLE) 的更简单、更现代的 OO ALV 模型。对于基本报表,与 CL_GUI_ALV_GRID 相比,它需要的编码更少,尽管 CL_GUI_ALV_GRID 为复杂的定制提供了更底层的控制。
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐
所有评论(0)