Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
ABAP
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Chained statements=== Consecutive statements with an identical first (leftmost) part can be combined into a "chained" statement using the chain operator <code>:</code>. The common part of the statements is written to the left of the colon, the differing parts are written to the right of the colon and separated by commas. The colon operator is attached directly to the preceding token, without a space (the same applies to the commas in the token list on, as can be seen in the examples below). Chaining is often used in <code>WRITE</code> statements. <code>WRITE</code> accepts just one argument, so if for instance you wanted to display three fields from a structure called FLIGHTINFO, you would have to code: <syntaxhighlight lang="abap"> WRITE FLIGHTINFO-CITYFROM. WRITE FLIGHTINFO-CITYTO. WRITE FLIGHTINFO-AIRPTO. </syntaxhighlight> Chaining the statements results in a more readable and more intuitive form: <syntaxhighlight lang="abap"> WRITE: FLIGHTINFO-CITYFROM, FLIGHTINFO-CITYTO, FLIGHTINFO-AIRPTO. </syntaxhighlight> In a chain statement, the first part (before the colon) is not limited to the statement name alone. The entire common part of the consecutive statements can be placed before the colon. Example: <syntaxhighlight lang="abap"> REPLACE 'A' WITH 'B' INTO LASTNAME. REPLACE 'A' WITH 'B' INTO FIRSTNAME. REPLACE 'A' WITH 'B' INTO CITYNAME. </syntaxhighlight> could be rewritten in chained form as: <syntaxhighlight lang="abap"> REPLACE 'A' WITH 'B' INTO: LASTNAME, FIRSTNAME, CITYNAME. </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)