当前位置:网站首页>ABAP语法学习(ALV)
ABAP语法学习(ALV)
2022-07-26 05:03:00 【月阴荒】
首先最常用的类组为:
TYPE-POOLS:SLIS.
这个类型组中有很多ALV的自定义数据类型以及结构化数据类型(通过TYPE来定义的,)是我们在写ALV表单的时候需要调用的。
其中常用的有:
我们写第一个ALV程序的基本流程如下:
第一步:定义将要用到的表,即TALBES定义部分,然后定义TYPE-POOLS:SLIS.
第二步:定义“1”中提到的这些数据类型或者内表的实体对象
第三步:定义一些需要用到的变量,比如我们常定义的有:
Data: w_repid like sy-repid, "ABAP程序,我们一般取当前程序
w_callback_ucomm type sils_formname, “字符型,功能
w_print type slis_print_alv, "类型组
w_layout type slis_layout_alv, "类型组
w_html_top_of_page type slis_formname, "字符型
w_fieldcat_alv like line of i_fieldcat_alv, “从上面的数据结构类型引用过来的
w_excluding like line of i_excluding, “同上
w_events like line of i_events, “同上
w_event_exit like line of i_event_exit, “同上
w_list_comments like line of i_list_comments.“同上
第四步: 定义自己的选择屏幕
第五步: 定义INITIALIZATION部分,在这个部分往往要指定w_repid的值, w_repid = sy-repid
第六步: start-of-selection部分
用一个子函数完成对ALV表单标题区域的赋值(i_list_comments)。
用一个子函数完成自己所需要数据的抓取
用一个子函数完成要显示列表的列名行(第一行)的相关赋值(i_fieldcat_alv)以及设置
用一个子函数完成输出格式的设置(i_layout),比如双击一条记录是否弹出对话框啊?是用哪个功能键触发等等
用一个子函数FORM DISPLAY_DATA来显示上面我们已经分别封装好的数据,需要调用两个常用的FUNCTION MODULE:
FUNCTION ‘REUSE_ALV_GRID_DISPLAY’ “用来显示表单数据
FUNCTION ‘REUSE_ALV_COMMENTARY_WRITE’ “用来显示表单标题
边栏推荐
猜你喜欢

Minipcie interface can card solves the problem of industrial computer expanding can channel minipcie can

【ACWing】2983. 玩具

Excel VBA:实现自动下拉填充公式至最后一行

地球系统模式(CESM)实践技术

域名解析过程全分析,就着文字理解更佳

提高shuffle操作中的reduce并行度

security权限管理详解
![[acwing] 1268. Simple questions](/img/f3/7eeae566dd74d77cf6f8b4640e4f29.png)
[acwing] 1268. Simple questions
![[mathematical modeling] basic knowledge of MATLAB](/img/b5/6bd507a149968931ab1c4644f2c08b.png)
[mathematical modeling] basic knowledge of MATLAB

Alibaba three sides: how to solve the problems of MQ message loss, duplication and backlog?
随机推荐
Unnamed Article 33
[wp][gwctf 2019] boring lottery
【Leetcode】493. Reverse Pairs
List converted to tree real use of the project
Teach you how to use code to realize SSO single sign on
webassembly 01基本资料
Several maturity levels of using MES management system
Five simple and practical daily development functions of chrome are explained in detail. Unlock quickly to improve your efficiency!
How many holes have you stepped on in BigDecimal?
汉字风格迁移篇---通过生成对抗网络学习一对多程式化汉字的转换和生成
Add and modify the verification logic, and use -validation- to complete the group verification
Principle of image nonlocal mean filtering
黑吃黑?男子破解赌博网站漏洞,每月“薅羊毛”10多万元
Nacos 介绍和部署
There was an unexpected error (type=method not allowed, status=405)
Correspondence between IEC61131 data type and C data type
【ACWing】1268. 简单题
Have you known several distribution methods of NFT? What are the advantages and disadvantages of different distribution methods?
MySQL基础学习
Good at C (summer vacation daily question 6)