2019-02-15——ABAP1基本语法
2019-02-15 本文已影响0人
林之禾
write
write 'Hello'.
write 'ABAP'.
write 'World'.
write: 'Hello',
'ABAP',
'World'.
write:'Hello','ABAP','World'.
全行注释
* This is the comment line
部分行注释
write 'Hello'. "Here is the partial comment
抑制空白
NO-ZERO命令在DATA语句之后。它抑制包含空格的数字字段的所有前导零。
report z_test123_01.
data: w_nur(10) type n.
move 50 to w_nur.
write w_nur no-zero.
50
没有 no-zero,则输出:
0000000050
空白线
write 'this is the 1st line'.
skip.
write 'this is the 2nd line'.
this is the 1st line
this is the 2nd line
可以使用skip命令插入多个空白行
skip number_of_lines.
输出将是由线数定义的几个空白行。skip命令还可以将光标定位在页面上所需的行上。
skip to line line_number.
插入线
uline 命令自动在输出插入一条水平线。也可以控制线的位置和长度
uline.
消息
信息 | 类型 | 后果 |
---|---|---|
E | Error | 消息出现,应用程序在当前点暂停。 如果程序在后台模式下运行,则作业将被取消,并且消息将记录在作业日志中 |
W | Warning | 将出现该消息,用户必须按Enter键才能继续应用程序。 在后台模式下,消息将记录在作业日志中。 |
I | Information | 将打开一个弹出窗口,其中包含消息文本,用户必须按Enter键才能继续。 在后台模式下,消息将记录在作业日志中。 |
A | Abend | 此消息类将取消用户当前正在使用的事务。 |
S | Success | 这会在屏幕底部提供一条信息性消息。 显示的信息是正性的,它只是为用户反馈。 该消息不以任何方式阻碍程序 |
X | Abort | 此消息中止程序并生成ABAP短转储。 |
当为消息创建消息时,ID AB, MESSAGE命令 - MESSAGE E011给出一下输出:
eab011 this report does not support sub-number summarization