With release 7.40 ABAP becomes extensively expression oriented. Besides the news I blogged about up to now, there are many new expression enabled operand positions, some new formatting options for string templates, and new built-in functions (e.g. ipow that can be used instead of **).
How do you write assignments in such an expression oriented world?
Clearly as
lhs = rhs.
Where rhs is
And some expression can be even lhs.
In this world there is no place for old fashioned statements MOVE and COMPUTE any more.
So it's time to say goodbye and both are declared obsolete in the ABAP Keyword documentation
(like CALL METHOD for static method calls in Release 7.03/7.31 before).
You remember that one?
MOVE rhs TO lhs.
Everything you can write with MOVE you can write with the assignment operator =.
But you cannot write everything that is possible with the assignment operator with MOVE!
Clearly MOVE has expired ...
With COMPUTE it's another way around.
COMPUTE lhs = rhs.
You can write COMPUTE in front of each assignment with the assignment operator = and it has absolutely no effect on the statement!
You can even write
COMPUTE lhs ?= rhs.
That makes no sense!
The only assignment where COMPUTE makes sense from the literal meaning of the word is that where you have an arithmetic expression as rhs, That's where it comes from (in stone age ABAP we had only assignments of data objects with MOVE and arithmetic calculations with COMPUTE). But nowadays it is simply superfluous to write COMPUTE in front of assignments.
Leave it away in new programs!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
3 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 |