While debugging abap code I found an interessting code construct.
method_name(: Parameter1 ), Parameter2 ).
As far as I can tell this one calls the method twice. The first time with the first parameter and the second time with the second. Unfortunately I have no idea how this construct is called and so I can't find any documentation in the SAP docu or with google.
I can tell that this works but is this an official construct? Does it work with more than two parameters? (E.g. four times)
Best regards, Dirk
Congratulations, you've found an obscure and most certainly discouraged use of a so-called chained statement. Using this for method calls is not recommended, but since it was once allowed, SAP will be very reluctant to remove this again...
When the ABAP compiler finds a colon, it first expands it blindly without any syntax check (expanding A:B,C,D. into A B. A C. A D.).
And only then it analyses the syntax of each of them - to tell whether it is an assignment, method call or whatever. Pavel
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With