ABAP:从例子学习ABAP
1、插入内表行:
*插入内表行:
DATA: BEGIN OF man,
name(20) TYPE c,
high TYPE p DECIMALS 2,
weight TYPE p DECIMALS 2,
END OF man. DATA: man1 LIKE TABLE OF man. man-name = '张参'.
man-high = '1.68'.
man-weight = 120.
INSERT man INTO TABLE man1. man-name = '刘志'.
man-high = '1.78'.
man-weight = 160.
INSERT man INTO TABLE man1. LOOP AT man1 INTO man.
WRITE: / man-name,man-high,man-weight.
ENDLOOP.
ULINE. man-name = '钱华'.
man-high = '2.22'.
man-weight = 220.
INSERT man INTO man1 INDEX 3. LOOP AT man1 INTO man.
WRITE: / man-name,man-high,man-weight.
ENDLOOP. ULINE.
man-name = '钱华'.
man-high = '2.22'.
man-weight = 220.
INSERT man INTO man1 INDEX 1. LOOP AT man1 INTO man.
WRITE: / man-name,man-high,man-weight.
ENDLOOP.
2、读取文件
2.1、使用upload函数
*读放文件
DATA: BEGIN OF man,
name(20) TYPE c,
high TYPE p DECIMALS 2,
weight TYPE p DECIMALS 2,
END OF man. DATA: man1 LIKE TABLE OF man. CALL FUNCTION 'UPLOAD'
EXPORTING
codepage = 'test'
filename = 'd:\temp\testa.txt'
filetype = 'dat'
item = '读取文件'
TABLES
data_tab = man1
EXCEPTIONS
invalid_filesize = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
OTHERS = 7.
IF sy-subrc <> 0.
* message id sy-msgid type sy-msgty number sy-msgno
* with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. LOOP AT man1 INTO man.
WRITE: / man-name,man-high,man-weight.
ENDLOOP.
2.2、使用WS_UPLOAD函数
*读取文件
DATA: BEGIN OF man,
name() TYPE c,
high TYPE p DECIMALS ,
weight TYPE p DECIMALS ,
END OF man. DATA: man1 LIKE TABLE OF man. CALL FUNCTION 'WS_UPLOAD'
EXPORTING
codepage = 'test'
filename = 'd:\temp\testa.txt'
filetype = 'DAT'
TABLES
data_tab = man1
EXCEPTIONS
invalid_filesize =
invalid_table_width =
invalid_type =
no_batch =
unknown_error =
gui_refuse_filetransfer =
OTHERS = .
IF sy-subrc <> .
* message id sy-msgid type sy-msgty number sy-msgno
* with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. LOOP AT man1 INTO man.
WRITE: / man-name,man-high,man-weight.
ENDLOOP.
2.3、使用GUI_UPLOAD函数
*直接读取文件
DATA: BEGIN OF man,
name() TYPE c,
high TYPE p DECIMALS ,
weight TYPE p DECIMALS ,
END OF man. DATA: man1 LIKE TABLE OF man. CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'd:\temp\testa.txt'
FILETYPE = 'DAT'
* HAS_FIELD_SEPARATOR = ' '
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* VIRUS_SCAN_PROFILE =
* NO_AUTH_CHECK = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
tables
data_tab = man1
* CHANGING
* ISSCANPERFORMED = ' '
* EXCEPTIONS
* FILE_OPEN_ERROR = 1
* FILE_READ_ERROR = 2
* NO_BATCH = 3
* GUI_REFUSE_FILETRANSFER = 4
* INVALID_TYPE = 5
* NO_AUTHORITY = 6
* UNKNOWN_ERROR = 7
* BAD_DATA_FORMAT = 8
* HEADER_NOT_ALLOWED = 9
* SEPARATOR_NOT_ALLOWED = 10
* HEADER_TOO_LONG = 11
* UNKNOWN_DP_ERROR = 12
* ACCESS_DENIED = 13
* DP_OUT_OF_MEMORY = 14
* DISK_FULL = 15
* DP_TIMEOUT = 16
* OTHERS = 17
.
IF sy-subrc <> .
* Implement suitable error handling here
ENDIF. LOOP AT man1 INTO man.
WRITE: / man-name,man-high,man-weight.
ENDLOOP.
2.4、读取文件小例子
DATA file_table TYPE file_table. "引用FILE_TABLE对象 DATA: lt_file_names TYPE filetable,
lwa_file_name LIKE LINE OF lt_file_names,
lv_subrc TYPE i. SELECT-OPTIONS: i_file FOR file_table NO INTERVALS. AT SELECTION-SCREEN ON VALUE-REQUEST FOR i_file-low.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
* WINDOW_TITLE =
* DEFAULT_EXTENSION =
* DEFAULT_FILENAME =
* FILE_FILTER =
initial_directory = 'd:\temp'
multiselection = 'X'
CHANGING
file_table = lt_file_names[]
rc = lv_subrc "打开文件的数量
* USER_ACTION =
EXCEPTIONS
file_open_dialog_failed =
cntl_error =
error_no_gui =
OTHERS = .
IF sy-subrc <> .
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. i_file-sign = 'I'.
i_file-option = 'EQ'. LOOP AT lt_file_names INTO lwa_file_name.
i_file-low = lwa_file_name.
APPEND i_file.
ENDLOOP. START-OF-SELECTION.
WRITE:'打开文件的数量:',lv_subrc LEFT-JUSTIFIED.
WRITE: / '打开文件的数量:',LINES( i_file ) LEFT-JUSTIFIED.
LOOP AT i_file.
WRITE: / i_file-low.
ENDLOOP.
3、保存文件
*保存文件
DATA: BEGIN OF man,
name(20) TYPE c,
high TYPE p DECIMALS 2,
weight TYPE p DECIMALS 2,
END OF man. DATA: man1 LIKE TABLE OF man.
DATA: name TYPE rlgrap-filename, typa TYPE rlgrap-filetype. man-name = '张参'.
man-high = '1.68'.
man-weight = 120.
INSERT man INTO TABLE man1. man-name = '刘志'.
man-high = '1.78'.
man-weight = 160.
INSERT man INTO TABLE man1. man-name = '钱华'.
man-high = '2.22'.
man-weight = 220.
INSERT man INTO man1 INDEX 2. name = 'd:\temp\testad.txt'.
typa = 'dat'. CALL FUNCTION 'DOWNLOAD'
EXPORTING
codepage = 'testa'
filename = name
filetype = typa
item = '文件测试'
TABLES
data_tab = man1
EXCEPTIONS
invalid_filesize = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer
=6
OTHERS = 7.
IF
sy-subrc <> 0.
* message id sy-msgid type sy-msgty number sy-msgno
* with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
4、格式化输出
DATA wa LIKE spfli.
WRITE:/. WRITE:10'航班承运人',40'航班连接',60'国家代码',80'起飞城市',100'起飞机场'.
5、内表排序
*内表排序
DATA: BEGIN OF man,
name(20) TYPE c,
high TYPE p DECIMALS 2,
weight TYPE p DECIMALS 2,
END OF man. DATA: man1 LIKE hashed TABLE OF man with unique key name. man-name = '张参'.
man-high = '1.68'.
man-weight = 120.
INSERT man INTO TABLE man1. man-name = '刘志'.
man-high = '1.78'.
man-weight = 160.
INSERT man INTO TABLE man1. man-name = '钱华'.
man-high = '2.22'.
man-weight = 220.
INSERT man INTO table man1. LOOP AT man1 INTO man.
WRITE: / man-name,man-high,man-weight.
ENDLOOP.
ULINE. sort man1 ascending by weight descending .
skip.
uline.
LOOP AT man1 INTO man.
WRITE: / man-name,man-high,man-weight.
ENDLOOP.
6、消息
*消息
*--开始
*DATA: msg1(20) TYPE c VALUE '测试'.
*DATA: msg2(20) TYPE c VALUE 'ABAP'.
*DATA: msg3(20) TYPE c VALUE '消息!'.
*
*MESSAGE i006(ymess) WITH msg1 msg2 msg3.
*
*data:BEGIN OF man,
* name(30) TYPE c,
* high TYPE p DECIMALS 2,
* weight TYPE p DECIMALS 2,
*END OF man.
*
*FIELD-SYMBOLS <fsa> LIKE man.
*DATA man1 LIKE man.
*
*man-name = '雨荷'.
*man-high = '1.78'.
*man-weight = 140.
*
*ASSIGN man TO <fsa>.
*WRITE:/ <fsa>-name,
* man-high,
*<fsa>-weight.
*--结束 *--开始
*DATA: msg1(20) TYPE c VALUE '测试'.
*DATA: msg2(20) TYPE c VALUE 'ABAP'.
*DATA: msg3(20) TYPE c VALUE '消息!'.
*
*MESSAGE i001(00) WITH msg1 msg2 msg3.
*
*
*DATA: c1(2) TYPE c,
* c2(2) TYPE c,
* c3(2) TYPE c,
* c4(2) TYPE c,
* c5(20) TYPE c VALUE '91* 12*23*344445',
* c9(2) TYPE c.
*
*c9 = '* '.
*WRITE: / .
*WRITE c5.
*SPLIT c5 AT c9 INTO c1 c2 c3 c4 .
*WRITE: / c1,c2,c3,c4.
*--结束 *--开始
*DATA: msg1(20) TYPE c VALUE '测试'.
*DATA: msg2(20) TYPE c VALUE 'ABAP'.
*DATA: msg3(20) TYPE c VALUE '消息!'.
*
*MESSAGE i001(00) WITH msg1 msg2 msg3.
*
*
*DATA: BEGIN OF man,
* name(20) TYPE c,
* high TYPE p DECIMALS 2,
* weight TYPE p DECIMALS 2,
*END OF man.
*
*DATA: man1 LIKE TABLE OF man WITH HEADER LINE,
*man2 LIKE TABLE OF man.
*
*man-name = '张参'.
*man-high = '1.68'.
*man-weight = 120.
*APPEND man TO man1.
*
*man-name = '刘志'.
*man-high = '1.78'.
*man-weight = 160.
*APPEND man TO man1.
*
*MOVE man1[] TO man2.
*
*
* WRITE: / man-name,man-high,man-weight.
*
*
*LOOP AT man1.
*write: / man1-name,man1-high,man1-weight.
*ENDLOOP.
*--结束
7、读取数据表
**读取数据表
*定义工作区
DATA a_spfli TYPE spfli.
*定义内表,请注意有Header line
DATA ta_spfli TYPE TABLE OF spfli WITH HEADER LINE.
*分隔线
ULINE.
WRITE / '使用工作区'.
ULINE.
* 将数据表逐行转移至工作区,只读前5行
SELECT * INTO CORRESPONDING FIELDS OF
a_spfli FROM spfli UP TO ROWS.
WRITE: / a_spfli-connid,a_spfli-carrid,a_spfli-cityfrom,
a_spfli-cityto.
ENDSELECT. ULINE.
WRITE / '使用内表'.
ULINE.
SELECT * INTO CORRESPONDING FIELDS OF
TABLE ta_spfli FROM spfli UP TO ROWS.
*从数据表读数据至内表,直接从内表输出
*如果TA_SPFLI没有定义Header line,会出错
LOOP AT ta_spfli.
WRITE: / a_spfli-connid,a_spfli-carrid,a_spfli-cityfrom,
a_spfli-cityto.
ENDLOOP.
ULINE.
WRITE / '将内表数据转移至工作区'.
ULINE.
LOOP AT ta_spfli INTO a_spfli.
WRITE: / a_spfli-connid,a_spfli-carrid,a_spfli-cityfrom,
a_spfli-cityto.
ENDLOOP.
8、内连接和外连接
*内连接和外连接
*定义结构
DATA: BEGIN OF arcd,
carrid TYPE spfli-carrid,
connid TYPE spfli-connid,
fldate TYPE sflight-fldate,
END OF arcd.
*工作区
DATA arcd1 LIKE arcd.
*关联数据表,读取前10条记录,写入工作区,并输出
SELECT spfli~carrid spfli~connid sflight~fldate INTO arcd1 FROM spfli
INNER JOIN sflight ON spfli~carrid = sflight~carrid
AND spfli~connid = sflight~connid UP TO ROWS.
WRITE: / arcd1-carrid,arcd1-connid,arcd1-fldate.
ENDSELECT.
9、使用package size 读取数据
**使用package size 读取数据
*定义内表,请注意有Header line
DATA wa_spfli TYPE TABLE OF spfli WITH HEADER LINE.
*分隔线
ULINE.
* 以每次读取5条记录,直到读取所有数据
SELECT * INTO TABLE wa_spfli FROM spfli PACKAGE SIZE .
*输出内表记录
LOOP AT wa_spfli.
WRITE: / wa_spfli-connid,wa_spfli-carrid,wa_spfli-cityfrom,
wa_spfli-cityto.
ENDLOOP.
*输出5条记录后输出一条横线
ULINE.
ENDSELECT.
10、交互式列表
**交互式列表
START-OF-SELECTION.
WRITE:'初如列表,sy-lsind = ' ,sy-lsind. AT LINE-SELECTION.
IF sy-lsind = .
WRITE: '第二列表,sy-lsind =',sy-lsind.
ENDIF. AT LINE-SELECTION.
IF sy-lsind = .
WRITE: '第三列表,sy-lsind =',sy-lsind.
ENDIF.
11、列表颜色
**列表颜色
*数据库表spfli相关
TABLES spfli.
SKIP. *输出表头,背景灰蓝
FORMAT COLOR COL_HEADING.
ULINE AT /(). WRITE: / sy-vline,() '航线承运人', sy-vline , () '航班连接', sy-vline,
() '国家代码', sy-vline,() '起飞城市', sy-vline,
() '起飞机场',sy-vline.
ULINE AT /().
FORMAT COLOR OFF.
*输出内容,输出关键值为‘LH’为红色
SELECT * FROM spfli.
IF spfli-carrid = 'LH'.
FORMAT COLOR COL_NEGATIVE.
ELSE.
FORMAT COLOR OFF.
ENDIF.
WRITE: / sy-vline,() spfli-carrid,sy-vline,() spfli-connid,sy-vline,
() spfli-countryto, sy-vline,() spfli-cityfrom,sy-vline,()
spfli-airpfrom,sy-vline.
ULINE AT /().
ENDSELECT.
12、输出热点
**输出热点
start-of-selection.
write '请按'.
format hotspot on color inverse on.
write '热点'.
format hotspot off color off.
at line-selection.
write 'welcome!'.
13、为列表定义工具条和菜单
*为列表定义工具条和菜单
START-OF-SELECTION.
* 设置已使用的状态条
SET PF-STATUS 'STA1'.
WRITE:'测试工具条按钮 '. AT USER-COMMAND.
*当单击按钮时输出
CASE sy-ucomm.
WHEN '&NFO'.
WRITE: '已选择!'.
WHEN 'E'.
leave to screen .
when others.
WRITE ''.
ENDCASE.
14、在弹出式窗口中显示列表
*在弹出式窗口中显示列表
START-OF-SELECTION.
* 设置已使用的状态条
SET PF-STATUS 'STA1'.
WRITE:'测试工具条按钮 '. AT USER-COMMAND.
*当单击按钮时输出
CASE sy-ucomm.
WHEN '&NFO'.
WRITE: '已选择!'.
WHEN 'E'.
leave to screen .
when others.
IF sy-lsind = .
SET PF-STATUS 'STA1'.
*定义子窗口并输出
WINDOW STARTING AT ENDING AT .
WRITE '在子窗口输出!'.
WRITE: '请注意!'.
ENDIF.
ENDCASE.
15、隐藏字段技术
**隐藏字段技术
*数据库表spfli相关
TABLES: spfli, sflight. START-OF-SELECTION.
SKIP.
*输出
ULINE AT /(). WRITE: / sy-vline,() '航线承运人', sy-vline , () '航班连接', sy-vline,
() '国家代码', sy-vline,() '起飞城市', sy-vline,
() '起飞机场',sy-vline.
ULINE AT /(). *输出
SELECT * FROM spfli
* WHERE carrid = 'UA' AND connid = 3504
.
WRITE: / sy-vline,() spfli-carrid,sy-vline,
() spfli-connid,sy-vline,
() spfli-countryto,sy-vline,
() spfli-cityfrom,sy-vline,
() spfli-airpfrom, sy-vline.
*隐藏关键字
HIDE: spfli-carrid,spfli-connid.
ULINE AT /().
ENDSELECT. AT LINE-SELECTION.
*只输出第一页
IF sy-lsind = .
write : / 'spfli-carrid:',spfli-carrid.
write : / 'spfli-connid:',spfli-connid.
ULINE AT /().
WRITE: / sy-vline,() '航线承运人', sy-vline , () '航班连接', sy-vline,
() '国家代码', sy-vline,() '起飞城市', sy-vline,
() '起飞机场',sy-vline.
ULINE AT /().
*根据隐藏字段读取并打印从表
SELECT * FROM sflight
WHERE carrid = spfli-carrid AND connid = spfli-connid
.
WRITE: / sy-vline,() spfli-carrid,sy-vline,
() spfli-connid,sy-vline,
() spfli-countryto,sy-vline,
() spfli-cityfrom,sy-vline,
() spfli-airpfrom, sy-vline.
ULINE AT /().
ENDSELECT.
ENDIF.
16、使用hide技术从列表读取行
**使用hide技术从列表读取行
*数据库表spfli相关
TABLES: spfli.
DATA: sela() TYPE c,
num TYPE i VALUE . START-OF-SELECTION.
SKIP.
*输出
ULINE AT /(). WRITE: / sy-vline,'',sy-vline,() '航线承运人', sy-vline , ()
'航班连接', sy-vline,() '国家代码', sy-vline,()
'起飞城市', sy-vline,() '起飞机场',sy-vline.
ULINE AT /(). *输出
SELECT * FROM spfli.
WRITE: / sy-vline,sela AS CHECKBOX,sy-vline,() spfli-carrid,
sy-vline,() spfli-connid,sy-vline,() spfli-countryto,
sy-vline,() spfli-cityfrom,sy-vline,
() spfli-airpfrom,sy-vline.
* 隐藏关键字
HIDE: spfli-carrid,spfli-connid,spfli-countryto,
spfli-cityfrom,spfli-airpfrom.
ULINE AT /().
* 隐藏选择框,使表格行不会选择
HIDE sela.
num = num + .
ENDSELECT. END-OF-SELECTION.
* num1 = sy-lsind - 1. AT LINE-SELECTION.
WRITE : 'sy-lsind:',sy-lsind.
WRITE : 'num:',num.
*只输出第一页
IF sy-lsind = .
DO num TIMES.
* 读取行
READ LINE sy-index FIELD VALUE sela.
* 如果checked,输出隐含字段
IF sela = 'X'.
WRITE: / spfli-carrid,spfli-connid,spfli-countryto,
spfli-cityfrom,spfli-airpfrom.
ENDIF.
ENDDO.
ENDIF.
ABAP:从例子学习ABAP的更多相关文章
- 【ABAP系列】SAP ABAP中ALV使用HTML的例子
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP ABAP中ALV使用HT ...
- 【ABAP系列】SAP ABAP模块-memory内存数据传输的例子
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP ABAP模块-memor ...
- 【ABAP系列】SAP ABAP 资产类BAPI过账 BAPI_ACC_DOCUMENT_POST
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP ABAP 资产类BAPI ...
- 【ABAP CDS系列】ABAP CDS中的系统信息
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP CDS系列]ABAP CDS中的系统 ...
- 【ABAP系列】SAP ABAP 高级业务应用程序编程(ABAP)
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP ABAP 高级业务应用程 ...
- 【ABAP系列】SAP ABAP 带有参数的AMDP的创建
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP ABAP 带有参数的AM ...
- 【ABAP系列】SAP ABAP 行列转换的方法
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP ABAP 行列转换的方法 ...
- 【ABAP系列】SAP ABAP MRKO增强
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP ABAP MRKO增强 ...
- 【ABAP系列】SAP ABAP常用正则表达式大全
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP ABAP常用正则表达式大 ...
随机推荐
- Stream接口
数据读写可以看作是事件模式(Event)的特例,不断发送的数据块好比一个个的事件.读数据是read事件,写数据是write事件,而数据块是事件附带的信息.Node 为这类情况提供了一个特殊接口Stre ...
- sklearn常用数据的使用
from sklearn import datasets from sklearn.linear_model import LinearRegression #加载数据 loaded_data = d ...
- 11.Weblogic-SSRF漏洞复现
应为这一阵正好在学习SSRF漏洞,又苦于本人太菜没有挖到SSRF,只能复现... 先贴出很早之前央视网SSRF可窥探内网(Weblogic SSRF案例):https://www.secpulse.c ...
- C#——各种参数,扩展方法
余近日复习C#之基础知识,故作一随笔,也是对此前几篇博客中所记录的传值参数相关内容之汇总,还望诸位加以批评指正. 该博客包括以下内容: 传值参数 引用参数 输出参数 数组参数 具名参数 可选参数 扩展 ...
- Postman使用-1
文章来源:http://www.cnplugins.com/tool/specify-postman-methods.html https://www.cnblogs.com/Skyyj/p/6856 ...
- .Net Core中依赖注入服务使用总结
一.依赖注入 引入依赖注入的目的是为了解耦和.说白了就是面向接口编程,通过调用接口的方法,而不直接实例化对象去调用.这样做的好处就是如果添加了另一个种实现类,不需要修改之前代码,只需要修改注入的地方将 ...
- [开源]OSharpNS 步步为营系列 - 5. 添加前端Angular模块[完结]
什么是OSharp OSharpNS全称OSharp Framework with .NetStandard2.0,是一个基于.NetStandard2.0开发的一个.NetCore快速开发框架.这个 ...
- 远程桌面连接KVM虚拟机
问题描述 有些时候,由于网络存在问题,虚拟机无法获取到IP地址,无法使用spice或vnc来连接虚拟机,但是又需要连到虚拟机来排查故障 解决办法 编辑虚拟机配置 设置xml命名空间 <domai ...
- vue使用webpack压缩后体积过大要怎么优化
vue使用webPack压缩后存储过大,怎么优化 在生产环境去除developtool选项 在webpack.config.js中设置的developtool选项,仅适用于开发环境,这样会造成打包成的 ...
- Unity---DOTween插件学习(3)---获取数据、协程、路径动画
目录 10.获取数据 11.携程 12.路径动画 本文及系列参考于Andy老师的DOTween系列 欢迎大家关注Andy老师 10.获取数据 类方法 返回所有暂停的动画,没有则返回null var l ...