abap multiple method call

1.4k Views Asked by At

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

2

There are 2 best solutions below

1
On BEST ANSWER

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...

0
On

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