ABAP 中未触发选择开始?
START-OF-SELECTION not triggered in ABAP?
我正在学习this本书并引用第 5 章:
You are being introduced to the event START-OF-SELECTION. The first
thing to understand about an event is to know when an event is
triggered: that is, when program control jumps to the code under an
event.
Scenario-I If there are no PARAMETERS statements in a program,
pressing the function key F8 will begin the execution of the program
starting from the first nondeclarative statement in the program.
In the scenario-I (no PARAMETERS statement/s) when the program is
executed, control jumps to the event START-OF-SELECTION.
所以这里有我的示例代码:
REPORT ZTMP_TEST_INNBOUND.
WRITE 'Hello World!'.
START-OF-SELECTION.
WRITE 'Big-Bang first..'.
我希望先打印 "Bing-Bang First",但事实并非如此。
这是输出:
Hello World!
Big-Bang first..
为什么输出不是相反?关于 START-OF-SELECTION ,我对书中解释的内容的理解是错误的吗?
根据 SAP,在可执行程序中,REPORT 或 PROGRAM 语句与第一个处理块之间出现的任何非声明性语句也在 START-OF-SELECTION 块中处理。因此,在您的代码示例中,第一个写入将执行,然后是第二个。
我正在学习this本书并引用第 5 章:
You are being introduced to the event START-OF-SELECTION. The first thing to understand about an event is to know when an event is triggered: that is, when program control jumps to the code under an event.
Scenario-I If there are no PARAMETERS statements in a program, pressing the function key F8 will begin the execution of the program starting from the first nondeclarative statement in the program.
In the scenario-I (no PARAMETERS statement/s) when the program is executed, control jumps to the event START-OF-SELECTION.
所以这里有我的示例代码:
REPORT ZTMP_TEST_INNBOUND.
WRITE 'Hello World!'.
START-OF-SELECTION.
WRITE 'Big-Bang first..'.
我希望先打印 "Bing-Bang First",但事实并非如此。
这是输出:
Hello World!
Big-Bang first..
为什么输出不是相反?关于 START-OF-SELECTION ,我对书中解释的内容的理解是错误的吗?
根据 SAP,在可执行程序中,REPORT 或 PROGRAM 语句与第一个处理块之间出现的任何非声明性语句也在 START-OF-SELECTION 块中处理。因此,在您的代码示例中,第一个写入将执行,然后是第二个。